diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/flow.h | 10 | ||||
| -rw-r--r-- | include/net/net_namespace.h | 9 |
2 files changed, 10 insertions, 9 deletions
diff --git a/include/net/flow.h b/include/net/flow.h index c91e2aae3..1426681f7 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -12,6 +12,14 @@ #include <linux/atomic.h> #include <linux/uidgid.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; @@ -85,7 +93,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif, kuid_t uid) { fl4->flowi4_oif = oif; - fl4->flowi4_iif = 0; + fl4->flowi4_iif = LOOPBACK_IFINDEX; fl4->flowi4_mark = mark; fl4->flowi4_tos = tos; fl4->flowi4_scope = scope; diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index f4f12e845..0faaed2e2 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> @@ -122,14 +123,6 @@ struct net { atomic_t rt_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 */ |
