alistair23-linux/net/ipv6
David Ahern b5d2d75e07 net/ipv6: Do not allow device only routes via the multipath API
Eric reported that reverting the patch that fixed and simplified IPv6
multipath routes means reverting back to invalid userspace notifications.
eg.,
$ ip -6 route add 2001:db8:1::/64 nexthop dev eth0 nexthop dev eth1

only generates a single notification:
2001:db8:1::/64 dev eth0 metric 1024 pref medium

While working on a fix for this problem I found another case that is just
broken completely - a multipath route with a gateway followed by device
followed by gateway:
    $ ip -6 ro add 2001:db8:103::/64
          nexthop via 2001:db8:1::64
          nexthop dev dummy2
          nexthop via 2001:db8:3::64

In this case the device only route is dropped completely - no notification
to userpsace but no addition to the FIB either:

$ ip -6 ro ls
2001:db8:1::/64 dev dummy1 proto kernel metric 256 pref medium
2001:db8:2::/64 dev dummy2 proto kernel metric 256 pref medium
2001:db8:3::/64 dev dummy3 proto kernel metric 256 pref medium
2001:db8:103::/64 metric 1024
	nexthop via 2001:db8:1::64 dev dummy1 weight 1
	nexthop via 2001:db8:3::64 dev dummy3 weight 1 pref medium
fe80::/64 dev dummy1 proto kernel metric 256 pref medium
fe80::/64 dev dummy2 proto kernel metric 256 pref medium
fe80::/64 dev dummy3 proto kernel metric 256 pref medium

Really, IPv6 multipath is just FUBAR'ed beyond repair when it comes to
device only routes, so do not allow it all.

This change will break any scripts relying on the mpath api for insert,
but I don't see any other way to handle the permutations. Besides, since
the routes are added to the FIB as standalone (non-multipath) routes the
kernel is not doing what the user requested, so it might as well tell the
user that.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David Ahern <dsahern@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2018-07-16 14:07:17 -07:00
..
ila treewide: kvmalloc() -> kvmalloc_array() 2018-06-12 16:19:22 -07:00
netfilter netfilter: ipv6: nf_defrag: drop skb dst before queueing 2018-07-09 18:04:12 +02:00
addrconf.c net/ipv6: Fix updates to prefix route 2018-06-30 20:49:58 +09:00
addrconf_core.c net/ipv6: Add helper to return path MTU based on fib result 2018-05-22 10:51:09 +02:00
addrlabel.c
af_inet6.c Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL 2018-06-28 10:40:47 -07:00
ah6.c
anycast.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
calipso.c ipv6: make ipv6_renew_options() interrupt/kernel safe 2018-07-05 20:15:26 +09:00
datagram.c udp: fix rx queue len reported by diag and proc interface 2018-06-08 19:55:15 -04:00
esp6.c
esp6_offload.c
exthdrs.c ipv6: make ipv6_renew_options() interrupt/kernel safe 2018-07-05 20:15:26 +09:00
exthdrs_core.c net: ipv6: Fix typo in ipv6_find_hdr() documentation 2018-05-07 23:50:27 -04:00
exthdrs_offload.c
fib6_notifier.c
fib6_rules.c net/ipv6: Add fib6_lookup 2018-05-11 00:10:56 +02:00
fou6.c
icmp.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
inet6_connection_sock.c
inet6_hashtables.c net/tcp: Fix socket lookups with SO_BINDTODEVICE 2018-06-20 08:03:06 +09:00
ip6_checksum.c
ip6_fib.c net/ipv6: Revert attempt to simplify route replace and append 2018-07-04 15:22:13 +09:00
ip6_flowlabel.c proc: introduce proc_create_net{,_data} 2018-05-16 07:24:30 +02:00
ip6_gre.c net: ip6_gre: get ipv6hdr after skb_cow_head() 2018-07-16 13:39:47 -07:00
ip6_icmp.c
ip6_input.c ipv6: Count interface receive statistics on the ingress netdev 2018-04-17 13:39:51 -04:00
ip6_offload.c udp: add udp gso 2018-04-26 15:07:42 -04:00
ip6_offload.h
ip6_output.c ip: limit use of gso_size to udp 2018-06-20 14:41:04 +09:00
ip6_tunnel.c ip6_tunnel: remove magic mtu value 0xFFF8 2018-06-01 13:56:30 -04:00
ip6_udp_tunnel.c
ip6_vti.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-05-11 20:53:22 -04:00
ip6mr.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2018-06-06 18:39:49 -07:00
ipcomp6.c
ipv6_sockglue.c ipv6/mcast: init as INCLUDE when join SSM INCLUDE group 2018-07-16 11:20:06 -07:00
Kconfig bpf: Add IPv6 Segment Routing helpers 2018-05-24 11:57:35 +02:00
Makefile
mcast.c ipv6/mcast: init as INCLUDE when join SSM INCLUDE group 2018-07-16 11:20:06 -07:00
mcast_snoop.c
mip6.c
ndisc.c ipv6: make DAD fail with enhanced DAD when nonce length differs 2018-07-16 13:45:16 -07:00
netfilter.c
output_core.c
ping.c proc: introduce proc_create_net{,_data} 2018-05-16 07:24:30 +02:00
proc.c proc: introduce proc_create_net_single 2018-05-16 07:24:30 +02:00
protocol.c
raw.c Revert changes to convert to ->poll_mask() and aio IOCB_CMD_POLL 2018-06-28 10:40:47 -07:00
reassembly.c ipv6: frags: fix a lockdep false positive 2018-04-18 23:19:39 -04:00
route.c net/ipv6: Do not allow device only routes via the multipath API 2018-07-16 14:07:17 -07:00
seg6.c net: remove unnecessary genlmsg_cancel() calls 2018-05-29 09:53:38 -04:00
seg6_hmac.c ipv6: sr: fix passing wrong flags to crypto_alloc_shash() 2018-07-02 20:36:37 +09:00
seg6_iptunnel.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-03 09:31:58 -04:00
seg6_local.c ipv6: sr: Add seg6local action End.BPF 2018-05-24 11:57:36 +02:00
sit.c ip6_tunnel: remove magic mtu value 0xFFF8 2018-06-01 13:56:30 -04:00
syncookies.c
sysctl_net_ipv6.c ipv6: sr: Compute flowlabel for outer IPv6 header of seg6 encap mode 2018-04-25 13:02:15 -04:00
tcp_ipv6.c tcp: verify the checksum of the first data segment in a new connection 2018-06-14 17:04:41 -07:00
tcpv6_offload.c
tunnel6.c
udp.c udp: fix rx queue len reported by diag and proc interface 2018-06-08 19:55:15 -04:00
udp_impl.h
udp_offload.c udp: Add support for software checksum and GSO_PARTIAL with GSO offload 2018-05-08 22:30:06 -04:00
udplite.c proc: introduce proc_create_net{,_data} 2018-05-16 07:24:30 +02:00
xfrm6_input.c
xfrm6_mode_beet.c
xfrm6_mode_ro.c
xfrm6_mode_transport.c
xfrm6_mode_tunnel.c
xfrm6_output.c
xfrm6_policy.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2018-06-03 09:31:58 -04:00
xfrm6_protocol.c
xfrm6_state.c xfrm: remove VLA usage in __xfrm6_sort() 2018-04-26 07:51:48 +02:00
xfrm6_tunnel.c xfrm: Fix warning in xfrm6_tunnel_net_exit. 2018-04-16 07:50:09 +02:00