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

Reply via email to