aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2010-03-22 23:09:07 -0400
committerJan Engelhardt <jengelh@medozas.de>2010-03-25 11:00:49 -0400
commitb2e0b385d77069031edb957839aaaa8441b47287 (patch)
tree7b0cd8ed74fd0f8ab6a198cd1be735c6a972517e
parent9bbc768aa911a3ef336272eaa6d220abfba8ce50 (diff)
netfilter: ipv6: use NFPROTO values for NF_HOOK invocation
The semantic patch that was used: // <smpl> @@ @@ (NF_HOOK |NF_HOOK_THRESH |nf_hook )( -PF_INET6, +NFPROTO_IPV6, ...) // </smpl> Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--net/ipv6/ip6_input.c4
-rw-r--r--net/ipv6/ip6_output.c16
-rw-r--r--net/ipv6/ip6mr.c2
-rw-r--r--net/ipv6/mcast.c4
-rw-r--r--net/ipv6/ndisc.c4
-rw-r--r--net/ipv6/netfilter/nf_conntrack_reasm.c2
-rw-r--r--net/ipv6/raw.c4
-rw-r--r--net/ipv6/xfrm6_input.c2
-rw-r--r--net/ipv6/xfrm6_output.c4
9 files changed, 21 insertions, 21 deletions
diff --git a/net/ipv6/ip6_input.c b/net/ipv6/ip6_input.c
index e28f9203deca..2c01dc65794d 100644
--- a/net/ipv6/ip6_input.c
+++ b/net/ipv6/ip6_input.c
@@ -142,7 +142,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
142 /* Must drop socket now because of tproxy. */ 142 /* Must drop socket now because of tproxy. */
143 skb_orphan(skb); 143 skb_orphan(skb);
144 144
145 return NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, dev, NULL, 145 return NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, skb, dev, NULL,
146 ip6_rcv_finish); 146 ip6_rcv_finish);
147err: 147err:
148 IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INHDRERRORS); 148 IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_INHDRERRORS);
@@ -235,7 +235,7 @@ discard:
235 235
236int ip6_input(struct sk_buff *skb) 236int ip6_input(struct sk_buff *skb)
237{ 237{
238 return NF_HOOK(PF_INET6, NF_INET_LOCAL_IN, skb, skb->dev, NULL, 238 return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_IN, skb, skb->dev, NULL,
239 ip6_input_finish); 239 ip6_input_finish);
240} 240}
241 241
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index dabf108ad811..4535b7a0169b 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -66,8 +66,8 @@ int __ip6_local_out(struct sk_buff *skb)
66 len = 0; 66 len = 0;
67 ipv6_hdr(skb)->payload_len = htons(len); 67 ipv6_hdr(skb)->payload_len = htons(len);
68 68
69 return nf_hook(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb_dst(skb)->dev, 69 return nf_hook(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL,
70 dst_output); 70 skb_dst(skb)->dev, dst_output);
71} 71}
72 72
73int ip6_local_out(struct sk_buff *skb) 73int ip6_local_out(struct sk_buff *skb)
@@ -134,8 +134,8 @@ static int ip6_output2(struct sk_buff *skb)
134 is not supported in any case. 134 is not supported in any case.
135 */ 135 */
136 if (newskb) 136 if (newskb)
137 NF_HOOK(PF_INET6, NF_INET_POST_ROUTING, newskb, 137 NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING,
138 NULL, newskb->dev, 138 newskb, NULL, newskb->dev,
139 ip6_dev_loopback_xmit); 139 ip6_dev_loopback_xmit);
140 140
141 if (ipv6_hdr(skb)->hop_limit == 0) { 141 if (ipv6_hdr(skb)->hop_limit == 0) {
@@ -150,7 +150,7 @@ static int ip6_output2(struct sk_buff *skb)
150 skb->len); 150 skb->len);
151 } 151 }
152 152
153 return NF_HOOK(PF_INET6, NF_INET_POST_ROUTING, skb, NULL, skb->dev, 153 return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL, skb->dev,
154 ip6_output_finish); 154 ip6_output_finish);
155} 155}
156 156
@@ -260,8 +260,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
260 if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) { 260 if ((skb->len <= mtu) || skb->local_df || skb_is_gso(skb)) {
261 IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)), 261 IP6_UPD_PO_STATS(net, ip6_dst_idev(skb_dst(skb)),
262 IPSTATS_MIB_OUT, skb->len); 262 IPSTATS_MIB_OUT, skb->len);
263 return NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev, 263 return NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL,
264 dst_output); 264 dst->dev, dst_output);
265 } 265 }
266 266
267 if (net_ratelimit()) 267 if (net_ratelimit())
@@ -537,7 +537,7 @@ int ip6_forward(struct sk_buff *skb)
537 hdr->hop_limit--; 537 hdr->hop_limit--;
538 538
539 IP6_INC_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS); 539 IP6_INC_STATS_BH(net, ip6_dst_idev(dst), IPSTATS_MIB_OUTFORWDATAGRAMS);
540 return NF_HOOK(PF_INET6, NF_INET_FORWARD, skb, skb->dev, dst->dev, 540 return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD, skb, skb->dev, dst->dev,
541 ip6_forward_finish); 541 ip6_forward_finish);
542 542
543error: 543error:
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c
index 52e0f74fdfe0..430372e0bf24 100644
--- a/net/ipv6/ip6mr.c
+++ b/net/ipv6/ip6mr.c
@@ -1566,7 +1566,7 @@ static int ip6mr_forward2(struct sk_buff *skb, struct mfc6_cache *c, int vifi)
1566 1566
1567 IP6CB(skb)->flags |= IP6SKB_FORWARDED; 1567 IP6CB(skb)->flags |= IP6SKB_FORWARDED;
1568 1568
1569 return NF_HOOK(PF_INET6, NF_INET_FORWARD, skb, skb->dev, dev, 1569 return NF_HOOK(NFPROTO_IPV6, NF_INET_FORWARD, skb, skb->dev, dev,
1570 ip6mr_forward2_finish); 1570 ip6mr_forward2_finish);
1571 1571
1572out_free: 1572out_free:
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index bcd971915969..773b9d18b748 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1479,7 +1479,7 @@ static void mld_sendpack(struct sk_buff *skb)
1479 1479
1480 payload_len = skb->len; 1480 payload_len = skb->len;
1481 1481
1482 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev, 1482 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev,
1483 dst_output); 1483 dst_output);
1484out: 1484out:
1485 if (!err) { 1485 if (!err) {
@@ -1847,7 +1847,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1847 goto err_out; 1847 goto err_out;
1848 1848
1849 skb_dst_set(skb, dst); 1849 skb_dst_set(skb, dst);
1850 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev, 1850 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, skb->dev,
1851 dst_output); 1851 dst_output);
1852out: 1852out:
1853 if (!err) { 1853 if (!err) {
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 8bcc4b7db3bf..8e96a350f52f 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -535,7 +535,7 @@ void ndisc_send_skb(struct sk_buff *skb,
535 idev = in6_dev_get(dst->dev); 535 idev = in6_dev_get(dst->dev);
536 IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); 536 IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len);
537 537
538 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev, 538 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL, dst->dev,
539 dst_output); 539 dst_output);
540 if (!err) { 540 if (!err) {
541 ICMP6MSGOUT_INC_STATS(net, idev, type); 541 ICMP6MSGOUT_INC_STATS(net, idev, type);
@@ -1617,7 +1617,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1617 skb_dst_set(buff, dst); 1617 skb_dst_set(buff, dst);
1618 idev = in6_dev_get(dst->dev); 1618 idev = in6_dev_get(dst->dev);
1619 IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len); 1619 IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUT, skb->len);
1620 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, buff, NULL, dst->dev, 1620 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, buff, NULL, dst->dev,
1621 dst_output); 1621 dst_output);
1622 if (!err) { 1622 if (!err) {
1623 ICMP6MSGOUT_INC_STATS(net, idev, NDISC_REDIRECT); 1623 ICMP6MSGOUT_INC_STATS(net, idev, NDISC_REDIRECT);
diff --git a/net/ipv6/netfilter/nf_conntrack_reasm.c b/net/ipv6/netfilter/nf_conntrack_reasm.c
index f1171b744650..8f80e245f370 100644
--- a/net/ipv6/netfilter/nf_conntrack_reasm.c
+++ b/net/ipv6/netfilter/nf_conntrack_reasm.c
@@ -643,7 +643,7 @@ void nf_ct_frag6_output(unsigned int hooknum, struct sk_buff *skb,
643 s2 = s->next; 643 s2 = s->next;
644 s->next = NULL; 644 s->next = NULL;
645 645
646 NF_HOOK_THRESH(PF_INET6, hooknum, s, in, out, okfn, 646 NF_HOOK_THRESH(NFPROTO_IPV6, hooknum, s, in, out, okfn,
647 NF_IP6_PRI_CONNTRACK_DEFRAG + 1); 647 NF_IP6_PRI_CONNTRACK_DEFRAG + 1);
648 s = s2; 648 s = s2;
649 } 649 }
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index ed31c37c6e39..e9e1f774b0b7 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -636,8 +636,8 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
636 goto error_fault; 636 goto error_fault;
637 637
638 IP6_UPD_PO_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len); 638 IP6_UPD_PO_STATS(sock_net(sk), rt->rt6i_idev, IPSTATS_MIB_OUT, skb->len);
639 err = NF_HOOK(PF_INET6, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, 639 err = NF_HOOK(NFPROTO_IPV6, NF_INET_LOCAL_OUT, skb, NULL,
640 dst_output); 640 rt->u.dst.dev, dst_output);
641 if (err > 0) 641 if (err > 0)
642 err = net_xmit_errno(err); 642 err = net_xmit_errno(err);
643 if (err) 643 if (err)
diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c
index 2bc98ede1235..f8c3cf842f53 100644
--- a/net/ipv6/xfrm6_input.c
+++ b/net/ipv6/xfrm6_input.c
@@ -42,7 +42,7 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async)
42 ipv6_hdr(skb)->payload_len = htons(skb->len); 42 ipv6_hdr(skb)->payload_len = htons(skb->len);
43 __skb_push(skb, skb->data - skb_network_header(skb)); 43 __skb_push(skb, skb->data - skb_network_header(skb));
44 44
45 NF_HOOK(PF_INET6, NF_INET_PRE_ROUTING, skb, skb->dev, NULL, 45 NF_HOOK(NFPROTO_IPV6, NF_INET_PRE_ROUTING, skb, skb->dev, NULL,
46 ip6_rcv_finish); 46 ip6_rcv_finish);
47 return -1; 47 return -1;
48} 48}
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 0c92112dcba3..6434bd5ce088 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -90,6 +90,6 @@ static int xfrm6_output_finish(struct sk_buff *skb)
90 90
91int xfrm6_output(struct sk_buff *skb) 91int xfrm6_output(struct sk_buff *skb)
92{ 92{
93 return NF_HOOK(PF_INET6, NF_INET_POST_ROUTING, skb, NULL, skb_dst(skb)->dev, 93 return NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING, skb, NULL,
94 xfrm6_output_finish); 94 skb_dst(skb)->dev, xfrm6_output_finish);
95} 95}