]> git.meshlink.io Git - catta/commitdiff
netlink: fix wrong use of netlink flags for dump operations
authorPablo Neira Ayuso <pablo@netfilter.org>
Fri, 18 Feb 2011 17:58:21 +0000 (18:58 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 18 Feb 2011 17:58:21 +0000 (18:58 +0100)
The avahi-daemon uses a wrong flag combination to operate with
rtnetlink. This patch fixes the problems.

No need to set NLM_F_ACK since the dump operation already includes
the trailing NLMSG_DONE message that informs about the end of the
dump operation.

avahi-autoipd/iface-linux.c
avahi-core/iface-linux.c

index fc27829d43c9fbd989f7142d27fa90b9b12292a0..83e9e416bb38c6b4ce6f0f10bde9d89fe862118a 100644 (file)
@@ -262,7 +262,7 @@ int iface_get_initial_state(State *state) {
     n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
     n->nlmsg_type = RTM_GETLINK;
     n->nlmsg_seq = seq;
-    n->nlmsg_flags = NLM_F_MATCH|NLM_F_REQUEST|NLM_F_ACK;
+    n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
     n->nlmsg_pid = 0;
 
     ifi = NLMSG_DATA(n);
index a1b7f73ec48db314de2c718e5cc4ba58cab381fd..4d12f73504193d00332f56debdcdd8581f00bab7 100644 (file)
@@ -53,7 +53,7 @@ static int netlink_list_items(AvahiNetlink *nl, uint16_t type, unsigned *ret_seq
     n = (struct nlmsghdr*) req;
     n->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
     n->nlmsg_type = type;
-    n->nlmsg_flags = NLM_F_ROOT|NLM_F_REQUEST;
+    n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
     n->nlmsg_pid = 0;
 
     gen = NLMSG_DATA(n);