Skip to contentSkip to conversation

rtnetlink: mpls: ip_valid_fib_dump_req() requires CONFIG_INET

PATCH In review Arnd Bergmann 2 participants 2 messages Oct 9, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rtnetlink: mpls: ip_valid_fib_dump_req() requires CONFIG_INET

The newly added call to ip_valid_fib_dump_req() causes a link error in configurations that enable MPLS but not IPv4:

net/mpls/af_mpls.o: In function `mpls_dump_routes':
af_mpls.c:(.text+0xed0): undefined reference to `ip_valid_fib_dump_req'

With the added IS_ENABLED() check we get the previous behavior back in that configuration, and skip the check.

Fixes e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking")
---
 net/mpls/af_mpls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mpls/af_mpls.c +1 -1
index 7f891ffffc05..99ff6114d513 100644
@@ -2041,7 +2041,7 @@ static int mpls_dump_routes(struct sk_buff *skb, struct netlink_callback *cb)
 
 	ASSERT_RTNL();
 
-	if (cb->strict_check) {
+	if (IS_ENABLED(CONFIG_INET) && cb->strict_check) {
 		int err = ip_valid_fib_dump_req(nlh, cb->extack);
 
 		if (err < 0)
Signature · 1 line
2.18.0
#1 lore raw
Quoted 21 lines · Arnd Bergmann

The newly added call to ip_valid_fib_dump_req() causes a link error in configurations that enable MPLS but not IPv4:

net/mpls/af_mpls.o: In function `mpls_dump_routes':
af_mpls.c:(.text+0xed0): undefined reference to `ip_valid_fib_dump_req'

With the added IS_ENABLED() check we get the previous behavior back in that configuration, and skip the check.

Fixes e8ba330ac0c5 ("rtnetlink: Update fib dumps for strict data checking")
---
 net/mpls/af_mpls.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mpls/af_mpls.c +0 -0
index 7f891ffffc05..99ff6114d513 100644

net/mpls/af_mpls.c static int mpls_dump_routes(struct sk_buff *skb, struct netlink_callback *cb) · line 2047

Quoted 8 lines
net/mpls/af_mpls.c +1 -1
@@ -2041,7 +2041,7 @@ static int mpls_dump_routes(struct sk_buff *skb, struct netlink_callback *cb)
 
 	ASSERT_RTNL();
 
-	if (cb->strict_check) {
+	if (IS_ENABLED(CONFIG_INET) && cb->strict_check) {
 		int err = ip_valid_fib_dump_req(nlh, cb->extack);
 
 		if (err < 0)

If INET is not defined then mpls will need its own valid_dump_req function to ensure strict_check semantics are managed. I'll send a patch.