diff mbox

[net,1/3] net: move LOOPBACK_IFINDEX to include/net/flow.h

Message ID 1397525608-11592-1-git-send-email-xiyou.wangcong@gmail.com
State Changes Requested, archived
Delegated to: David Miller
Headers show

Commit Message

Cong Wang April 15, 2014, 1:33 a.m. UTC
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(-)

Comments

David Miller April 15, 2014, 7:06 p.m. UTC | #1
Cong, first of all, I'd like you to combine patches #1 and #2.

Also, Julian made it clear that several other changes needed happen
besides the single fib_validate_source() call site you are modifying
in patch #3.

He also said, for example, that the flow4_iif assignment in
__fib_validate_source() needs adjusting as well.

He furthermore said that other assignments of zero to flow4_iif
in netfilter and elsewhere must be adjusted as well.

Please also provide a proper 0/N patch posting next time explaining
exactly what the series does and why it is necessary.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Cong Wang April 15, 2014, 7:13 p.m. UTC | #2
On Tue, Apr 15, 2014 at 12:06 PM, David Miller <davem@davemloft.net> wrote:
>
> Cong, first of all, I'd like you to combine patches #1 and #2.
>

OK, whatever you prefer...I have no strong opinion here.

> Also, Julian made it clear that several other changes needed happen
> besides the single fib_validate_source() call site you are modifying
> in patch #3.
>
> He also said, for example, that the flow4_iif assignment in
> __fib_validate_source() needs adjusting as well.
>
> He furthermore said that other assignments of zero to flow4_iif
> in netfilter and elsewhere must be adjusted as well.

I believe I did in patch #2, or I still miss anything?

>
> Please also provide a proper 0/N patch posting next time explaining
> exactly what the series does and why it is necessary.

OK, will do, I thought per-patch description is enough.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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 */