[NETFILTER]: Introduce NF_INET_ hook values
The IPv4 and IPv6 hook values are identical, yet some code tries to figure out the "correct" value by looking at the address family. Introduce NF_INET_* values for both IPv4 and IPv6. The old values are kept in a #ifndef __KERNEL__ section for userspace compatibility. Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
1bf06cd2e3
commit
6e23ae2a48
@@ -79,7 +79,7 @@ int __ip6_local_out(struct sk_buff *skb)
|
||||
len = 0;
|
||||
ipv6_hdr(skb)->payload_len = htons(len);
|
||||
|
||||
return nf_hook(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev,
|
||||
return nf_hook(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb->dst->dev,
|
||||
dst_output);
|
||||
}
|
||||
|
||||
@@ -145,8 +145,8 @@ static int ip6_output2(struct sk_buff *skb)
|
||||
is not supported in any case.
|
||||
*/
|
||||
if (newskb)
|
||||
NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, newskb, NULL,
|
||||
newskb->dev,
|
||||
NF_HOOK(PF_INET6, NF_INET_POST_ROUTING, newskb,
|
||||
NULL, newskb->dev,
|
||||
ip6_dev_loopback_xmit);
|
||||
|
||||
if (ipv6_hdr(skb)->hop_limit == 0) {
|
||||
@@ -159,7 +159,8 @@ static int ip6_output2(struct sk_buff *skb)
|
||||
IP6_INC_STATS(idev, IPSTATS_MIB_OUTMCASTPKTS);
|
||||
}
|
||||
|
||||
return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
|
||||
return NF_HOOK(PF_INET6, NF_INET_POST_ROUTING, skb, NULL, skb->dev,
|
||||
ip6_output_finish);
|
||||
}
|
||||
|
||||
static inline int ip6_skb_dst_mtu(struct sk_buff *skb)
|
||||
@@ -261,7 +262,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
|
||||
if ((skb->len <= mtu) || ipfragok || skb_is_gso(skb)) {
|
||||
IP6_INC_STATS(ip6_dst_idev(skb->dst),
|
||||
IPSTATS_MIB_OUTREQUESTS);
|
||||
return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev,
|
||||
return NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev,
|
||||
dst_output);
|
||||
}
|
||||
|
||||
@@ -525,7 +526,8 @@ int ip6_forward(struct sk_buff *skb)
|
||||
hdr->hop_limit--;
|
||||
|
||||
IP6_INC_STATS_BH(ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS);
|
||||
return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
|
||||
return NF_HOOK(PF_INET6, NF_INET_FORWARD, skb, skb->dev, dst->dev,
|
||||
ip6_forward_finish);
|
||||
|
||||
error:
|
||||
IP6_INC_STATS_BH(ip6_dst_idev(dst), IPSTATS_MIB_INADDRERRORS);
|
||||
|
||||
Reference in New Issue
Block a user