* [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
@ 2010-07-31 23:25 Changli Gao
2010-08-02 15:50 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Changli Gao @ 2010-07-31 23:25 UTC (permalink / raw)
To: Patrick McHardy; +Cc: David S. Miller, Bart De Schuymer, netdev, Changli Gao
6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350 subtracts PPPOE_SES_HLEN from mtu at
the front of ip_fragment(). So the later subtraction should be removed. The
MTU of 802.1q is also 1500, so MTU should not be changed.
Signed-off-by: Changli Gao <xiaosuo@gmail.com>
----
net/ipv4/ip_output.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index 6652bd9..04b6989 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -446,7 +446,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
int ptr;
struct net_device *dev;
struct sk_buff *skb2;
- unsigned int mtu, hlen, left, len, ll_rs, pad;
+ unsigned int mtu, hlen, left, len, ll_rs;
int offset;
__be16 not_last_frag;
struct rtable *rt = skb_rtable(skb);
@@ -585,9 +585,7 @@ slow_path:
/* for bridged IP traffic encapsulated inside f.e. a vlan header,
* we need to make room for the encapsulating header
*/
- pad = nf_bridge_pad(skb);
- ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, pad);
- mtu -= pad;
+ ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, nf_bridge_pad(skb));
/*
* Fragment the datagram.
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
2010-07-31 23:25 [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice Changli Gao
@ 2010-08-02 15:50 ` Patrick McHardy
2010-08-02 19:20 ` Bart De Schuymer
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2010-08-02 15:50 UTC (permalink / raw)
To: Changli Gao; +Cc: David S. Miller, Bart De Schuymer, netdev
On 01.08.2010 01:25, Changli Gao wrote:
> 6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350 subtracts PPPOE_SES_HLEN from mtu at
> the front of ip_fragment(). So the later subtraction should be removed. The
> MTU of 802.1q is also 1500, so MTU should not be changed.
Bart, please review, thanks.
> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
> ----
> net/ipv4/ip_output.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
> index 6652bd9..04b6989 100644
> --- a/net/ipv4/ip_output.c
> +++ b/net/ipv4/ip_output.c
> @@ -446,7 +446,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
> int ptr;
> struct net_device *dev;
> struct sk_buff *skb2;
> - unsigned int mtu, hlen, left, len, ll_rs, pad;
> + unsigned int mtu, hlen, left, len, ll_rs;
> int offset;
> __be16 not_last_frag;
> struct rtable *rt = skb_rtable(skb);
> @@ -585,9 +585,7 @@ slow_path:
> /* for bridged IP traffic encapsulated inside f.e. a vlan header,
> * we need to make room for the encapsulating header
> */
> - pad = nf_bridge_pad(skb);
> - ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, pad);
> - mtu -= pad;
> + ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, nf_bridge_pad(skb));
>
> /*
> * Fragment the datagram.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
2010-08-02 15:50 ` Patrick McHardy
@ 2010-08-02 19:20 ` Bart De Schuymer
2010-08-03 0:25 ` David Miller
0 siblings, 1 reply; 4+ messages in thread
From: Bart De Schuymer @ 2010-08-02 19:20 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Changli Gao, David S. Miller, netdev
Patrick McHardy schreef:
> On 01.08.2010 01:25, Changli Gao wrote:
>
>> 6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350 subtracts PPPOE_SES_HLEN from mtu at
>> the front of ip_fragment(). So the later subtraction should be removed. The
>> MTU of 802.1q is also 1500, so MTU should not be changed.
>>
>
> Bart, please review, thanks.
>
>
The patch looks correct. The commit Changli refers to fixed the case
where fragments are already available but broke the slow_path. The MTU
for 802.1Q is indeed also 1500...
cheers,
Bart
Signed-off-by: Bart De Schuymer <bdschuym@pandora.bo>
>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
>> ----
>> net/ipv4/ip_output.c | 6 ++----
>> 1 file changed, 2 insertions(+), 4 deletions(-)
>> diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
>> index 6652bd9..04b6989 100644
>> --- a/net/ipv4/ip_output.c
>> +++ b/net/ipv4/ip_output.c
>> @@ -446,7 +446,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
>> int ptr;
>> struct net_device *dev;
>> struct sk_buff *skb2;
>> - unsigned int mtu, hlen, left, len, ll_rs, pad;
>> + unsigned int mtu, hlen, left, len, ll_rs;
>> int offset;
>> __be16 not_last_frag;
>> struct rtable *rt = skb_rtable(skb);
>> @@ -585,9 +585,7 @@ slow_path:
>> /* for bridged IP traffic encapsulated inside f.e. a vlan header,
>> * we need to make room for the encapsulating header
>> */
>> - pad = nf_bridge_pad(skb);
>> - ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, pad);
>> - mtu -= pad;
>> + ll_rs = LL_RESERVED_SPACE_EXTRA(rt->dst.dev, nf_bridge_pad(skb));
>>
>> /*
>> * Fragment the datagram.
>>
>>
>
>
>
--
Bart De Schuymer
www.artinalgorithms.be
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
2010-08-02 19:20 ` Bart De Schuymer
@ 2010-08-03 0:25 ` David Miller
0 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2010-08-03 0:25 UTC (permalink / raw)
To: bdschuym; +Cc: kaber, xiaosuo, netdev
From: Bart De Schuymer <bdschuym@pandora.be>
Date: Mon, 02 Aug 2010 21:20:16 +0200
> Patrick McHardy schreef:
>> On 01.08.2010 01:25, Changli Gao wrote:
>>
>>> 6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350 subtracts PPPOE_SES_HLEN from
>>> mtu at
>>> the front of ip_fragment(). So the later subtraction should be
>>> removed. The
>>> MTU of 802.1q is also 1500, so MTU should not be changed.
...
> Signed-off-by: Bart De Schuymer <bdschuym@pandora.bo>
>>> Signed-off-by: Changli Gao <xiaosuo@gmail.com>
Applied, thanks everyone.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-08-03 0:25 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-31 23:25 [PATCH] ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice Changli Gao
2010-08-02 15:50 ` Patrick McHardy
2010-08-02 19:20 ` Bart De Schuymer
2010-08-03 0:25 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).