Skip to content

Commit

Permalink
zebra: Don't bind netns ID netlink socket to mcast groups
Browse files Browse the repository at this point in the history
The netlink socket in `zebra_ns_id_get()` is only used to get netns id.
There's no need to subscribe to multicast groups. In some heavy-loaded
cases, unexpected notification races with normal reply message and
causes failure:

    zebra[110338]: [NMNEE-JJKPF][EC 4043309094] netlink recvmsg: bad sequence number 505ac8 (expected 66ea845f)

BTW, to subscribe to RTNLGRP_NSID, `nl_groups` should be
`1 << (RTNLGRP_NSID - 1)`. This code has never worked as expected.

Signed-off-by: Xiao Liang <[email protected]>
  • Loading branch information
leonshaw committed Sep 18, 2024
1 parent 7a7ae88 commit 3c527b4
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion zebra/zebra_netns_id.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ ns_id_t zebra_ns_id_get(const char *netnspath, int fd_param)
}
memset(&snl, 0, sizeof(snl));
snl.nl_family = AF_NETLINK;
snl.nl_groups = RTNLGRP_NSID;
snl.nl_pid = 0; /* AUTO PID */
ret = bind(sock, (struct sockaddr *)&snl, sizeof(snl));
if (ret < 0) {
Expand Down

0 comments on commit 3c527b4

Please sign in to comment.