X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=drivers%2Fnet%2Ftap%2Ftap_netlink.c;h=6de896ab17b67824cc982fa585544f0af612dd7b;hb=c0bddd3a057f1ef34d2d5aa69e7338caa82de2bf;hp=9710e41a7801cd579fbeeb4e13307ffb2f71b99f;hpb=0b3e4ab9bf96aba051f9fce88062250dc86ee328;p=dpdk.git diff --git a/drivers/net/tap/tap_netlink.c b/drivers/net/tap/tap_netlink.c index 9710e41a78..6de896ab17 100644 --- a/drivers/net/tap/tap_netlink.c +++ b/drivers/net/tap/tap_netlink.c @@ -55,14 +55,21 @@ struct nested_tail { /** * Initialize a netlink socket for communicating with the kernel. * + * @param nl_groups + * Set it to a netlink group value (e.g. RTMGRP_LINK) to receive messages for + * specific netlink multicast groups. Otherwise, no subscription will be made. + * * @return * netlink socket file descriptor on success, -1 otherwise. */ int -nl_init(void) +nl_init(uint32_t nl_groups) { int fd, sndbuf_size = SNDBUF_SIZE, rcvbuf_size = RCVBUF_SIZE; - struct sockaddr_nl local = { .nl_family = AF_NETLINK }; + struct sockaddr_nl local = { + .nl_family = AF_NETLINK, + .nl_groups = nl_groups, + }; fd = socket(AF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); if (fd < 0) {