summaryrefslogtreecommitdiff
path: root/net/netfilter/nfnetlink_osf.c
diff options
context:
space:
mode:
authorFlorian Westphal <fw@strlen.de>2019-05-31 18:27:06 +0200
committerDavid S. Miller <davem@davemloft.net>2019-06-02 18:06:26 -0700
commitb8d19572367bb019f77bbc921ef6bf965f1c8b22 (patch)
treed8e4e3c0cefa30ff346c6bc38a0a34d30954affa /net/netfilter/nfnetlink_osf.c
parentd519e8708b06a6ec9e6d7f67175649fd624558f5 (diff)
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/nfnetlink_osf.c')
-rw-r--r--net/netfilter/nfnetlink_osf.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/netfilter/nfnetlink_osf.c b/net/netfilter/nfnetlink_osf.c
index f42326b40d6f..9f5dea0064ea 100644
--- a/net/netfilter/nfnetlink_osf.c
+++ b/net/netfilter/nfnetlink_osf.c
@@ -33,6 +33,7 @@ static inline int nf_osf_ttl(const struct sk_buff *skb,
{
struct in_device *in_dev = __in_dev_get_rcu(skb->dev);
const struct iphdr *ip = ip_hdr(skb);
+ const struct in_ifaddr *ifa;
int ret = 0;
if (ttl_check == NF_OSF_TTL_TRUE)
@@ -42,15 +43,13 @@ static inline int nf_osf_ttl(const struct sk_buff *skb,
else if (ip->ttl <= f_ttl)
return 1;
- for_ifa(in_dev) {
+ in_dev_for_each_ifa_rcu(ifa, in_dev) {
if (inet_ifa_match(ip->saddr, ifa)) {
ret = (ip->ttl == f_ttl);
break;
}
}
- endfor_ifa(in_dev);
-
return ret;
}