diff options
author | Patrick McHardy <kaber@trash.net> | 2006-09-20 14:59:06 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-09-22 18:19:49 -0400 |
commit | ecb70c95c45ece0935b076295388267f6d8db65c (patch) | |
tree | 51677f5b2db693951eb06587ab20732739d01532 /net | |
parent | 2be344c4461d29b99113f62fa91c5ceab9997329 (diff) |
[NETFILTER]: ipt_TCPMSS: misc cleanup
- remove debugging cruft
- remove printk for reallocation failures
- remove unused addition
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/netfilter/ipt_TCPMSS.c | 36 |
1 files changed, 2 insertions, 34 deletions
diff --git a/net/ipv4/netfilter/ipt_TCPMSS.c b/net/ipv4/netfilter/ipt_TCPMSS.c index b2d3c4f992d1..4246c4321e5b 100644 --- a/net/ipv4/netfilter/ipt_TCPMSS.c +++ b/net/ipv4/netfilter/ipt_TCPMSS.c | |||
@@ -21,12 +21,6 @@ MODULE_LICENSE("GPL"); | |||
21 | MODULE_AUTHOR("Marc Boucher <marc@mbsi.ca>"); | 21 | MODULE_AUTHOR("Marc Boucher <marc@mbsi.ca>"); |
22 | MODULE_DESCRIPTION("iptables TCP MSS modification module"); | 22 | MODULE_DESCRIPTION("iptables TCP MSS modification module"); |
23 | 23 | ||
24 | #if 0 | ||
25 | #define DEBUGP printk | ||
26 | #else | ||
27 | #define DEBUGP(format, args...) | ||
28 | #endif | ||
29 | |||
30 | static inline unsigned int | 24 | static inline unsigned int |
31 | optlen(const u_int8_t *opt, unsigned int offset) | 25 | optlen(const u_int8_t *opt, unsigned int offset) |
32 | { | 26 | { |
@@ -106,16 +100,7 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
106 | htons(oldmss)^0xFFFF, | 100 | htons(oldmss)^0xFFFF, |
107 | htons(newmss), | 101 | htons(newmss), |
108 | tcph->check, 0); | 102 | tcph->check, 0); |
109 | 103 | return IPT_CONTINUE; | |
110 | DEBUGP(KERN_INFO "ipt_tcpmss_target: %u.%u.%u.%u:%hu" | ||
111 | "->%u.%u.%u.%u:%hu changed TCP MSS option" | ||
112 | " (from %u to %u)\n", | ||
113 | NIPQUAD((*pskb)->nh.iph->saddr), | ||
114 | ntohs(tcph->source), | ||
115 | NIPQUAD((*pskb)->nh.iph->daddr), | ||
116 | ntohs(tcph->dest), | ||
117 | oldmss, newmss); | ||
118 | goto retmodified; | ||
119 | } | 104 | } |
120 | } | 105 | } |
121 | 106 | ||
@@ -127,13 +112,8 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
127 | 112 | ||
128 | newskb = skb_copy_expand(*pskb, skb_headroom(*pskb), | 113 | newskb = skb_copy_expand(*pskb, skb_headroom(*pskb), |
129 | TCPOLEN_MSS, GFP_ATOMIC); | 114 | TCPOLEN_MSS, GFP_ATOMIC); |
130 | if (!newskb) { | 115 | if (!newskb) |
131 | if (net_ratelimit()) | ||
132 | printk(KERN_ERR "ipt_tcpmss_target:" | ||
133 | " unable to allocate larger skb\n"); | ||
134 | return NF_DROP; | 116 | return NF_DROP; |
135 | } | ||
136 | |||
137 | kfree_skb(*pskb); | 117 | kfree_skb(*pskb); |
138 | *pskb = newskb; | 118 | *pskb = newskb; |
139 | iph = (*pskb)->nh.iph; | 119 | iph = (*pskb)->nh.iph; |
@@ -149,8 +129,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
149 | htons(tcplen) ^ 0xFFFF, | 129 | htons(tcplen) ^ 0xFFFF, |
150 | htons(tcplen + TCPOLEN_MSS), | 130 | htons(tcplen + TCPOLEN_MSS), |
151 | tcph->check, 1); | 131 | tcph->check, 1); |
152 | tcplen += TCPOLEN_MSS; | ||
153 | |||
154 | opt[0] = TCPOPT_MSS; | 132 | opt[0] = TCPOPT_MSS; |
155 | opt[1] = TCPOLEN_MSS; | 133 | opt[1] = TCPOLEN_MSS; |
156 | opt[2] = (newmss & 0xff00) >> 8; | 134 | opt[2] = (newmss & 0xff00) >> 8; |
@@ -170,16 +148,6 @@ ipt_tcpmss_target(struct sk_buff **pskb, | |||
170 | iph->check = nf_csum_update(iph->tot_len ^ 0xFFFF, | 148 | iph->check = nf_csum_update(iph->tot_len ^ 0xFFFF, |
171 | newtotlen, iph->check); | 149 | newtotlen, iph->check); |
172 | iph->tot_len = newtotlen; | 150 | iph->tot_len = newtotlen; |
173 | |||
174 | DEBUGP(KERN_INFO "ipt_tcpmss_target: %u.%u.%u.%u:%hu" | ||
175 | "->%u.%u.%u.%u:%hu added TCP MSS option (%u)\n", | ||
176 | NIPQUAD((*pskb)->nh.iph->saddr), | ||
177 | ntohs(tcph->source), | ||
178 | NIPQUAD((*pskb)->nh.iph->daddr), | ||
179 | ntohs(tcph->dest), | ||
180 | newmss); | ||
181 | |||
182 | retmodified: | ||
183 | return IPT_CONTINUE; | 151 | return IPT_CONTINUE; |
184 | } | 152 | } |
185 | 153 | ||