X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Frtnetlink.c;h=6ed85abbba2b5e51f35ca969e75f041f6c9ddb1b;hb=cceb11f5b12d09cc8afc87ca4fd03e941234d439;hp=cc175b41ea5fe05b2c8e51b6a180bb88b1b397d0;hpb=18c58479a14f760fb03c2062f9a35961fc74ebb5;p=sliver-openvswitch.git diff --git a/lib/rtnetlink.c b/lib/rtnetlink.c index cc175b41e..6ed85abbb 100644 --- a/lib/rtnetlink.c +++ b/lib/rtnetlink.c @@ -89,13 +89,20 @@ rtnetlink_notifier_register(struct rtnetlink *rtn, rtnetlink_notify_func *cb, void *aux) { if (!rtn->notify_sock) { - int error = nl_sock_create(NETLINK_ROUTE, rtn->multicast_group, 0, 0, - &rtn->notify_sock); + struct nl_sock *sock; + int error; + + error = nl_sock_create(NETLINK_ROUTE, &sock); + if (!error) { + error = nl_sock_join_mcgroup(sock, rtn->multicast_group); + } if (error) { + nl_sock_destroy(sock); VLOG_WARN("could not create rtnetlink socket: %s", strerror(error)); return error; } + rtn->notify_sock = sock; } else { /* Catch up on notification work so that the new notifier won't * receive any stale notifications. */