|
0 |
commit 65cb5c100eb1e5891f145be0b89aaa3c2d2e4317
|
|
1 |
Author: Pablo Neira Ayuso <pablo@netfilter.org>
|
|
2 |
Date: Fri Feb 18 18:58:21 2011 +0100
|
|
3 |
|
|
4 |
netlink: fix wrong use of netlink flags for dump operations
|
|
5 |
|
|
6 |
The avahi-daemon uses a wrong flag combination to operate with
|
|
7 |
rtnetlink. This patch fixes the problems.
|
|
8 |
|
|
9 |
No need to set NLM_F_ACK since the dump operation already includes
|
|
10 |
the trailing NLMSG_DONE message that informs about the end of the
|
|
11 |
dump operation.
|
|
12 |
|
|
13 |
diff --git a/avahi-autoipd/iface-linux.c b/avahi-autoipd/iface-linux.c
|
|
14 |
index fc27829..83e9e41 100644
|
|
15 |
--- a/avahi-autoipd/iface-linux.c
|
|
16 |
+++ b/avahi-autoipd/iface-linux.c
|
|
17 |
@@ -262,7 +262,7 @@ int iface_get_initial_state(State *state) {
|
|
18 |
n->nlmsg_len = NLMSG_LENGTH(sizeof(*ifi));
|
|
19 |
n->nlmsg_type = RTM_GETLINK;
|
|
20 |
n->nlmsg_seq = seq;
|
|
21 |
- n->nlmsg_flags = NLM_F_MATCH|NLM_F_REQUEST|NLM_F_ACK;
|
|
22 |
+ n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
|
|
23 |
n->nlmsg_pid = 0;
|
|
24 |
|
|
25 |
ifi = NLMSG_DATA(n);
|
|
26 |
diff --git a/avahi-core/iface-linux.c b/avahi-core/iface-linux.c
|
|
27 |
index a1b7f73..4d12f73 100644
|
|
28 |
--- a/avahi-core/iface-linux.c
|
|
29 |
+++ b/avahi-core/iface-linux.c
|
|
30 |
@@ -53,7 +53,7 @@ static int netlink_list_items(AvahiNetlink *nl, uint16_t type, unsigned *ret_seq
|
|
31 |
n = (struct nlmsghdr*) req;
|
|
32 |
n->nlmsg_len = NLMSG_LENGTH(sizeof(struct rtgenmsg));
|
|
33 |
n->nlmsg_type = type;
|
|
34 |
- n->nlmsg_flags = NLM_F_ROOT|NLM_F_REQUEST;
|
|
35 |
+ n->nlmsg_flags = NLM_F_REQUEST|NLM_F_DUMP;
|
|
36 |
n->nlmsg_pid = 0;
|
|
37 |
|
|
38 |
gen = NLMSG_DATA(n);
|