hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/include/net/flow.h
....@@ -38,8 +38,9 @@
3838 #define FLOWI_FLAG_KNOWN_NH 0x02
3939 #define FLOWI_FLAG_SKIP_NH_OIF 0x04
4040 __u32 flowic_secid;
41
- struct flowi_tunnel flowic_tun_key;
4241 kuid_t flowic_uid;
42
+ struct flowi_tunnel flowic_tun_key;
43
+ __u32 flowic_multipath_hash;
4344 };
4445
4546 union flowi_uli {
....@@ -78,6 +79,7 @@
7879 #define flowi4_secid __fl_common.flowic_secid
7980 #define flowi4_tun_key __fl_common.flowic_tun_key
8081 #define flowi4_uid __fl_common.flowic_uid
82
+#define flowi4_multipath_hash __fl_common.flowic_multipath_hash
8183
8284 /* (saddr,daddr) must be grouped, same order as in IP header */
8385 __be32 saddr;
....@@ -114,6 +116,7 @@
114116 fl4->saddr = saddr;
115117 fl4->fl4_dport = dport;
116118 fl4->fl4_sport = sport;
119
+ fl4->flowi4_multipath_hash = 0;
117120 }
118121
119122 /* Reset some input parameters after previous lookup */
....@@ -192,32 +195,24 @@
192195 return container_of(fl4, struct flowi, u.ip4);
193196 }
194197
198
+static inline struct flowi_common *flowi4_to_flowi_common(struct flowi4 *fl4)
199
+{
200
+ return &(flowi4_to_flowi(fl4)->u.__fl_common);
201
+}
202
+
195203 static inline struct flowi *flowi6_to_flowi(struct flowi6 *fl6)
196204 {
197205 return container_of(fl6, struct flowi, u.ip6);
198206 }
199207
208
+static inline struct flowi_common *flowi6_to_flowi_common(struct flowi6 *fl6)
209
+{
210
+ return &(flowi6_to_flowi(fl6)->u.__fl_common);
211
+}
212
+
200213 static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn)
201214 {
202215 return container_of(fldn, struct flowi, u.dn);
203
-}
204
-
205
-typedef unsigned long flow_compare_t;
206
-
207
-static inline unsigned int flow_key_size(u16 family)
208
-{
209
- switch (family) {
210
- case AF_INET:
211
- BUILD_BUG_ON(sizeof(struct flowi4) % sizeof(flow_compare_t));
212
- return sizeof(struct flowi4) / sizeof(flow_compare_t);
213
- case AF_INET6:
214
- BUILD_BUG_ON(sizeof(struct flowi6) % sizeof(flow_compare_t));
215
- return sizeof(struct flowi6) / sizeof(flow_compare_t);
216
- case AF_DECnet:
217
- BUILD_BUG_ON(sizeof(struct flowidn) % sizeof(flow_compare_t));
218
- return sizeof(struct flowidn) / sizeof(flow_compare_t);
219
- }
220
- return 0;
221216 }
222217
223218 __u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys);