From: Vincent Bernat Date: Fri, 3 May 2013 19:19:21 +0000 (+0200) Subject: netlink: fix IP address discovery X-Git-Tag: 0.7.3~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=de461f15d7883d680a0ea5e739802f08928bba8c;p=thirdparty%2Flldpd.git netlink: fix IP address discovery Since the switch to Netlink, the IP address was not advertised correctly. Fix `netlink_send()`. Patch courtesy of Pradosh Mohapatra from Cumulus Networks. --- diff --git a/NEWS b/NEWS index 795e6396..e542518f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +lldpd (0.7.3) + * Fixes: + + Fix IPv4/IPv6 address discovery in Linux. + lldpd (0.7.2) * Features + lldpd can be configured through /etc/lldpd.conf and diff --git a/src/daemon/netlink.c b/src/daemon/netlink.c index 439483ce..1f0611fb 100644 --- a/src/daemon/netlink.c +++ b/src/daemon/netlink.c @@ -85,11 +85,11 @@ netlink_send(int s, int type, int family) struct netlink_req req = { .hdr = { .nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg)), - .nlmsg_type = RTM_GETLINK, + .nlmsg_type = type, .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP, .nlmsg_seq = 1, .nlmsg_pid = getpid() }, - .gen = { .rtgen_family = AF_PACKET } + .gen = { .rtgen_family = family } }; struct iovec iov = { .iov_base = &req,