netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv4: Add ICMPv6 support when parse route ipproto
@ 2019-02-25  7:47 Hangbin Liu
  2019-02-25 11:14 ` Sabrina Dubroca
  2019-02-27  8:15 ` [PATCH v2 " Hangbin Liu
  0 siblings, 2 replies; 9+ messages in thread
From: Hangbin Liu @ 2019-02-25  7:47 UTC (permalink / raw)
  To: netdev; +Cc: Roopa Prabhu, David S . Miller, Hangbin Liu

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@redhat.com>
Fixes: eacb9384a3fe ("ipv6: support sport, dport and ip_proto in RTM_GETROUTE")
Signed-off-by: Hangbin Liu <liuhangbin@gmail.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


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

end of thread, other threads:[~2019-03-02  0:42 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-25  7:47 [PATCH net] ipv4: Add ICMPv6 support when parse route ipproto Hangbin Liu
2019-02-25 11:14 ` Sabrina Dubroca
2019-02-25 18:46   ` David Ahern
2019-02-26  2:17     ` Hangbin Liu
2019-02-26  2:23       ` David Ahern
2019-02-26  3:48         ` Hangbin Liu
2019-02-26  9:06           ` Sabrina Dubroca
2019-02-27  8:15 ` [PATCH v2 " Hangbin Liu
2019-03-02  0:42   ` 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).