diff options
author | Harald Welte <laforge@netfilter.org> | 2005-08-09 22:24:19 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2005-08-29 18:31:04 -0400 |
commit | 6869c4d8e066e21623c812c448a05f1ed931c9c6 (patch) | |
tree | ce18efc459e121e3a0b1bf5f85615567cdb30f68 /net | |
parent | bf3a46aa9b96f6eb3a49a568f72a2801c3e830c0 (diff) |
[NETFILTER]: reduce netfilter sk_buff enlargement
As discussed at netconf'05, we're trying to save every bit in sk_buff.
The patch below makes sk_buff 8 bytes smaller. I did some basic
testing on my notebook and it seems to work.
The only real in-tree user of nfcache was IPVS, who only needs a
single bit. Unfortunately I couldn't find some other free bit in
sk_buff to stuff that bit into, so I introduced a separate field for
them. Maybe the IPVS guys can resolve that to further save space.
Initially I wanted to shrink pkt_type to three bits (PACKET_HOST and
alike are only 6 values defined), but unfortunately the bluetooth code
overloads pkt_type :(
The conntrack-event-api (out-of-tree) uses nfcache, but Rusty just
came up with a way how to do it without any skb fields, so it's safe
to remove it.
- remove all never-implemented 'nfcache' code
- don't have ipvs code abuse 'nfcache' field. currently get's their own
compile-conditional skb->ipvs_property field. IPVS maintainers can
decide to move this bit elswhere, but nfcache needs to die.
- remove skb->nfcache field to save 4 bytes
- move skb->nfctinfo into three unused bits to save further 4 bytes
Signed-off-by: Harald Welte <laforge@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/netfilter/ebt_mark.c | 5 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/ipv4/ip_output.c | 1 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_core.c | 9 | ||||
-rw-r--r-- | net/ipv4/ipvs/ip_vs_xmit.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_conntrack_core.c | 7 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_core.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_nat_standalone.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_tables.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CLASSIFY.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_CONNMARK.c | 4 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_DSCP.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_ECN.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_MARK.c | 10 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_REJECT.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_TCPMSS.c | 1 | ||||
-rw-r--r-- | net/ipv4/netfilter/ipt_TOS.c | 1 | ||||
-rw-r--r-- | net/ipv6/ip6_output.c | 16 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_queue.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 1 | ||||
-rw-r--r-- | net/ipv6/netfilter/ip6t_MARK.c | 5 |
22 files changed, 19 insertions, 59 deletions
diff --git a/net/bridge/netfilter/ebt_mark.c b/net/bridge/netfilter/ebt_mark.c index 02c632b4d325..c93d35ab95c0 100644 --- a/net/bridge/netfilter/ebt_mark.c +++ b/net/bridge/netfilter/ebt_mark.c | |||
@@ -23,10 +23,9 @@ static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr, | |||
23 | { | 23 | { |
24 | struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data; | 24 | struct ebt_mark_t_info *info = (struct ebt_mark_t_info *)data; |
25 | 25 | ||
26 | if ((*pskb)->nfmark != info->mark) { | 26 | if ((*pskb)->nfmark != info->mark) |
27 | (*pskb)->nfmark = info->mark; | 27 | (*pskb)->nfmark = info->mark; |
28 | (*pskb)->nfcache |= NFC_ALTERED; | 28 | |
29 | } | ||
30 | return info->target; | 29 | return info->target; |
31 | } | 30 | } |
32 | 31 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 7eab867ede59..096991cb09d9 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -361,7 +361,6 @@ struct sk_buff *skb_clone(struct sk_buff *skb, unsigned int __nocast gfp_mask) | |||
361 | n->destructor = NULL; | 361 | n->destructor = NULL; |
362 | #ifdef CONFIG_NETFILTER | 362 | #ifdef CONFIG_NETFILTER |
363 | C(nfmark); | 363 | C(nfmark); |
364 | C(nfcache); | ||
365 | C(nfct); | 364 | C(nfct); |
366 | nf_conntrack_get(skb->nfct); | 365 | nf_conntrack_get(skb->nfct); |
367 | C(nfctinfo); | 366 | C(nfctinfo); |
@@ -424,7 +423,6 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old) | |||
424 | new->destructor = NULL; | 423 | new->destructor = NULL; |
425 | #ifdef CONFIG_NETFILTER | 424 | #ifdef CONFIG_NETFILTER |
426 | new->nfmark = old->nfmark; | 425 | new->nfmark = old->nfmark; |
427 | new->nfcache = old->nfcache; | ||
428 | new->nfct = old->nfct; | 426 | new->nfct = old->nfct; |
429 | nf_conntrack_get(old->nfct); | 427 | nf_conntrack_get(old->nfct); |
430 | new->nfctinfo = old->nfctinfo; | 428 | new->nfctinfo = old->nfctinfo; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 80d13103b2b0..766564cb4207 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -392,7 +392,6 @@ static void ip_copy_metadata(struct sk_buff *to, struct sk_buff *from) | |||
392 | #endif | 392 | #endif |
393 | #ifdef CONFIG_NETFILTER | 393 | #ifdef CONFIG_NETFILTER |
394 | to->nfmark = from->nfmark; | 394 | to->nfmark = from->nfmark; |
395 | to->nfcache = from->nfcache; | ||
396 | /* Connection association is same as pre-frag packet */ | 395 | /* Connection association is same as pre-frag packet */ |
397 | nf_conntrack_put(to->nfct); | 396 | nf_conntrack_put(to->nfct); |
398 | to->nfct = from->nfct; | 397 | to->nfct = from->nfct; |
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c index 5fb257dd07cb..3ac7eeca04ac 100644 --- a/net/ipv4/ipvs/ip_vs_core.c +++ b/net/ipv4/ipvs/ip_vs_core.c | |||
@@ -22,6 +22,7 @@ | |||
22 | * | 22 | * |
23 | * Changes: | 23 | * Changes: |
24 | * Paul `Rusty' Russell properly handle non-linear skbs | 24 | * Paul `Rusty' Russell properly handle non-linear skbs |
25 | * Harald Welte don't use nfcache | ||
25 | * | 26 | * |
26 | */ | 27 | */ |
27 | 28 | ||
@@ -529,7 +530,7 @@ static unsigned int ip_vs_post_routing(unsigned int hooknum, | |||
529 | const struct net_device *out, | 530 | const struct net_device *out, |
530 | int (*okfn)(struct sk_buff *)) | 531 | int (*okfn)(struct sk_buff *)) |
531 | { | 532 | { |
532 | if (!((*pskb)->nfcache & NFC_IPVS_PROPERTY)) | 533 | if (!((*pskb)->ipvs_property)) |
533 | return NF_ACCEPT; | 534 | return NF_ACCEPT; |
534 | 535 | ||
535 | /* The packet was sent from IPVS, exit this chain */ | 536 | /* The packet was sent from IPVS, exit this chain */ |
@@ -701,7 +702,7 @@ static int ip_vs_out_icmp(struct sk_buff **pskb, int *related) | |||
701 | /* do the statistics and put it back */ | 702 | /* do the statistics and put it back */ |
702 | ip_vs_out_stats(cp, skb); | 703 | ip_vs_out_stats(cp, skb); |
703 | 704 | ||
704 | skb->nfcache |= NFC_IPVS_PROPERTY; | 705 | skb->ipvs_property = 1; |
705 | verdict = NF_ACCEPT; | 706 | verdict = NF_ACCEPT; |
706 | 707 | ||
707 | out: | 708 | out: |
@@ -739,7 +740,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb, | |||
739 | 740 | ||
740 | EnterFunction(11); | 741 | EnterFunction(11); |
741 | 742 | ||
742 | if (skb->nfcache & NFC_IPVS_PROPERTY) | 743 | if (skb->ipvs_property) |
743 | return NF_ACCEPT; | 744 | return NF_ACCEPT; |
744 | 745 | ||
745 | iph = skb->nh.iph; | 746 | iph = skb->nh.iph; |
@@ -821,7 +822,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb, | |||
821 | ip_vs_set_state(cp, IP_VS_DIR_OUTPUT, skb, pp); | 822 | ip_vs_set_state(cp, IP_VS_DIR_OUTPUT, skb, pp); |
822 | ip_vs_conn_put(cp); | 823 | ip_vs_conn_put(cp); |
823 | 824 | ||
824 | skb->nfcache |= NFC_IPVS_PROPERTY; | 825 | skb->ipvs_property = 1; |
825 | 826 | ||
826 | LeaveFunction(11); | 827 | LeaveFunction(11); |
827 | return NF_ACCEPT; | 828 | return NF_ACCEPT; |
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index a8512a3fd08a..3b87482049cf 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c | |||
@@ -127,7 +127,7 @@ ip_vs_dst_reset(struct ip_vs_dest *dest) | |||
127 | 127 | ||
128 | #define IP_VS_XMIT(skb, rt) \ | 128 | #define IP_VS_XMIT(skb, rt) \ |
129 | do { \ | 129 | do { \ |
130 | (skb)->nfcache |= NFC_IPVS_PROPERTY; \ | 130 | (skb)->ipvs_property = 1; \ |
131 | (skb)->ip_summed = CHECKSUM_NONE; \ | 131 | (skb)->ip_summed = CHECKSUM_NONE; \ |
132 | NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL, \ | 132 | NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL, \ |
133 | (rt)->u.dst.dev, dst_output); \ | 133 | (rt)->u.dst.dev, dst_output); \ |
diff --git a/net/ipv4/netfilter/ip_conntrack_core.c b/net/ipv4/netfilter/ip_conntrack_core.c index a7f0c821a9b2..04c3414361d4 100644 --- a/net/ipv4/netfilter/ip_conntrack_core.c +++ b/net/ipv4/netfilter/ip_conntrack_core.c | |||
@@ -625,9 +625,6 @@ unsigned int ip_conntrack_in(unsigned int hooknum, | |||
625 | return NF_DROP; | 625 | return NF_DROP; |
626 | } | 626 | } |
627 | 627 | ||
628 | /* FIXME: Do this right please. --RR */ | ||
629 | (*pskb)->nfcache |= NFC_UNKNOWN; | ||
630 | |||
631 | /* Doesn't cover locally-generated broadcast, so not worth it. */ | 628 | /* Doesn't cover locally-generated broadcast, so not worth it. */ |
632 | #if 0 | 629 | #if 0 |
633 | /* Ignore broadcast: no `connection'. */ | 630 | /* Ignore broadcast: no `connection'. */ |
@@ -943,10 +940,8 @@ ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user) | |||
943 | skb = ip_defrag(skb, user); | 940 | skb = ip_defrag(skb, user); |
944 | local_bh_enable(); | 941 | local_bh_enable(); |
945 | 942 | ||
946 | if (skb) { | 943 | if (skb) |
947 | ip_send_check(skb->nh.iph); | 944 | ip_send_check(skb->nh.iph); |
948 | skb->nfcache |= NFC_ALTERED; | ||
949 | } | ||
950 | return skb; | 945 | return skb; |
951 | } | 946 | } |
952 | 947 | ||
diff --git a/net/ipv4/netfilter/ip_nat_core.c b/net/ipv4/netfilter/ip_nat_core.c index 739b6dde1c82..ed4d731880f7 100644 --- a/net/ipv4/netfilter/ip_nat_core.c +++ b/net/ipv4/netfilter/ip_nat_core.c | |||
@@ -321,7 +321,6 @@ manip_pkt(u_int16_t proto, | |||
321 | { | 321 | { |
322 | struct iphdr *iph; | 322 | struct iphdr *iph; |
323 | 323 | ||
324 | (*pskb)->nfcache |= NFC_ALTERED; | ||
325 | if (!skb_ip_make_writable(pskb, iphdroff + sizeof(*iph))) | 324 | if (!skb_ip_make_writable(pskb, iphdroff + sizeof(*iph))) |
326 | return 0; | 325 | return 0; |
327 | 326 | ||
diff --git a/net/ipv4/netfilter/ip_nat_standalone.c b/net/ipv4/netfilter/ip_nat_standalone.c index 91d5ea1dbbc9..9ecba979033a 100644 --- a/net/ipv4/netfilter/ip_nat_standalone.c +++ b/net/ipv4/netfilter/ip_nat_standalone.c | |||
@@ -73,8 +73,6 @@ ip_nat_fn(unsigned int hooknum, | |||
73 | IP_NF_ASSERT(!((*pskb)->nh.iph->frag_off | 73 | IP_NF_ASSERT(!((*pskb)->nh.iph->frag_off |
74 | & htons(IP_MF|IP_OFFSET))); | 74 | & htons(IP_MF|IP_OFFSET))); |
75 | 75 | ||
76 | (*pskb)->nfcache |= NFC_UNKNOWN; | ||
77 | |||
78 | /* If we had a hardware checksum before, it's now invalid */ | 76 | /* If we had a hardware checksum before, it's now invalid */ |
79 | if ((*pskb)->ip_summed == CHECKSUM_HW) | 77 | if ((*pskb)->ip_summed == CHECKSUM_HW) |
80 | if (skb_checksum_help(*pskb, (out == NULL))) | 78 | if (skb_checksum_help(*pskb, (out == NULL))) |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index c6baa8174389..bc0af8d8e910 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -392,7 +392,6 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct ipq_queue_entry *e) | |||
392 | return -ENOMEM; | 392 | return -ENOMEM; |
393 | memcpy(e->skb->data, v->payload, v->data_len); | 393 | memcpy(e->skb->data, v->payload, v->data_len); |
394 | e->skb->ip_summed = CHECKSUM_NONE; | 394 | e->skb->ip_summed = CHECKSUM_NONE; |
395 | e->skb->nfcache |= NFC_ALTERED; | ||
396 | 395 | ||
397 | /* | 396 | /* |
398 | * Extra routing may needed on local out, as the QUEUE target never | 397 | * Extra routing may needed on local out, as the QUEUE target never |
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c index c88dfcd38c56..ff8d85d2070d 100644 --- a/net/ipv4/netfilter/ip_tables.c +++ b/net/ipv4/netfilter/ip_tables.c | |||
@@ -312,7 +312,6 @@ ipt_do_table(struct sk_buff **pskb, | |||
312 | do { | 312 | do { |
313 | IP_NF_ASSERT(e); | 313 | IP_NF_ASSERT(e); |
314 | IP_NF_ASSERT(back); | 314 | IP_NF_ASSERT(back); |
315 | (*pskb)->nfcache |= e->nfcache; | ||
316 | if (ip_packet_match(ip, indev, outdev, &e->ip, offset)) { | 315 | if (ip_packet_match(ip, indev, outdev, &e->ip, offset)) { |
317 | struct ipt_entry_target *t; | 316 | struct ipt_entry_target *t; |
318 | 317 | ||
diff --git a/net/ipv4/netfilter/ipt_CLASSIFY.c b/net/ipv4/netfilter/ipt_CLASSIFY.c index 9842e6e23184..dab78d8bd494 100644 --- a/net/ipv4/netfilter/ipt_CLASSIFY.c +++ b/net/ipv4/netfilter/ipt_CLASSIFY.c | |||
@@ -32,10 +32,8 @@ target(struct sk_buff **pskb, | |||
32 | { | 32 | { |
33 | const struct ipt_classify_target_info *clinfo = targinfo; | 33 | const struct ipt_classify_target_info *clinfo = targinfo; |
34 | 34 | ||
35 | if((*pskb)->priority != clinfo->priority) { | 35 | if((*pskb)->priority != clinfo->priority) |
36 | (*pskb)->priority = clinfo->priority; | 36 | (*pskb)->priority = clinfo->priority; |
37 | (*pskb)->nfcache |= NFC_ALTERED; | ||
38 | } | ||
39 | 37 | ||
40 | return IPT_CONTINUE; | 38 | return IPT_CONTINUE; |
41 | } | 39 | } |
diff --git a/net/ipv4/netfilter/ipt_CONNMARK.c b/net/ipv4/netfilter/ipt_CONNMARK.c index 8ed744157b1a..134638021339 100644 --- a/net/ipv4/netfilter/ipt_CONNMARK.c +++ b/net/ipv4/netfilter/ipt_CONNMARK.c | |||
@@ -61,10 +61,8 @@ target(struct sk_buff **pskb, | |||
61 | case IPT_CONNMARK_RESTORE: | 61 | case IPT_CONNMARK_RESTORE: |
62 | nfmark = (*pskb)->nfmark; | 62 | nfmark = (*pskb)->nfmark; |
63 | diff = (ct->mark ^ nfmark) & markinfo->mask; | 63 | diff = (ct->mark ^ nfmark) & markinfo->mask; |
64 | if (diff != 0) { | 64 | if (diff != 0) |
65 | (*pskb)->nfmark = nfmark ^ diff; | 65 | (*pskb)->nfmark = nfmark ^ diff; |
66 | (*pskb)->nfcache |= NFC_ALTERED; | ||
67 | } | ||
68 | break; | 66 | break; |
69 | } | 67 | } |
70 | } | 68 | } |
diff --git a/net/ipv4/netfilter/ipt_DSCP.c b/net/ipv4/netfilter/ipt_DSCP.c index 3ea4509099f9..975476fef27a 100644 --- a/net/ipv4/netfilter/ipt_DSCP.c +++ b/net/ipv4/netfilter/ipt_DSCP.c | |||
@@ -51,7 +51,6 @@ target(struct sk_buff **pskb, | |||
51 | sizeof(diffs), | 51 | sizeof(diffs), |
52 | (*pskb)->nh.iph->check | 52 | (*pskb)->nh.iph->check |
53 | ^ 0xFFFF)); | 53 | ^ 0xFFFF)); |
54 | (*pskb)->nfcache |= NFC_ALTERED; | ||
55 | } | 54 | } |
56 | return IPT_CONTINUE; | 55 | return IPT_CONTINUE; |
57 | } | 56 | } |
diff --git a/net/ipv4/netfilter/ipt_ECN.c b/net/ipv4/netfilter/ipt_ECN.c index 94a0ce1c1c9d..f63a9bc0e4d2 100644 --- a/net/ipv4/netfilter/ipt_ECN.c +++ b/net/ipv4/netfilter/ipt_ECN.c | |||
@@ -43,7 +43,6 @@ set_ect_ip(struct sk_buff **pskb, const struct ipt_ECN_info *einfo) | |||
43 | sizeof(diffs), | 43 | sizeof(diffs), |
44 | (*pskb)->nh.iph->check | 44 | (*pskb)->nh.iph->check |
45 | ^0xFFFF)); | 45 | ^0xFFFF)); |
46 | (*pskb)->nfcache |= NFC_ALTERED; | ||
47 | } | 46 | } |
48 | return 1; | 47 | return 1; |
49 | } | 48 | } |
@@ -87,7 +86,6 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) | |||
87 | tcph->check = csum_fold(csum_partial((char *)diffs, | 86 | tcph->check = csum_fold(csum_partial((char *)diffs, |
88 | sizeof(diffs), | 87 | sizeof(diffs), |
89 | tcph->check^0xFFFF)); | 88 | tcph->check^0xFFFF)); |
90 | (*pskb)->nfcache |= NFC_ALTERED; | ||
91 | return 1; | 89 | return 1; |
92 | } | 90 | } |
93 | 91 | ||
diff --git a/net/ipv4/netfilter/ipt_MARK.c b/net/ipv4/netfilter/ipt_MARK.c index 8526398346cf..52b4f2c296bf 100644 --- a/net/ipv4/netfilter/ipt_MARK.c +++ b/net/ipv4/netfilter/ipt_MARK.c | |||
@@ -29,10 +29,9 @@ target_v0(struct sk_buff **pskb, | |||
29 | { | 29 | { |
30 | const struct ipt_mark_target_info *markinfo = targinfo; | 30 | const struct ipt_mark_target_info *markinfo = targinfo; |
31 | 31 | ||
32 | if((*pskb)->nfmark != markinfo->mark) { | 32 | if((*pskb)->nfmark != markinfo->mark) |
33 | (*pskb)->nfmark = markinfo->mark; | 33 | (*pskb)->nfmark = markinfo->mark; |
34 | (*pskb)->nfcache |= NFC_ALTERED; | 34 | |
35 | } | ||
36 | return IPT_CONTINUE; | 35 | return IPT_CONTINUE; |
37 | } | 36 | } |
38 | 37 | ||
@@ -61,10 +60,9 @@ target_v1(struct sk_buff **pskb, | |||
61 | break; | 60 | break; |
62 | } | 61 | } |
63 | 62 | ||
64 | if((*pskb)->nfmark != mark) { | 63 | if((*pskb)->nfmark != mark) |
65 | (*pskb)->nfmark = mark; | 64 | (*pskb)->nfmark = mark; |
66 | (*pskb)->nfcache |= NFC_ALTERED; | 65 | |
67 | } | ||
68 | return IPT_CONTINUE; | 66 | return IPT_CONTINUE; |
69 | } | 67 | } |
70 | 68 | ||
diff --git a/net/ipv4/netfilter/ipt_REJECT.c b/net/ipv4/netfilter/ipt_REJECT.c index 915696446020..f115a84a4ac6 100644 --- a/net/ipv4/netfilter/ipt_REJECT.c +++ b/net/ipv4/netfilter/ipt_REJECT.c | |||
@@ -156,7 +156,6 @@ static void send_reset(struct sk_buff *oldskb, int hook) | |||
156 | 156 | ||
157 | /* This packet will not be the same as the other: clear nf fields */ | 157 | /* This packet will not be the same as the other: clear nf fields */ |
158 | nf_reset(nskb); | 158 | nf_reset(nskb); |
159 | nskb->nfcache = 0; | ||
160 | nskb->nfmark = 0; | 159 | nskb->nfmark = 0; |
161 | #ifdef CONFIG_BRIDGE_NETFILTER | 160 | #ifdef CONFIG_BRIDGE_NETFILTER |
162 | nf_bridge_put(nskb->nf_bridge); | 161 | nf_bridge_put(nskb->nf_bridge); |
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c index 7b84a254440e..949288319ca8 100644 --- a/net/ipv4/netfilter/ipt_TCPMSS.c +++ b/net/ipv4/netfilter/ipt_TCPMSS.c | |||
@@ -190,7 +190,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
190 | newmss); | 190 | newmss); |
191 | 191 | ||
192 | retmodified: | 192 | retmodified: |
193 | (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; | ||
194 | return IPT_CONTINUE; | 193 | return IPT_CONTINUE; |
195 | } | 194 | } |
196 | 195 | ||
diff --git a/net/ipv4/netfilter/ipt_TOS.c b/net/ipv4/netfilter/ipt_TOS.c index 85c70d240f8b..49abb7eef0a4 100644 --- a/net/ipv4/netfilter/ipt_TOS.c +++ b/net/ipv4/netfilter/ipt_TOS.c | |||
@@ -46,7 +46,6 @@ target(struct sk_buff **pskb, | |||
46 | sizeof(diffs), | 46 | sizeof(diffs), |
47 | (*pskb)->nh.iph->check | 47 | (*pskb)->nh.iph->check |
48 | ^0xFFFF)); | 48 | ^0xFFFF)); |
49 | (*pskb)->nfcache |= NFC_ALTERED; | ||
50 | } | 49 | } |
51 | return IPT_CONTINUE; | 50 | return IPT_CONTINUE; |
52 | } | 51 | } |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index ae652ca14bc9..590d2b797197 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -185,19 +185,6 @@ int ip6_route_me_harder(struct sk_buff *skb) | |||
185 | } | 185 | } |
186 | #endif | 186 | #endif |
187 | 187 | ||
188 | static inline int ip6_maybe_reroute(struct sk_buff *skb) | ||
189 | { | ||
190 | #ifdef CONFIG_NETFILTER | ||
191 | if (skb->nfcache & NFC_ALTERED){ | ||
192 | if (ip6_route_me_harder(skb) != 0){ | ||
193 | kfree_skb(skb); | ||
194 | return -EINVAL; | ||
195 | } | ||
196 | } | ||
197 | #endif /* CONFIG_NETFILTER */ | ||
198 | return dst_output(skb); | ||
199 | } | ||
200 | |||
201 | /* | 188 | /* |
202 | * xmit an sk_buff (used by TCP) | 189 | * xmit an sk_buff (used by TCP) |
203 | */ | 190 | */ |
@@ -266,7 +253,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl, | |||
266 | mtu = dst_mtu(dst); | 253 | mtu = dst_mtu(dst); |
267 | if ((skb->len <= mtu) || ipfragok) { | 254 | if ((skb->len <= mtu) || ipfragok) { |
268 | IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); | 255 | IP6_INC_STATS(IPSTATS_MIB_OUTREQUESTS); |
269 | return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute); | 256 | return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, |
257 | dst_output); | ||
270 | } | 258 | } |
271 | 259 | ||
272 | if (net_ratelimit()) | 260 | if (net_ratelimit()) |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index a16df5b27c84..83ccedceed17 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -388,7 +388,6 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct ipq_queue_entry *e) | |||
388 | return -ENOMEM; | 388 | return -ENOMEM; |
389 | memcpy(e->skb->data, v->payload, v->data_len); | 389 | memcpy(e->skb->data, v->payload, v->data_len); |
390 | e->skb->ip_summed = CHECKSUM_NONE; | 390 | e->skb->ip_summed = CHECKSUM_NONE; |
391 | e->skb->nfcache |= NFC_ALTERED; | ||
392 | 391 | ||
393 | /* | 392 | /* |
394 | * Extra routing may needed on local out, as the QUEUE target never | 393 | * Extra routing may needed on local out, as the QUEUE target never |
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 73034511c8db..41a67cf6e33a 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
@@ -401,7 +401,6 @@ ip6t_do_table(struct sk_buff **pskb, | |||
401 | do { | 401 | do { |
402 | IP_NF_ASSERT(e); | 402 | IP_NF_ASSERT(e); |
403 | IP_NF_ASSERT(back); | 403 | IP_NF_ASSERT(back); |
404 | (*pskb)->nfcache |= e->nfcache; | ||
405 | if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6, | 404 | if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6, |
406 | &protoff, &offset)) { | 405 | &protoff, &offset)) { |
407 | struct ip6t_entry_target *t; | 406 | struct ip6t_entry_target *t; |
diff --git a/net/ipv6/netfilter/ip6t_MARK.c b/net/ipv6/netfilter/ip6t_MARK.c index d09ceb05013a..81924fcc5857 100644 --- a/net/ipv6/netfilter/ip6t_MARK.c +++ b/net/ipv6/netfilter/ip6t_MARK.c | |||
@@ -28,10 +28,9 @@ target(struct sk_buff **pskb, | |||
28 | { | 28 | { |
29 | const struct ip6t_mark_target_info *markinfo = targinfo; | 29 | const struct ip6t_mark_target_info *markinfo = targinfo; |
30 | 30 | ||
31 | if((*pskb)->nfmark != markinfo->mark) { | 31 | if((*pskb)->nfmark != markinfo->mark) |
32 | (*pskb)->nfmark = markinfo->mark; | 32 | (*pskb)->nfmark = markinfo->mark; |
33 | (*pskb)->nfcache |= NFC_ALTERED; | 33 | |
34 | } | ||
35 | return IP6T_CONTINUE; | 34 | return IP6T_CONTINUE; |
36 | } | 35 | } |
37 | 36 | ||