summaryrefslogtreecommitdiff
path: root/target
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-11-15 21:33:14 +0000
committerFelix Fietkau <nbd@openwrt.org>2015-11-15 21:33:14 +0000
commit1f8864c046003bdf2936625680ff4b8907d9264e (patch)
tree0fe842f327a2e3cbceac3338cc4cba90740afa48 /target
parent124b8c653f96fd6fa81e5d7ce6100daf4c4c6453 (diff)
downloadmtk-20170518-1f8864c046003bdf2936625680ff4b8907d9264e.zip
mtk-20170518-1f8864c046003bdf2936625680ff4b8907d9264e.tar.gz
mtk-20170518-1f8864c046003bdf2936625680ff4b8907d9264e.tar.bz2
kernel: add patch to fix prefsrc lookups
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be> SVN-Revision: 47471
Diffstat (limited to 'target')
-rw-r--r--target/linux/generic/patches-4.3/192-net-Fix-presrc-lookups.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/target/linux/generic/patches-4.3/192-net-Fix-presrc-lookups.patch b/target/linux/generic/patches-4.3/192-net-Fix-presrc-lookups.patch
new file mode 100644
index 0000000..8a05083
--- /dev/null
+++ b/target/linux/generic/patches-4.3/192-net-Fix-presrc-lookups.patch
@@ -0,0 +1,60 @@
+From patchwork Tue Nov 3 23:59:28 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: net: Fix prefsrc lookups
+From: David Ahern <dsa@cumulusnetworks.com>
+X-Patchwork-Id: 539645
+Message-Id: <1446595168-27323-1-git-send-email-dsa@cumulusnetworks.com>
+To: netdev@vger.kernel.org
+Cc: vladi@aresgate.net, David Ahern <dsa@cumulusnetworks.com>
+Date: Tue, 3 Nov 2015 15:59:28 -0800
+
+A bug report (https://bugzilla.kernel.org/show_bug.cgi?id=107071) noted
+that the follwoing ip command is failing with v4.3:
+
+ $ ip route add 10.248.5.0/24 dev bond0.250 table vlan_250 src 10.248.5.154
+ RTNETLINK answers: Invalid argument
+
+021dd3b8a142d changed the lookup of the given preferred source address to
+use the table id passed in, but this assumes the local entries are in the
+given table which is not necessarily true for non-VRF use cases. When
+validating the preferred source fallback to the local table on failure.
+
+Fixes: 021dd3b8a142d ("net: Add routes to the table associated with the device")
+Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
+---
+This is needed in v4.3.
+
+ net/ipv4/fib_semantics.c | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
+index 064bd3caaa4f..aac966f6162f 100644
+--- a/net/ipv4/fib_semantics.c
++++ b/net/ipv4/fib_semantics.c
+@@ -864,14 +864,21 @@ static bool fib_valid_prefsrc(struct fib_config *cfg, __be32 fib_prefsrc)
+ if (cfg->fc_type != RTN_LOCAL || !cfg->fc_dst ||
+ fib_prefsrc != cfg->fc_dst) {
+ u32 tb_id = cfg->fc_table;
++ int rc;
+
+ if (tb_id == RT_TABLE_MAIN)
+ tb_id = RT_TABLE_LOCAL;
+
+- if (inet_addr_type_table(cfg->fc_nlinfo.nl_net,
+- fib_prefsrc, tb_id) != RTN_LOCAL) {
+- return false;
++ rc = inet_addr_type_table(cfg->fc_nlinfo.nl_net,
++ fib_prefsrc, tb_id);
++
++ if (rc != RTN_LOCAL && tb_id != RT_TABLE_LOCAL) {
++ rc = inet_addr_type_table(cfg->fc_nlinfo.nl_net,
++ fib_prefsrc, RT_TABLE_LOCAL);
+ }
++
++ if (rc != RTN_LOCAL)
++ return false;
+ }
+ return true;
+ }