diff options
author | Cong Wang <cwang@twopensource.com> | 2014-04-15 19:25:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-04-16 15:05:11 -0400 |
commit | 6a662719c9868b3d6c7d26b3a085f0cd3cc15e64 (patch) | |
tree | 66bcb1ab0be053a656cffd10960dc7f3ca6564f9 /include/net/net_namespace.h | |
parent | c98235cb8584a72e95786e17d695a8e5fafcd766 (diff) |
ipv4, fib: pass LOOPBACK_IFINDEX instead of 0 to flowi4_iif
As suggested by Julian:
Simply, flowi4_iif must not contain 0, it does not
look logical to ignore all ip rules with specified iif.
because in fib_rule_match() we do:
if (rule->iifindex && (rule->iifindex != fl->flowi_iif))
goto out;
flowi4_iif should be LOOPBACK_IFINDEX by default.
We need to move LOOPBACK_IFINDEX to include/net/flow.h:
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/net_namespace.h')
-rw-r--r-- | include/net/net_namespace.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 79387f73f875..5f9eb260990f 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/sysctl.h> | 10 | #include <linux/sysctl.h> |
11 | 11 | ||
12 | #include <net/flow.h> | ||
12 | #include <net/netns/core.h> | 13 | #include <net/netns/core.h> |
13 | #include <net/netns/mib.h> | 14 | #include <net/netns/mib.h> |
14 | #include <net/netns/unix.h> | 15 | #include <net/netns/unix.h> |
@@ -131,14 +132,6 @@ struct net { | |||
131 | atomic_t fnhe_genid; | 132 | atomic_t fnhe_genid; |
132 | }; | 133 | }; |
133 | 134 | ||
134 | /* | ||
135 | * ifindex generation is per-net namespace, and loopback is | ||
136 | * always the 1st device in ns (see net_dev_init), thus any | ||
137 | * loopback device should get ifindex 1 | ||
138 | */ | ||
139 | |||
140 | #define LOOPBACK_IFINDEX 1 | ||
141 | |||
142 | #include <linux/seq_file_net.h> | 135 | #include <linux/seq_file_net.h> |
143 | 136 | ||
144 | /* Init's network namespace */ | 137 | /* Init's network namespace */ |