blob: 877d97c74ed80e444bac65a7bae482ae4da96018 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
From: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Fri, 18 Feb 2011 17:58:21 +0000 (+0100)
Subject: netlink: fix wrong use of netlink flags for dump operations
X-Git-Tag: v0.6.29~17
X-Git-Url: http://git.0pointer.de/?p=avahi.git;a=commitdiff_plain;h=65cb5c100eb1e5891f145be0b89aaa3c2d2e4317
netlink: fix wrong use of netlink flags for dump operations
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.
---
diff --git a/avahi-autoipd/iface-linux.c b/avahi-autoipd/iface-linux.c
index fc27829..83e9e41 100644
--- a/avahi-autoipd/iface-linux.c
+++ b/avahi-autoipd/iface-linux.c
@@ -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);
diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c
index a1b7f73..4d12f73 100644
--- a/avahi-core/iface-linux.c
+++ b/avahi-core/iface-linux.c
@@ -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);
|