[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190225074700.7316-1-liuhangbin@gmail.com>
Date: Mon, 25 Feb 2019 15:47:00 +0800
From: Hangbin Liu <liuhangbin@...il.com>
To: netdev@...r.kernel.org
Cc: Roopa Prabhu <roopa@...ulusnetworks.com>,
"David S . Miller" <davem@...emloft.net>,
Hangbin Liu <liuhangbin@...il.com>
Subject: [PATCH net] ipv4: Add ICMPv6 support when parse route ipproto
For ip rules, we need to use 'ipproto ipv6-icmp' to match ICMPv6 headers.
But for ip -6 route, currently we only support tcp, udp and icmp.
Add ICMPv6 support so we can match ipv6-icmp rules for route lookup.
Reported-by: Jianlin Shi <jishi@...hat.com>
Fixes: eacb9384a3fe ("ipv6: support sport, dport and ip_proto in RTM_GETROUTE")
Signed-off-by: Hangbin Liu <liuhangbin@...il.com>
---
net/ipv4/netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/ipv4/netlink.c b/net/ipv4/netlink.c
index f86bb4f06609..95601237521f 100644
--- a/net/ipv4/netlink.c
+++ b/net/ipv4/netlink.c
@@ -3,6 +3,7 @@
#include <linux/types.h>
#include <net/net_namespace.h>
#include <net/netlink.h>
+#include <linux/in6.h>
#include <net/ip.h>
int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
@@ -14,6 +15,7 @@ int rtm_getroute_parse_ip_proto(struct nlattr *attr, u8 *ip_proto,
case IPPROTO_TCP:
case IPPROTO_UDP:
case IPPROTO_ICMP:
+ case IPPROTO_ICMPV6:
return 0;
default:
NL_SET_ERR_MSG(extack, "Unsupported ip proto");
--
2.19.2
Powered by blists - more mailing lists