netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] af_mpls: fix undefined reference to ip6_route_output
@ 2015-07-22  7:10 Roopa Prabhu
  2015-07-22 12:23 ` Thomas Graf
  0 siblings, 1 reply; 15+ messages in thread
From: Roopa Prabhu @ 2015-07-22  7:10 UTC (permalink / raw)
  To: davem; +Cc: netdev

From: Roopa Prabhu <roopa@cumulusnetworks.com>

seen with CONFIG_IPV6 disabled. Wrap the code
around IS_ENABLED(CONFIG_IPV6)

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
 net/mpls/af_mpls.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 49f1b0e..040dfff 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -351,6 +351,7 @@ errout:
 	return dev;
 }
 
+#if IS_ENABLED(CONFIG_IPV6)
 static struct net_device *inet6_fib_lookup_dev(struct net *net, void *addr)
 {
 	struct net_device *dev = NULL;
@@ -371,6 +372,12 @@ errout:
 
 	return dev;
 }
+#else
+static struct net_device *inet6_fib_lookup_dev(struct net *net, void *addr)
+{
+	return NULL;
+}
+#endif
 
 static struct net_device *find_outdev(struct net *net,
 				      struct mpls_route_config *cfg)
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH net-next] af_mpls: fix undefined reference to ip6_route_output
@ 2015-07-22 23:10 Roopa Prabhu
  0 siblings, 0 replies; 15+ messages in thread
From: Roopa Prabhu @ 2015-07-22 23:10 UTC (permalink / raw)
  To: davem, tgraf; +Cc: netdev

From: Roopa Prabhu <roopa@cumulusnetworks.com>

seen with CONFIG_IPV6 disabled. Wrap the code around
IS_BUILTIN(CONFIG_IPV6). Also fixes undefined reference
to ip_route_output with CONFIG_INET=n

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reported-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
---
could not think of a better way. This uses IS_BUILTIN instead
of IS_ENABLED to avoid the case where CONFIG_IPV6=m.
I am not sure if this could confuse the user.

 net/mpls/af_mpls.c |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c
index 49f1b0e..71dbc4b 100644
--- a/net/mpls/af_mpls.c
+++ b/net/mpls/af_mpls.c
@@ -331,6 +331,7 @@ static unsigned find_free_label(struct net *net)
 	return LABEL_NOT_SPECIFIED;
 }
 
+#if IS_ENABLED(CONFIG_INET)
 static struct net_device *inet_fib_lookup_dev(struct net *net, void *addr)
 {
 	struct net_device *dev = NULL;
@@ -350,7 +351,14 @@ static struct net_device *inet_fib_lookup_dev(struct net *net, void *addr)
 errout:
 	return dev;
 }
+#else
+static struct net_device *inet_fib_lookup_dev(struct net *net, void *addr)
+{
+	return ERR_PTR(-EAFNOSUPPORT);
+}
+#endif
 
+#if IS_BUILTIN(CONFIG_IPV6)
 static struct net_device *inet6_fib_lookup_dev(struct net *net, void *addr)
 {
 	struct net_device *dev = NULL;
@@ -371,6 +379,12 @@ errout:
 
 	return dev;
 }
+#else
+static struct net_device *inet6_fib_lookup_dev(struct net *net, void *addr)
+{
+	return ERR_PTR(-EAFNOSUPPORT);
+}
+#endif
 
 static struct net_device *find_outdev(struct net *net,
 				      struct mpls_route_config *cfg)
@@ -427,8 +441,11 @@ static int mpls_route_add(struct mpls_route_config *cfg)
 
 	err = -ENODEV;
 	dev = find_outdev(net, cfg);
-	if (!dev)
+	if (IS_ERR(dev)) {
+		err = PTR_ERR(dev);
+		dev = NULL;
 		goto errout;
+	}
 
 	/* Ensure this is a supported device */
 	err = -EINVAL;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2015-07-27  0:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22  7:10 [PATCH net-next] af_mpls: fix undefined reference to ip6_route_output Roopa Prabhu
2015-07-22 12:23 ` Thomas Graf
2015-07-22 17:49   ` David Miller
2015-07-22 19:30     ` roopa
2015-07-22 19:57       ` Thomas Graf
2015-07-22 20:04         ` David Miller
2015-07-22 20:17           ` Thomas Graf
2015-07-22 20:38             ` roopa
2015-07-23  7:09               ` David Miller
2015-07-23 13:44                 ` roopa
2015-07-27  0:20                   ` David Miller
2015-07-22 20:22           ` roopa
2015-07-22 20:03       ` David Miller
2015-07-22 19:30   ` roopa
  -- strict thread matches above, loose matches on Subject: below --
2015-07-22 23:10 Roopa Prabhu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).