History

flow: Extend flow informations with xfrm interface id.

Add a new flowi_xfrm structure with informations needed to do a xfrm lookup. At the moment it keeps the informations about the new xfrm interface id needed to lookup xfrm interfaces that are introduced with a followup patch. We need this new lookup key as other possible keys, like the ifindex is already part of the xfrm selector and used as a key to enforce the output device after the transformation in the policy/state lookup.

Steffen Klassert committed 8 years ago

Commit d159ce71 parent 9b42c1f1 file · +9 −0Browse files

Unified · Split

include/net/flow.h+9−0
@@ -26,6 +26,10 @@ struct flowi_tunnel { · 25 unmodified lines
26 __be64 tun_id;26 __be64 tun_id;
27};27};
28 28
29struct flowi_xfrm {
30 __u32 if_id;
31};
32
29struct flowi_common {33struct flowi_common {
30 int flowic_oif;34 int flowic_oif;
31 int flowic_iif;35 int flowic_iif;
@@ -39,6 +43,7 @@ struct flowi_common { · 7 unmodified lines
39#define FLOWI_FLAG_SKIP_NH_OIF 0x0443#define FLOWI_FLAG_SKIP_NH_OIF 0x04
40 __u32 flowic_secid;44 __u32 flowic_secid;
41 struct flowi_tunnel flowic_tun_key;45 struct flowi_tunnel flowic_tun_key;
46 struct flowi_xfrm xfrm;
42 kuid_t flowic_uid;47 kuid_t flowic_uid;
43};48};
44 49
@@ -78,6 +83,7 @@ struct flowi4 { · 33 unmodified lines
78#define flowi4_secid __fl_common.flowic_secid83#define flowi4_secid __fl_common.flowic_secid
79#define flowi4_tun_key __fl_common.flowic_tun_key84#define flowi4_tun_key __fl_common.flowic_tun_key
80#define flowi4_uid __fl_common.flowic_uid85#define flowi4_uid __fl_common.flowic_uid
86#define flowi4_xfrm __fl_common.xfrm
81 87
82 /* (saddr,daddr) must be grouped, same order as in IP header */88 /* (saddr,daddr) must be grouped, same order as in IP header */
83 __be32 saddr;89 __be32 saddr;
@@ -109,6 +115,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif, · 25 unmodified lines
109 fl4->flowi4_flags = flags;115 fl4->flowi4_flags = flags;
110 fl4->flowi4_secid = 0;116 fl4->flowi4_secid = 0;
111 fl4->flowi4_tun_key.tun_id = 0;117 fl4->flowi4_tun_key.tun_id = 0;
118 fl4->flowi4_xfrm.if_id = 0;
112 fl4->flowi4_uid = uid;119 fl4->flowi4_uid = uid;
113 fl4->daddr = daddr;120 fl4->daddr = daddr;
114 fl4->saddr = saddr;121 fl4->saddr = saddr;
@@ -138,6 +145,7 @@ struct flowi6 { · 23 unmodified lines
138#define flowi6_secid __fl_common.flowic_secid145#define flowi6_secid __fl_common.flowic_secid
139#define flowi6_tun_key __fl_common.flowic_tun_key146#define flowi6_tun_key __fl_common.flowic_tun_key
140#define flowi6_uid __fl_common.flowic_uid147#define flowi6_uid __fl_common.flowic_uid
148#define flowi6_xfrm __fl_common.xfrm
141 struct in6_addr daddr;149 struct in6_addr daddr;
142 struct in6_addr saddr;150 struct in6_addr saddr;
143 /* Note: flowi6_tos is encoded in flowlabel, too. */151 /* Note: flowi6_tos is encoded in flowlabel, too. */
@@ -185,6 +193,7 @@ struct flowi { · 41 unmodified lines
185#define flowi_secid u.__fl_common.flowic_secid193#define flowi_secid u.__fl_common.flowic_secid
186#define flowi_tun_key u.__fl_common.flowic_tun_key194#define flowi_tun_key u.__fl_common.flowic_tun_key
187#define flowi_uid u.__fl_common.flowic_uid195#define flowi_uid u.__fl_common.flowic_uid
196#define flowi_xfrm u.__fl_common.xfrm
188} __attribute__((__aligned__(BITS_PER_LONG/8)));197} __attribute__((__aligned__(BITS_PER_LONG/8)));
189 198
190static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4)199static inline struct flowi *flowi4_to_flowi(struct flowi4 *fl4)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t