All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch net 1/3] net: move LOOPBACK_IFINDEX to include/net/flow.h
@ 2014-04-15  1:33 Cong Wang
  2014-04-15  1:33 ` [Patch net 2/3] ipv4,fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif Cong Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Cong Wang @ 2014-04-15  1:33 UTC (permalink / raw)
  To: netdev
  Cc: Cong Wang, Eric Biederman, Julian Anastasov, David S. Miller, Cong Wang

From: Cong Wang <cwang@twopensource.com>

1) It is mostly used by flowi_iif

2) Fix the following compile error if we use it in flow.h
by the patches latter:

In file included from include/linux/netfilter.h:277:0,
                 from include/net/netns/netfilter.h:5,
                 from include/net/net_namespace.h:21,
                 from include/linux/netdevice.h:43,
                 from include/linux/icmpv6.h:12,
                 from include/linux/ipv6.h:61,
                 from include/net/ipv6.h:16,
                 from include/linux/sunrpc/clnt.h:27,
                 from include/linux/nfs_fs.h:30,
                 from init/do_mounts.c:32:
include/net/flow.h: In function ‘flowi4_init_output’:
include/net/flow.h:84:32: error: ‘LOOPBACK_IFINDEX’ undeclared (first use in this function)

Cc: Eric Biederman <ebiederm@xmission.com>
Cc: Julian Anastasov <ja@ssi.bg>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Cong Wang <cwang@twopensource.com>
---
 include/net/flow.h          | 8 ++++++++
 include/net/net_namespace.h | 9 +--------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/net/flow.h b/include/net/flow.h
index 64fd248..5401998 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -11,6 +11,14 @@
 #include <linux/in6.h>
 #include <linux/atomic.h>
 
+/*
+ * ifindex generation is per-net namespace, and loopback is
+ * always the 1st device in ns (see net_dev_init), thus any
+ * loopback device should get ifindex 1
+ */
+
+#define LOOPBACK_IFINDEX	1
+
 struct flowi_common {
 	int	flowic_oif;
 	int	flowic_iif;
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 79387f7..5f9eb26 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -9,6 +9,7 @@
 #include <linux/list.h>
 #include <linux/sysctl.h>
 
+#include <net/flow.h>
 #include <net/netns/core.h>
 #include <net/netns/mib.h>
 #include <net/netns/unix.h>
@@ -131,14 +132,6 @@ struct net {
 	atomic_t		fnhe_genid;
 };
 
-/*
- * ifindex generation is per-net namespace, and loopback is
- * always the 1st device in ns (see net_dev_init), thus any
- * loopback device should get ifindex 1
- */
-
-#define LOOPBACK_IFINDEX	1
-
 #include <linux/seq_file_net.h>
 
 /* Init's network namespace */
-- 
1.8.3.1

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

end of thread, other threads:[~2014-04-15 23:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-15  1:33 [Patch net 1/3] net: move LOOPBACK_IFINDEX to include/net/flow.h Cong Wang
2014-04-15  1:33 ` [Patch net 2/3] ipv4,fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif Cong Wang
2014-04-15 20:26   ` Julian Anastasov
2014-04-15 23:25     ` Cong Wang
2014-04-15  1:33 ` [Patch net 3/3] ipv4,fib: pass 0 instead of LOOPBACK_IFINDEX to fib_validate_source() Cong Wang
2014-04-15 19:06 ` [Patch net 1/3] net: move LOOPBACK_IFINDEX to include/net/flow.h David Miller
2014-04-15 19:13   ` Cong Wang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.