Skip to content

Commit 0fa4d74

Browse files
[linksync] Netdev oper status determination using IFF_RUNNING (sonic-net#1568)
The objective of this change is to make orchagent/linksync align with FRR/Zebra in handling interface states. Zebra uses IFF_RUNNING flag to determine interfaces' oper state while linksync uses IFF_LOWER_UP. Zebra rightly depends on IFF_RUNNING flag. As a routing daemon, zebra wants to know whether the interface is capable of passing packets or not. The flag IFF_RUNNING indicates exactly that (based on comment in if.h, this flag reflects the interface oper up state as defined in RFC2863). Since orchagent uses IFF_LOWER_UP, which comes earlier than IFF_RUNNING, there is interface state mismatch between zebra and orchagent for a window of time. Since with voq implementation we write static neigh/routes when the netdev (inband port) becomes oper up and bgp depends on these kernel entries, there is a need for this change to have the interface state timing same in both orchagent and zebra. Refer issue sonic-net#6295 for detailed information. Signed-off-by: vedganes <[email protected]>
1 parent 0cce6db commit 0fa4d74

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

portsyncd/linksync.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)
174174

175175
unsigned int flags = rtnl_link_get_flags(link);
176176
bool admin = flags & IFF_UP;
177-
bool oper = flags & IFF_LOWER_UP;
177+
bool oper = flags & IFF_RUNNING;
178178

179179
char addrStr[MAX_ADDR_SIZE+1] = {0};
180180
nl_addr2str(rtnl_link_get_addr(link), addrStr, MAX_ADDR_SIZE);

0 commit comments

Comments
 (0)