netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] geneve: remove use of internal IP header when calling IP_ECN_decapsulate
@ 2015-09-17 17:17 John W. Linville
  2015-09-17 19:46 ` Jesse Gross
  2015-09-17 20:34 ` [PATCH v2] " John W. Linville
  0 siblings, 2 replies; 14+ messages in thread
From: John W. Linville @ 2015-09-17 17:17 UTC (permalink / raw)
  To: netdev; +Cc: davem, John W. Linville

This seems to have been a "thinko".  IP_ECN_decapsulate needs info
from both internal and external headers.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
---
 drivers/net/geneve.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/geneve.c b/drivers/net/geneve.c
index da3259ce7c8d..a917ae1cfbf3 100644
--- a/drivers/net/geneve.c
+++ b/drivers/net/geneve.c
@@ -121,10 +121,10 @@ static void geneve_rx(struct geneve_sock *gs, struct sk_buff *skb)
 	struct metadata_dst *tun_dst = NULL;
 	struct geneve_dev *geneve = NULL;
 	struct pcpu_sw_netstats *stats;
-	struct iphdr *iph;
+	struct iphdr *iph = NULL;
 	u8 *vni;
 	__be32 addr;
-	int err;
+	int err = 0;
 
 	if (gs->collect_md) {
 		static u8 zero_vni[3];
@@ -178,13 +178,15 @@ static void geneve_rx(struct geneve_sock *gs, struct sk_buff *skb)
 
 	skb_reset_network_header(skb);
 
-	iph = ip_hdr(skb); /* Now inner IP header... */
-	err = IP_ECN_decapsulate(iph, skb);
+	if (iph)
+		err = IP_ECN_decapsulate(iph, skb);
 
 	if (unlikely(err)) {
 		if (log_ecn_error)
-			net_info_ratelimited("non-ECT from %pI4 with TOS=%#x\n",
-					     &iph->saddr, iph->tos);
+			if (iph)
+				net_info_ratelimited("non-ECT from %pI4 "
+						     "with TOS=%#x\n",
+						     &iph->saddr, iph->tos);
 		if (err > 1) {
 			++geneve->dev->stats.rx_frame_errors;
 			++geneve->dev->stats.rx_errors;
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2015-09-22 23:50 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-17 17:17 [PATCH] geneve: remove use of internal IP header when calling IP_ECN_decapsulate John W. Linville
2015-09-17 19:46 ` Jesse Gross
2015-09-17 20:17   ` John W. Linville
2015-09-17 20:34 ` [PATCH v2] " John W. Linville
2015-09-18 20:30   ` Jesse Gross
2015-09-18 20:40     ` John W. Linville
2015-09-18 21:49       ` Jesse Gross
2015-09-19  1:36         ` John W. Linville
2015-09-19  2:19           ` Jesse Gross
2015-09-21  5:24   ` David Miller
2015-09-21 14:04     ` John W. Linville
2015-09-21 14:29     ` [PATCH v3] geneve: ensure ECN info is handled properly in all tx/rx paths John W. Linville
2015-09-22  1:11       ` Jesse Gross
2015-09-22 23:50       ` 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).