summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDenys Fedoryshchenko <denys.f@collabora.com>2025-11-23 17:06:54 +0200
committerDenys Fedoryshchenko <denys.f@collabora.com>2025-11-23 17:09:37 +0200
commitff59c850184f807dae78d588ab3b864b0ad70300 (patch)
tree2e966f8a76ad9feeaf5fef896c5779cda42ed2fd /drivers
parent7f4da5fff2368080e41732945977bed0b8128f31 (diff)
downloadaccel-ppp-ff59c850184f807dae78d588ab3b864b0ad70300.tar.gz
accel-ppp-ff59c850184f807dae78d588ab3b864b0ad70300.zip
ipoe: Fix flowi4_tos build error on Fedora 6.18
Part of a long-term kernel networking cleanup is the kernel is moving to a strict type called dscp_t. 1)Macros like flowi4_tos are being removed to break compilation of old drivers (like accel-ppp) that treat the field as a raw byte. 2)This forces developers to use the new accessor functions (like ip4_dst_hoplimit or inet_dscp_to_dsfield) ensuring ECN bits are preserved. We need to maintain compatibility with older kernel as well. Signed-off-by: Denys Fedoryshchenko <denys.f@collabora.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/ipoe/ipoe.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/ipoe/ipoe.c b/drivers/ipoe/ipoe.c
index 14b6416a..4050011f 100644
--- a/drivers/ipoe/ipoe.c
+++ b/drivers/ipoe/ipoe.c
@@ -26,6 +26,9 @@
#include <net/ip.h>
#include <net/icmp.h>
#include <net/flow.h>
+#ifdef flowi4_dscp
+#include <net/inet_dscp.h>
+#endif
#include <net/xfrm.h>
#include <net/net_namespace.h>
#include <net/netns/generic.h>
@@ -58,6 +61,15 @@
#define RHEL_MAJOR 0
#endif
+static inline void ipoe_flowi4_set_tos(struct flowi4 *fl4, __u8 dsfield)
+{
+#ifdef flowi4_dscp
+ fl4->flowi4_dscp = inet_dsfield_to_dscp(dsfield);
+#else
+ fl4->flowi4_tos = dsfield;
+#endif
+}
+
struct ipoe_stats {
struct u64_stats_sync sync;
u64 packets;
@@ -263,7 +275,7 @@ static int check_nat_required(struct sk_buff *skb, struct net_device *link)
memset(&fl4, 0, sizeof(fl4));
fl4.daddr = iph->daddr;
- fl4.flowi4_tos = RT_TOS(0);
+ ipoe_flowi4_set_tos(&fl4, RT_TOS(0));
fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
rt = ip_route_output_key(net, &fl4);
if (IS_ERR(rt))
@@ -771,7 +783,7 @@ static struct ipoe_session *ipoe_lookup_rt4(struct sk_buff *skb, __be32 addr, st
memset(&fl4, 0, sizeof(fl4));
fl4.daddr = addr;
- fl4.flowi4_tos = RT_TOS(0);
+ ipoe_flowi4_set_tos(&fl4, RT_TOS(0));
fl4.flowi4_scope = RT_SCOPE_UNIVERSE;
rt = ip_route_output_key(net, &fl4);
if (IS_ERR(rt))