From de461f15d7883d680a0ea5e739802f08928bba8c Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Fri, 3 May 2013 21:19:21 +0200 Subject: [PATCH] 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. --- NEWS | 4 ++++ src/daemon/netlink.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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, -- 2.47.2