ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
Subsystems (3)
PATCH 1/1 ip_fragment: fix subtracting PPPOE_SES_HLEN from mtu twice
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.
----
net/ipv4/ip_output.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
net/ipv4/ip_output.c +2 -4
@@ -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.
Quoted 3 lines · Changli Gao
6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350subtractsPPPOE_SES_HLENfrom mtu at the front ofip_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.
Quoted 29 lines
Signed-off-by Changli Gao <[email protected]>----
net/ipv4/ip_output.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)net/ipv4/ip_output.c +2
-4@@ -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.
Patrick McHardy schreef:
Quoted 10 lines · Changli Gao
Quoted 5 lines
6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350subtractsPPPOE_SES_HLENfrom mtu at the front ofip_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
Quoted 33 lines
Quoted 30 lines
Signed-off-by Changli Gao <[email protected]>----
net/ipv4/ip_output.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)net/ipv4/ip_output.c +2
-4@@ -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.
Signature · 2 lines
Bart De Schuymer www.artinalgorithms.be
From: Bart De Schuymer <[email protected]>
Date: Mon, 02 Aug 2010 21:20:16 +0200
Quoted 8 lines
Patrick McHardy schreef:
Quoted 7 lines · Changli Gao
Quoted 6 lines
6c79bf0f2440fd250c8fce8d9b82fcf03d4e8350subtractsPPPOE_SES_HLENfrom mtu at
the front ofip_fragment(). So the later subtraction should be removed. The
MTU of 802.1q is also 1500, so MTU should not be changed.
...
Quoted 2 lines
Signed-off-by Bart De Schuymer <[email protected]>Quoted 1 line
Quoted 1 line
Signed-off-by Changli Gao <[email protected]>
Applied, thanks everyone.