diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2010-03-22 23:07:29 -0400 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2010-03-25 11:00:30 -0400 |
commit | 9bbc768aa911a3ef336272eaa6d220abfba8ce50 (patch) | |
tree | 2c2d421e273eb78f3b1d4533b3a8b0654bcd45c0 /net | |
parent | 713aefa3fb3929ce36305d4d1b7b4059d87ed115 (diff) |
netfilter: ipv4: use NFPROTO values for NF_HOOK invocation
The semantic patch that was used:
// <smpl>
@@
@@
(NF_HOOK
|NF_HOOK_COND
|nf_hook
)(
-PF_INET,
+NFPROTO_IPV4,
...)
// </smpl>
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/ip_forward.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_input.c | 4 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 18 | ||||
-rw-r--r-- | net/ipv4/ipmr.c | 2 | ||||
-rw-r--r-- | net/ipv4/raw.c | 4 | ||||
-rw-r--r-- | net/ipv4/xfrm4_input.c | 2 | ||||
-rw-r--r-- | net/ipv4/xfrm4_output.c | 2 |
7 files changed, 18 insertions, 18 deletions
diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c index a2991bc8e32e..9f2cd47ceeb7 100644 --- a/net/ipv4/ip_forward.c +++ b/net/ipv4/ip_forward.c | |||
@@ -111,8 +111,8 @@ int ip_forward(struct sk_buff *skb) | |||
111 | 111 | ||
112 | skb->priority = rt_tos2priority(iph->tos); | 112 | skb->priority = rt_tos2priority(iph->tos); |
113 | 113 | ||
114 | return NF_HOOK(PF_INET, NF_INET_FORWARD, skb, skb->dev, rt->u.dst.dev, | 114 | return NF_HOOK(NFPROTO_IPV4, NF_INET_FORWARD, skb, skb->dev, |
115 | ip_forward_finish); | 115 | rt->u.dst.dev, ip_forward_finish); |
116 | 116 | ||
117 | sr_failed: | 117 | sr_failed: |
118 | /* | 118 | /* |
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c index c29de9879fda..091b5c7e04e1 100644 --- a/net/ipv4/ip_input.c +++ b/net/ipv4/ip_input.c | |||
@@ -265,7 +265,7 @@ int ip_local_deliver(struct sk_buff *skb) | |||
265 | return 0; | 265 | return 0; |
266 | } | 266 | } |
267 | 267 | ||
268 | return NF_HOOK(PF_INET, NF_INET_LOCAL_IN, skb, skb->dev, NULL, | 268 | return NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_IN, skb, skb->dev, NULL, |
269 | ip_local_deliver_finish); | 269 | ip_local_deliver_finish); |
270 | } | 270 | } |
271 | 271 | ||
@@ -443,7 +443,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, | |||
443 | /* Must drop socket now because of tproxy. */ | 443 | /* Must drop socket now because of tproxy. */ |
444 | skb_orphan(skb); | 444 | skb_orphan(skb); |
445 | 445 | ||
446 | return NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, dev, NULL, | 446 | return NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, skb, dev, NULL, |
447 | ip_rcv_finish); | 447 | ip_rcv_finish); |
448 | 448 | ||
449 | inhdr_error: | 449 | inhdr_error: |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 3451799e3dbf..f09135e1e14f 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -95,8 +95,8 @@ int __ip_local_out(struct sk_buff *skb) | |||
95 | 95 | ||
96 | iph->tot_len = htons(skb->len); | 96 | iph->tot_len = htons(skb->len); |
97 | ip_send_check(iph); | 97 | ip_send_check(iph); |
98 | return nf_hook(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, skb_dst(skb)->dev, | 98 | return nf_hook(NFPROTO_IPV4, NF_INET_LOCAL_OUT, skb, NULL, |
99 | dst_output); | 99 | skb_dst(skb)->dev, dst_output); |
100 | } | 100 | } |
101 | 101 | ||
102 | int ip_local_out(struct sk_buff *skb) | 102 | int ip_local_out(struct sk_buff *skb) |
@@ -271,8 +271,8 @@ int ip_mc_output(struct sk_buff *skb) | |||
271 | ) { | 271 | ) { |
272 | struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); | 272 | struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); |
273 | if (newskb) | 273 | if (newskb) |
274 | NF_HOOK(PF_INET, NF_INET_POST_ROUTING, newskb, | 274 | NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, |
275 | NULL, newskb->dev, | 275 | newskb, NULL, newskb->dev, |
276 | ip_dev_loopback_xmit); | 276 | ip_dev_loopback_xmit); |
277 | } | 277 | } |
278 | 278 | ||
@@ -287,12 +287,12 @@ int ip_mc_output(struct sk_buff *skb) | |||
287 | if (rt->rt_flags&RTCF_BROADCAST) { | 287 | if (rt->rt_flags&RTCF_BROADCAST) { |
288 | struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); | 288 | struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC); |
289 | if (newskb) | 289 | if (newskb) |
290 | NF_HOOK(PF_INET, NF_INET_POST_ROUTING, newskb, NULL, | 290 | NF_HOOK(NFPROTO_IPV4, NF_INET_POST_ROUTING, newskb, |
291 | newskb->dev, ip_dev_loopback_xmit); | 291 | NULL, newskb->dev, ip_dev_loopback_xmit); |
292 | } | 292 | } |
293 | 293 | ||
294 | return NF_HOOK_COND(PF_INET, NF_INET_POST_ROUTING, skb, NULL, skb->dev, | 294 | return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING, skb, NULL, |
295 | ip_finish_output, | 295 | skb->dev, ip_finish_output, |
296 | !(IPCB(skb)->flags & IPSKB_REROUTED)); | 296 | !(IPCB(skb)->flags & IPSKB_REROUTED)); |
297 | } | 297 | } |
298 | 298 | ||
@@ -305,7 +305,7 @@ int ip_output(struct sk_buff *skb) | |||
305 | skb->dev = dev; | 305 | skb->dev = dev; |
306 | skb->protocol = htons(ETH_P_IP); | 306 | skb->protocol = htons(ETH_P_IP); |
307 | 307 | ||
308 | return NF_HOOK_COND(PF_INET, NF_INET_POST_ROUTING, skb, NULL, dev, | 308 | return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING, skb, NULL, dev, |
309 | ip_finish_output, | 309 | ip_finish_output, |
310 | !(IPCB(skb)->flags & IPSKB_REROUTED)); | 310 | !(IPCB(skb)->flags & IPSKB_REROUTED)); |
311 | } | 311 | } |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 8582e12e4a62..1d42f6103c8d 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -1319,7 +1319,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi) | |||
1319 | * not mrouter) cannot join to more than one interface - it will | 1319 | * not mrouter) cannot join to more than one interface - it will |
1320 | * result in receiving multiple packets. | 1320 | * result in receiving multiple packets. |
1321 | */ | 1321 | */ |
1322 | NF_HOOK(PF_INET, NF_INET_FORWARD, skb, skb->dev, dev, | 1322 | NF_HOOK(NFPROTO_IPV4, NF_INET_FORWARD, skb, skb->dev, dev, |
1323 | ipmr_forward_finish); | 1323 | ipmr_forward_finish); |
1324 | return; | 1324 | return; |
1325 | 1325 | ||
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c index ce154b47f1da..34d9adb83590 100644 --- a/net/ipv4/raw.c +++ b/net/ipv4/raw.c | |||
@@ -382,8 +382,8 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length, | |||
382 | icmp_out_count(net, ((struct icmphdr *) | 382 | icmp_out_count(net, ((struct icmphdr *) |
383 | skb_transport_header(skb))->type); | 383 | skb_transport_header(skb))->type); |
384 | 384 | ||
385 | err = NF_HOOK(PF_INET, NF_INET_LOCAL_OUT, skb, NULL, rt->u.dst.dev, | 385 | err = NF_HOOK(NFPROTO_IPV4, NF_INET_LOCAL_OUT, skb, NULL, |
386 | dst_output); | 386 | rt->u.dst.dev, dst_output); |
387 | if (err > 0) | 387 | if (err > 0) |
388 | err = net_xmit_errno(err); | 388 | err = net_xmit_errno(err); |
389 | if (err) | 389 | if (err) |
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c index f9f922a0ba88..c3969e0f96c3 100644 --- a/net/ipv4/xfrm4_input.c +++ b/net/ipv4/xfrm4_input.c | |||
@@ -60,7 +60,7 @@ int xfrm4_transport_finish(struct sk_buff *skb, int async) | |||
60 | iph->tot_len = htons(skb->len); | 60 | iph->tot_len = htons(skb->len); |
61 | ip_send_check(iph); | 61 | ip_send_check(iph); |
62 | 62 | ||
63 | NF_HOOK(PF_INET, NF_INET_PRE_ROUTING, skb, skb->dev, NULL, | 63 | NF_HOOK(NFPROTO_IPV4, NF_INET_PRE_ROUTING, skb, skb->dev, NULL, |
64 | xfrm4_rcv_encap_finish); | 64 | xfrm4_rcv_encap_finish); |
65 | return 0; | 65 | return 0; |
66 | } | 66 | } |
diff --git a/net/ipv4/xfrm4_output.c b/net/ipv4/xfrm4_output.c index c908bd99bcba..571aa96a175c 100644 --- a/net/ipv4/xfrm4_output.c +++ b/net/ipv4/xfrm4_output.c | |||
@@ -86,7 +86,7 @@ static int xfrm4_output_finish(struct sk_buff *skb) | |||
86 | 86 | ||
87 | int xfrm4_output(struct sk_buff *skb) | 87 | int xfrm4_output(struct sk_buff *skb) |
88 | { | 88 | { |
89 | return NF_HOOK_COND(PF_INET, NF_INET_POST_ROUTING, skb, | 89 | return NF_HOOK_COND(NFPROTO_IPV4, NF_INET_POST_ROUTING, skb, |
90 | NULL, skb_dst(skb)->dev, xfrm4_output_finish, | 90 | NULL, skb_dst(skb)->dev, xfrm4_output_finish, |
91 | !(IPCB(skb)->flags & IPSKB_REROUTED)); | 91 | !(IPCB(skb)->flags & IPSKB_REROUTED)); |
92 | } | 92 | } |