From c4f52f22c7e5366ecd27ac5d495f1ba1a90e3df9 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jun 2023 12:26:17 +0000 Subject: [PATCH] Revert "net: Remove DECnet leftovers from flow.h." This reverts commit bf82668eb950e3ca977b5f92bcb1a756db5563dc which is commit 9bc61c04ff6cce6a3756b86e6b34914f7b39d734 upstream. It is removing unused code, but that changes a structure size so revert it for now to preserve the ABI. Bug: 161946584 Change-Id: I237cda2e5c07440d25613a1a1e30fa499751c7ac Signed-off-by: Greg Kroah-Hartman --- include/net/flow.h | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/net/flow.h b/include/net/flow.h index 236d0941c69f..39d0cedcddee 100644 --- a/include/net/flow.h +++ b/include/net/flow.h @@ -54,6 +54,11 @@ union flowi_uli { __u8 code; } icmpt; + struct { + __le16 dport; + __le16 sport; + } dnports; + __be32 spi; __be32 gre_key; @@ -151,11 +156,27 @@ struct flowi6 { __u32 mp_hash; } __attribute__((__aligned__(BITS_PER_LONG/8))); +struct flowidn { + struct flowi_common __fl_common; +#define flowidn_oif __fl_common.flowic_oif +#define flowidn_iif __fl_common.flowic_iif +#define flowidn_mark __fl_common.flowic_mark +#define flowidn_scope __fl_common.flowic_scope +#define flowidn_proto __fl_common.flowic_proto +#define flowidn_flags __fl_common.flowic_flags + __le16 daddr; + __le16 saddr; + union flowi_uli uli; +#define fld_sport uli.ports.sport +#define fld_dport uli.ports.dport +} __attribute__((__aligned__(BITS_PER_LONG/8))); + struct flowi { union { struct flowi_common __fl_common; struct flowi4 ip4; struct flowi6 ip6; + struct flowidn dn; } u; #define flowi_oif u.__fl_common.flowic_oif #define flowi_iif u.__fl_common.flowic_iif @@ -189,6 +210,11 @@ static inline struct flowi_common *flowi6_to_flowi_common(struct flowi6 *fl6) return &(flowi6_to_flowi(fl6)->u.__fl_common); } +static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn) +{ + return container_of(fldn, struct flowi, u.dn); +} + __u32 __get_hash_from_flowi6(const struct flowi6 *fl6, struct flow_keys *keys); #endif