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