* [PATCH net] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id.
@ 2013-08-13 8:41 Pravin B Shelar
2013-08-13 23:53 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Pravin B Shelar @ 2013-08-13 8:41 UTC (permalink / raw)
To: netdev; +Cc: Pravin B Shelar, Jarno Rajahalme, Ansis Atteka
Using inner-id for tunnel id is not safe in some rare cases.
E.g. packets coming from multiple sources entering same tunnel
can have same id. Therefore on tunnel packet receive we
could have packets from two different stream but with same
source and dst IP with same ip-id which could confuse ip packet
reassembly.
Following patch reverts optimization from commit
490ab08127 (IP_GRE: Fix IP-Identification.)
CC: Jarno Rajahalme <jrajahalme@nicira.com>
CC: Ansis Atteka <aatteka@nicira.com>
Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
---
include/net/ip_tunnels.h | 14 --------------
net/ipv4/ip_tunnel_core.c | 4 +---
2 files changed, 1 insertions(+), 17 deletions(-)
diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
index 781b3cf..a354db5 100644
--- a/include/net/ip_tunnels.h
+++ b/include/net/ip_tunnels.h
@@ -145,20 +145,6 @@ static inline u8 ip_tunnel_ecn_encap(u8 tos, const struct iphdr *iph,
return INET_ECN_encapsulate(tos, inner);
}
-static inline void tunnel_ip_select_ident(struct sk_buff *skb,
- const struct iphdr *old_iph,
- struct dst_entry *dst)
-{
- struct iphdr *iph = ip_hdr(skb);
-
- /* Use inner packet iph-id if possible. */
- if (skb->protocol == htons(ETH_P_IP) && old_iph->id)
- iph->id = old_iph->id;
- else
- __ip_select_ident(iph, dst,
- (skb_shinfo(skb)->gso_segs ?: 1) - 1);
-}
-
int iptunnel_pull_header(struct sk_buff *skb, int hdr_len, __be16 inner_proto);
int iptunnel_xmit(struct net *net, struct rtable *rt,
struct sk_buff *skb,
diff --git a/net/ipv4/ip_tunnel_core.c b/net/ipv4/ip_tunnel_core.c
index 7167b08..850525b 100644
--- a/net/ipv4/ip_tunnel_core.c
+++ b/net/ipv4/ip_tunnel_core.c
@@ -76,9 +76,7 @@ int iptunnel_xmit(struct net *net, struct rtable *rt,
iph->daddr = dst;
iph->saddr = src;
iph->ttl = ttl;
- tunnel_ip_select_ident(skb,
- (const struct iphdr *)skb_inner_network_header(skb),
- &rt->dst);
+ __ip_select_ident(iph, &rt->dst, (skb_shinfo(skb)->gso_segs ?: 1) - 1);
err = ip_local_out(skb);
if (unlikely(net_xmit_eval(err)))
--
1.7.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH net] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id.
2013-08-13 8:41 [PATCH net] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id Pravin B Shelar
@ 2013-08-13 23:53 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2013-08-13 23:53 UTC (permalink / raw)
To: pshelar; +Cc: netdev, jrajahalme, aatteka
From: Pravin B Shelar <pshelar@nicira.com>
Date: Tue, 13 Aug 2013 01:41:06 -0700
> Using inner-id for tunnel id is not safe in some rare cases.
> E.g. packets coming from multiple sources entering same tunnel
> can have same id. Therefore on tunnel packet receive we
> could have packets from two different stream but with same
> source and dst IP with same ip-id which could confuse ip packet
> reassembly.
>
> Following patch reverts optimization from commit
> 490ab08127 (IP_GRE: Fix IP-Identification.)
>
> CC: Jarno Rajahalme <jrajahalme@nicira.com>
> CC: Ansis Atteka <aatteka@nicira.com>
> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-08-13 23:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-13 8:41 [PATCH net] ip_tunnel: Do not use inner ip-header-id for tunnel ip-header-id Pravin B Shelar
2013-08-13 23:53 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox