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
2626 __be64 tun_id;
2727 };
2828
29+struct flowi_xfrm {
30+ __u32 if_id;
31+};
32+
2933 struct flowi_common {
3034 int flowic_oif;
3135 int flowic_iif;
@@ -39,6 +43,7 @@ struct flowi_common { · 7 unmodified lines
3943 #define FLOWI_FLAG_SKIP_NH_OIF 0x04
4044 __u32 flowic_secid;
4145 struct flowi_tunnel flowic_tun_key;
46+ struct flowi_xfrm xfrm;
4247 kuid_t flowic_uid;
4348 };
4449
@@ -78,6 +83,7 @@ struct flowi4 { · 33 unmodified lines
7883 #define flowi4_secid __fl_common.flowic_secid
7984 #define flowi4_tun_key __fl_common.flowic_tun_key
8085 #define flowi4_uid __fl_common.flowic_uid
86+#define flowi4_xfrm __fl_common.xfrm
8187
8288 /* (saddr,daddr) must be grouped, same order as in IP header */
8389 __be32 saddr;
@@ -109,6 +115,7 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif, · 25 unmodified lines
109115 fl4->flowi4_flags = flags;
110116 fl4->flowi4_secid = 0;
111117 fl4->flowi4_tun_key.tun_id = 0;
118+ fl4->flowi4_xfrm.if_id = 0;
112119 fl4->flowi4_uid = uid;
113120 fl4->daddr = daddr;
114121 fl4->saddr = saddr;
@@ -138,6 +145,7 @@ struct flowi6 { · 23 unmodified lines
138145 #define flowi6_secid __fl_common.flowic_secid
139146 #define flowi6_tun_key __fl_common.flowic_tun_key
140147 #define flowi6_uid __fl_common.flowic_uid
148+#define flowi6_xfrm __fl_common.xfrm
141149 struct in6_addr daddr;
142150 struct in6_addr saddr;
143151 /* Note: flowi6_tos is encoded in flowlabel, too. */
@@ -185,6 +193,7 @@ struct flowi { · 41 unmodified lines
185193 #define flowi_secid u.__fl_common.flowic_secid
186194 #define flowi_tun_key u.__fl_common.flowic_tun_key
187195 #define flowi_uid u.__fl_common.flowic_uid
196+#define flowi_xfrm u.__fl_common.xfrm
188197 } __attribute__((__aligned__(BITS_PER_LONG/8)));
189198
190199 static 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