diff options
author | Florian Westphal <fw@strlen.de> | 2019-05-31 19:27:06 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-03 04:06:26 +0300 |
commit | b8d19572367bb019f77bbc921ef6bf965f1c8b22 (patch) | |
tree | d8e4e3c0cefa30ff346c6bc38a0a34d30954affa /net/netfilter/nf_conntrack_broadcast.c | |
parent | d519e8708b06a6ec9e6d7f67175649fd624558f5 (diff) | |
download | linux-b8d19572367bb019f77bbc921ef6bf965f1c8b22.tar.xz |
netfilter: use in_dev_for_each_ifa_rcu
Netfilter hooks are always running under rcu read lock, use
the new iterator macro so sparse won't complain once we add
proper __rcu annotations.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/netfilter/nf_conntrack_broadcast.c')
-rw-r--r-- | net/netfilter/nf_conntrack_broadcast.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_broadcast.c b/net/netfilter/nf_conntrack_broadcast.c index 5423b197d98a..a5dbc3676a4f 100644 --- a/net/netfilter/nf_conntrack_broadcast.c +++ b/net/netfilter/nf_conntrack_broadcast.c @@ -41,12 +41,17 @@ int nf_conntrack_broadcast_help(struct sk_buff *skb, in_dev = __in_dev_get_rcu(rt->dst.dev); if (in_dev != NULL) { - for_primary_ifa(in_dev) { + const struct in_ifaddr *ifa; + + in_dev_for_each_ifa_rcu(ifa, in_dev) { + if (ifa->ifa_flags & IFA_F_SECONDARY) + continue; + if (ifa->ifa_broadcast == iph->daddr) { mask = ifa->ifa_mask; break; } - } endfor_ifa(in_dev); + } } if (mask == 0) |