Skip to content

Commit

Permalink
[linksync] Netdev oper status determination using IFF_RUNNING (#1568)
Browse files Browse the repository at this point in the history
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/sonic-buildimage#6295 for detailed information.

Signed-off-by: vedganes <vedavinayagam.ganesan@nokia.com>
  • Loading branch information
vganesan-nokia authored Mar 5, 2021
1 parent 0cce6db commit 0fa4d74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion portsyncd/linksync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj)

unsigned int flags = rtnl_link_get_flags(link);
bool admin = flags & IFF_UP;
bool oper = flags & IFF_LOWER_UP;
bool oper = flags & IFF_RUNNING;

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

0 comments on commit 0fa4d74

Please sign in to comment.