On Fri, Apr 5, 2019 at 4:32 PM David Ahern <dsah...@kernel.org> wrote: > > From: David Ahern <dsah...@gmail.com> > > fib_check_nh is currently huge covering multiple uses cases - device only, > device + gateway, and device + gateway with ONLINK. The next patch adds > validation checks for IPv6 which only further complicates it. So, break > fib_check_nh into 2 helpers - one for gateway validation and one for device > only. > > Signed-off-by: David Ahern <dsah...@gmail.com> > Reviewed-by: Ido Schimmel <ido...@mellanox.com>
With the latest net-next I am having issue with network traffic. git bisect points to this commit as the first bad commit. (448d7248191706cbbd7761e3bc72c2985c4d38a7 ipv4: Refactor fib_check_nh) I do not understand this part of kernel, from what I see, this patch rejects the default route added by NetworkManager. [gvaradar@240m5avmarch ~]$ sudo ip route add 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101 Error: Nexthop has invalid gateway. Is this request valid or is this an issue with NetworkManager? This used to work before, [gvaradar@240m5avmarch linux]$ ip route default via 10.193.164.254 dev e0 proto dhcp metric 100 10.193.164.0/24 via 0.0.0.0 dev e0 proto kernel scope link src 10.193.164.12 metric 100 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101 I do not know why NetworkManager is adding "via 0.0.0.0". 192.168.0.0/24 is a local subnet. Either way, this seems to break odd behavior of NetworkManager. -- Govind Network details: [NOT WORKING]: HEAD of net-next [gvaradar@240m5avmarch ~]$ ip -d a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 promiscuity 0 minmtu 0 maxmtu 0 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host valid_lft forever preferred_lft forever 2: e0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000 link/ether 52:54:00:64:86:b6 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 65535 numtxqueues 1 numrxqueues 1 gso_max_size 65536 gso_max_segs 65535 inet 10.193.164.12/24 brd 10.193.164.255 scope global dynamic noprefixroute e0 valid_lft 21430sec preferred_lft 21430sec inet6 fe80::1f95:bfca:8e05:9448/64 scope link noprefixroute valid_lft forever preferred_lft forever 3: bm0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000 link/ether 00:fc:ba:a2:9c:d5 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 9000 numtxqueues 8 numrxqueues 8 gso_max_size 65536 gso_max_segs 65535 inet 192.168.0.1/24 brd 192.168.0.255 scope global noprefixroute bm0 valid_lft forever preferred_lft forever inet6 fe80::5988:7d2:a671:6c7d/64 scope link noprefixroute valid_lft forever preferred_lft forever [gvaradar@240m5avmarch ~]$ ip route [gvaradar@240m5avmarch ~]$ ping 192.168.0.2 -c2 connect: Network is unreachable [gvaradar@240m5avmarch ~]$ sudo ip route add 192.168.0.0/24 dev bm0 [gvaradar@240m5avmarch ~]$ ip route 192.168.0.0/24 dev bm0 scope link [gvaradar@240m5avmarch ~]$ ping 192.168.0.2 -c2 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.121 ms 64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.065 ms [gvaradar@240m5avmarch ~]$ sudo ip route add 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101 Error: Nexthop has invalid gateway. [root@240m5avmarch ~]# systemctl stop NetworkManager [root@240m5avmarch ~]# netctl start bm0 [root@240m5avmarch ~]# ip route 192.168.0.0/24 dev bm0 proto kernel scope link src 192.168.0.1 [root@240m5avmarch ~]# ping 192.168.0.2 -c2 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.184 ms 64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.050 ms [Working]: #First working commit [gvaradar@240m5avmarch linux]$ git log -1 commit a4ea5d43c807be28545625c1e0641905022fa0d1 (HEAD, refs/bisect/good-a4ea5d43c807be28545625c1e0641905022fa0d1) Author: David Ahern <dsah...@gmail.com> Date: Fri Apr 5 16:30:30 2019 -0700 ipv4: Add support to fib_config for IPv6 gateway Add support for an IPv6 gateway to fib_config. Since a gateway is either IPv4 or IPv6, make it a union with fc_gw4 where fc_gw_family decides which address is in use. Update current checks on family and gw4 to handle ipv6 as well. Signed-off-by: David Ahern <dsah...@gmail.com> Reviewed-by: Ido Schimmel <ido...@mellanox.com> Signed-off-by: David S. Miller <da...@davemloft.net> [gvaradar@240m5avmarch linux]$ ip route default via 10.193.164.254 dev e0 proto dhcp metric 100 10.193.164.0/24 via 0.0.0.0 dev e0 proto kernel scope link src 10.193.164.12 metric 100 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101 [gvaradar@240m5avmarch linux]$ ping 192.168.0.2 -c4 PING 192.168.0.2 (192.168.0.2) 56(84) bytes of data. 64 bytes from 192.168.0.2: icmp_seq=1 ttl=64 time=0.075 ms 64 bytes from 192.168.0.2: icmp_seq=2 ttl=64 time=0.047 ms 64 bytes from 192.168.0.2: icmp_seq=3 ttl=64 time=0.046 ms 64 bytes from 192.168.0.2: icmp_seq=4 ttl=64 time=0.071 ms ... [gvaradar@240m5avmarch linux]$ sudo ip route del 192.168.0.0/24 [gvaradar@240m5avmarch linux]$ ip route default via 10.193.164.254 dev e0 proto dhcp metric 100 10.193.164.0/24 via 0.0.0.0 dev e0 proto kernel scope link src 10.193.164.12 metric 100 [gvaradar@240m5avmarch linux]$ sudo ip route add 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101 [gvaradar@240m5avmarch linux]$ ip route default via 10.193.164.254 dev e0 proto dhcp metric 100 10.193.164.0/24 via 0.0.0.0 dev e0 proto kernel scope link src 10.193.164.12 metric 100 192.168.0.0/24 via 0.0.0.0 dev bm0 proto kernel scope link src 192.168.0.1 metric 101