aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/flow.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/flow.h')
-rw-r--r--include/net/flow.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/net/flow.h b/include/net/flow.h
index 64fd24836650..8109a159d1b3 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -11,6 +11,14 @@
11#include <linux/in6.h> 11#include <linux/in6.h>
12#include <linux/atomic.h> 12#include <linux/atomic.h>
13 13
14/*
15 * ifindex generation is per-net namespace, and loopback is
16 * always the 1st device in ns (see net_dev_init), thus any
17 * loopback device should get ifindex 1
18 */
19
20#define LOOPBACK_IFINDEX 1
21
14struct flowi_common { 22struct flowi_common {
15 int flowic_oif; 23 int flowic_oif;
16 int flowic_iif; 24 int flowic_iif;
@@ -80,7 +88,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
80 __be16 dport, __be16 sport) 88 __be16 dport, __be16 sport)
81{ 89{
82 fl4->flowi4_oif = oif; 90 fl4->flowi4_oif = oif;
83 fl4->flowi4_iif = 0; 91 fl4->flowi4_iif = LOOPBACK_IFINDEX;
84 fl4->flowi4_mark = mark; 92 fl4->flowi4_mark = mark;
85 fl4->flowi4_tos = tos; 93 fl4->flowi4_tos = tos;
86 fl4->flowi4_scope = scope; 94 fl4->flowi4_scope = scope;