diff mbox series

net: fix icmp_socket_deliver argument 2 input

Message ID 1566269160-11031-1-git-send-email-lirongqing@baidu.com
State Accepted
Delegated to: David Miller
Headers show
Series net: fix icmp_socket_deliver argument 2 input | expand

Commit Message

Li RongQing Aug. 20, 2019, 2:46 a.m. UTC
it expects a unsigned int, but got a __be32

Signed-off-by: Li RongQing <lirongqing@baidu.com>
Signed-off-by: Zhang Yu <zhangyu31@baidu.com>
---
 net/ipv4/icmp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller Aug. 22, 2019, 3:43 a.m. UTC | #1
From: Li RongQing <lirongqing@baidu.com>
Date: Tue, 20 Aug 2019 10:46:00 +0800

> it expects a unsigned int, but got a __be32
> 
> Signed-off-by: Li RongQing <lirongqing@baidu.com>
> Signed-off-by: Zhang Yu <zhangyu31@baidu.com>

Applied, but this causes no functional problems because all of the
per-protocol handlers ignore the info argument for redirects.
diff mbox series

Patch

diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 1510e951f451..bf7b5d45de99 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -902,7 +902,7 @@  static bool icmp_redirect(struct sk_buff *skb)
 		return false;
 	}
 
-	icmp_socket_deliver(skb, icmp_hdr(skb)->un.gateway);
+	icmp_socket_deliver(skb, ntohl(icmp_hdr(skb)->un.gateway));
 	return true;
 }