mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: alexander.levin@verizon.com
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Cc: David Ahern <dsahern@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	alexander.levin@verizon.com
Subject: [PATCH AUTOSEL for 4.14 02/64] net: ipv6: Fixup device for anycast routes during copy
Date: Sat, 2 Dec 2017 15:51:13 +0000	[thread overview]
Message-ID: <20171202155101.7573-2-alexander.levin@verizon.com> (raw)
In-Reply-To: <20171202155101.7573-1-alexander.levin@verizon.com>

From: David Ahern <dsahern@gmail.com>

[ Upstream commit 98d11291d189cb5adf49694d0ad1b971c0212697 ]

Florian reported a breakage with anycast routes due to commit
4832c30d5458 ("net: ipv6: put host and anycast routes on device with
address"). Prior to this commit anycast routes were added against the
loopback device causing repetitive route entries with no insight into
why they existed. e.g.:
  $ ip -6 ro ls  table local type anycast
  anycast 2001:db8:1:: dev lo proto kernel metric 0 pref medium
  anycast 2001:db8:2:: dev lo proto kernel metric 0 pref medium
  anycast fe80:: dev lo proto kernel metric 0 pref medium
  anycast fe80:: dev lo proto kernel metric 0 pref medium

The point of commit 4832c30d5458 is to add the routes using the device
with the address which is causing the route to be added. e.g.,:
  $ ip -6 ro ls  table local type anycast
  anycast 2001:db8:1:: dev eth1 proto kernel metric 0 pref medium
  anycast 2001:db8:2:: dev eth2 proto kernel metric 0 pref medium
  anycast fe80:: dev eth2 proto kernel metric 0 pref medium
  anycast fe80:: dev eth1 proto kernel metric 0 pref medium

For traffic to work as it did before, the dst device needs to be switched
to the loopback when the copy is created similar to local routes.

Fixes: 4832c30d5458 ("net: ipv6: put host and anycast routes on device with address")
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
---
 net/ipv6/route.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index a96d5b385d8f..598efa8cfe25 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -960,7 +960,7 @@ static struct net_device *ip6_rt_get_dev_rcu(struct rt6_info *rt)
 {
 	struct net_device *dev = rt->dst.dev;
 
-	if (rt->rt6i_flags & RTF_LOCAL) {
+	if (rt->rt6i_flags & (RTF_LOCAL | RTF_ANYCAST)) {
 		/* for copies of local routes, dst->dev needs to be the
 		 * device if it is a master device, the master device if
 		 * device is enslaved, and the loopback as the default
-- 
2.11.0

  reply	other threads:[~2017-12-02 15:51 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-02 15:51 [PATCH AUTOSEL for 4.14 01/64] irqchip/qcom: Fix u32 comparison with value less than zero alexander.levin
2017-12-02 15:51 ` alexander.levin [this message]
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 03/64] net/smc: use sk_rcvbuf as start for rmb creation alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 04/64] kbuild: pkg: use --transform option to prefix paths in tar alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 08/64] apparmor: fix leak of null profile name if profile allocation fails alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 06/64] powerpc/perf: Fix pmu_count to count only nest imc pmus alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 07/64] net: qmi_wwan: add Quectel BG96 2c7c:0296 alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 05/64] coccinelle: fix parallel build with CHECK=scripts/coccicheck alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 11/64] tun: fix rcu_read_lock imbalance in tun_build_skb alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 09/64] x86/mpx/selftests: Fix up weird arrays alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 10/64] mac80211_hwsim: Fix memory leak in hwsim_new_radio_nl() alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 13/64] tcp: when scheduling TLP, time of RTO should account for current ACK alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 12/64] gre6: use log_ecn_error module parameter in ip6_tnl_rcv() alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 14/64] route: also update fnhe_genid when updating a route cache alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 15/64] route: update fnhe_expires for redirect when the fnhe exists alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 16/64] rsi: fix memory leak on buf and usb_reg_buf alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 17/64] drivers/rapidio/devices/rio_mport_cdev.c: fix resource leak in error handling path in 'rio_dma_transfer()' alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 18/64] pipe: match pipe_max_size data type with procfs alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 19/64] lib/genalloc.c: make the avail variable an atomic_long_t alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 20/64] dynamic-debug-howto: fix optional/omitted ending line number to be LARGE instead of 0 alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 21/64] NFS: Fix a typo in nfs_rename() alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 22/64] sunrpc: Fix rpc_task_begin trace point alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 23/64] nfp: inherit the max_mtu from the PF netdev alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 25/64] xfs: fix forgotten rcu read unlock when skipping inode reclaim alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 24/64] nfp: fix flower offload metadata flag usage alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 28/64] sparc64/mm: set fields in deferred pages alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 26/64] dt-bindings: usb: fix reg-property port-number range alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 27/64] block: wake up all tasks blocked in get_request() alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 30/64] slub: fix sysfs duplicate filename creation when slub_debug=O alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 31/64] sctp: do not free asoc when it is already dead in sctp_sendmsg alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 29/64] zsmalloc: calling zs_map_object() from irq is a bug alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 32/64] sctp: use the right sk after waking up from wait_buf sleep alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 34/64] geneve: fix fill_info when link down alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 33/64] fcntl: don't leak fd reference when fixup_compat_flock fails alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 35/64] bpf: fix lockdep splat alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 36/64] ipv6: set all.accept_dad to 0 by default alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 37/64] clk: stm32h7: fix test of clock config alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 38/64] clk: sunxi-ng: a83t: Fix i2c buses bits alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 40/64] clk: uniphier: fix DAPLL2 clock rate of Pro5 alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 39/64] clk: qcom: common: fix legacy board-clock registration alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 42/64] mailbox: mailbox-test: don't rely on rx_buffer content to signal data ready alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 41/64] clk: hi3660: fix incorrect uart3 clock freqency alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 45/64] jump_label: Invoke jump_label_test() via early_initcall() alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 46/64] tls: Use kzalloc for aead_request allocation alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 43/64] kbuild: rpm-pkg: fix jobserver unavailable warning alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 44/64] atm: horizon: Fix irq release error alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 47/64] xfrm: Copy policy family in clone_policy alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 49/64] bnxt_re: changing the ip address shouldn't affect new connections alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 50/64] IB/mlx4: Increase maximal message size under UD QP alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 48/64] f2fs: fix to clear FI_NO_PREALLOC alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 52/64] afs: Fix total-length calculation for multiple-page send alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 53/64] afs: Connect up the CB.ProbeUuid alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 51/64] IB/mlx5: Assign send CQ and recv CQ of UMR QP alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 55/64] powerpc/powernv/idle: Round up latency and residency values alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 54/64] kbuild: do not call cc-option before KBUILD_CFLAGS initialization alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 57/64] ide: ide-atapi: fix compile error with defining macro DEBUG alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 56/64] ipvlan: fix ipv6 outbound device alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 59/64] nvmet-rdma: update queue list during ib_device removal alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 58/64] blk-mq: Avoid that request queue removal can trigger list corruption alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 62/64] dm raid: fix panic when attempting to force a raid to sync alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 60/64] audit: Allow auditd to set pid to 0 to end auditing alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 61/64] audit: ensure that 'audit=1' actually enables audit for PID 1 alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 63/64] md: free unused memory after bitmap resize alexander.levin
2017-12-02 15:51 ` [PATCH AUTOSEL for 4.14 64/64] RDMA/cxgb4: Annotate r2 and stag as __be32 alexander.levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171202155101.7573-2-alexander.levin@verizon.com \
    --to=alexander.levin@verizon.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®