Skip to content

Commit

Permalink
update nexthop group support
Browse files Browse the repository at this point in the history
Signed-off-by: Kanji Nakano <[email protected]>
  • Loading branch information
nakano-omw authored and a114j0y committed Nov 20, 2024
1 parent 7a336d6 commit b4472ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions fpmsyncd/routesync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,6 @@ void RouteSync::onMsgRaw(struct nlmsghdr *h)
)
return;


if(h->nlmsg_type == RTM_NEWNEXTHOP || h->nlmsg_type == RTM_DELNEXTHOP)
{
len = (int)(h->nlmsg_len - NLMSG_LENGTH(sizeof(struct nhmsg)));
Expand Down Expand Up @@ -1893,8 +1892,12 @@ void RouteSync::onNextHopMsg(struct nlmsghdr *h, int len)

nhm = (struct nhmsg *)NLMSG_DATA(h);

netlink_parse_rtattr(tb, NHA_MAX, ((struct rtattr *)(((char *)(nhm)) + NLMSG_ALIGN(sizeof(struct nhmsg)))), len);
struct rtattr* rta;
char* nhm_ptr = (char *)(nhm) + NLMSG_ALIGN(sizeof(struct nhmsg));

memcpy(&rta, nhm_ptr, sizeof(struct rtattr));
netlink_parse_rtattr(tb, NHA_MAX, rta, len);

if (!tb[NHA_ID]) {
SWSS_LOG_ERROR(
"Nexthop group without an ID received from the zebra");
Expand Down
2 changes: 1 addition & 1 deletion fpmsyncd/routesync.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ class RouteSync : public NetMsg
uint16_t getEncapType(struct nlmsghdr *h);

const char *mySidAction2Str(uint32_t action);
#ifdef HAVE_NEXTHOP_GROUP

/* Handle Nexthop message */
void onNextHopMsg(struct nlmsghdr *h, int len);
/* Get next hop group key */
Expand Down

0 comments on commit b4472ee

Please sign in to comment.