nss-clients: GRE: Fix building on kernels < 6.10

Signed-off-by: Sean Khan <datapronix@protonmail.com>
This commit is contained in:
Sean Khan 2025-05-30 05:25:17 -04:00
parent 6b2d99511c
commit 589db1c9c8
2 changed files with 25 additions and 13 deletions

View File

@ -170,14 +170,17 @@
t->dev = dev; t->dev = dev;
return GRE_SUCCESS; return GRE_SUCCESS;
} }
@@ -322,8 +330,8 @@ int nss_connmgr_gre_v4_get_config(struct @@ -322,8 +330,13 @@ int nss_connmgr_gre_v4_get_config(struct
memcpy(cmsg->src_ip, &src_ip, 4); memcpy(cmsg->src_ip, &src_ip, 4);
memcpy(cmsg->dest_ip, &dest_ip, 4); memcpy(cmsg->dest_ip, &dest_ip, 4);
- cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags, +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
- t->parms.i_flags, cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags,
t->parms.i_flags,
+#else
+ cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags, + cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags,
+ *t->parms.i_flags, + *t->parms.i_flags,
+#endif
iphdr->tos, iphdr->ttl, iphdr->tos, iphdr->ttl,
iphdr->frag_off); iphdr->frag_off);
@ -797,14 +800,17 @@
t->dev = dev; t->dev = dev;
return GRE_SUCCESS; return GRE_SUCCESS;
} }
@@ -359,8 +359,8 @@ int nss_connmgr_gre_v6_get_config(struct @@ -359,8 +359,13 @@ int nss_connmgr_gre_v6_get_config(struct
/* /*
* IPv6 outer tos field is always inherited from inner IP header. * IPv6 outer tos field is always inherited from inner IP header.
*/ */
- cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags, +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
- t->parms.i_flags, cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags,
t->parms.i_flags,
+#else
+ cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags, + cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags,
+ *t->parms.i_flags, + *t->parms.i_flags,
+#endif
t->parms.flowinfo, t->parms.flowinfo,
t->parms.hop_limit, 0); t->parms.hop_limit, 0);

View File

@ -158,7 +158,7 @@
if (IS_ERR(rt)) { if (IS_ERR(rt)) {
nss_connmgr_gre_warning("route look up failed for %pI4\n", &raddr); nss_connmgr_gre_warning("route look up failed for %pI4\n", &raddr);
return GRE_ERR_RADDR_ROUTE_LOOKUP; return GRE_ERR_RADDR_ROUTE_LOOKUP;
@@ -208,9 +216,9 @@ int nss_connmgr_gre_v4_set_config(struct @@ -216,9 +224,9 @@ int nss_connmgr_gre_v4_set_config(struct
t->parms.o_key = cfg->okey; t->parms.o_key = cfg->okey;
} }
@ -170,14 +170,17 @@
t->dev = dev; t->dev = dev;
return GRE_SUCCESS; return GRE_SUCCESS;
} }
@@ -322,8 +330,8 @@ int nss_connmgr_gre_v4_get_config(struct @@ -330,8 +338,13 @@ int nss_connmgr_gre_v4_get_config(struct
memcpy(cmsg->src_ip, &src_ip, 4); memcpy(cmsg->src_ip, &src_ip, 4);
memcpy(cmsg->dest_ip, &dest_ip, 4); memcpy(cmsg->dest_ip, &dest_ip, 4);
- cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags, +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
- t->parms.i_flags, cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags,
t->parms.i_flags,
+#else
+ cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags, + cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags,
+ *t->parms.i_flags, + *t->parms.i_flags,
+#endif
iphdr->tos, iphdr->ttl, iphdr->tos, iphdr->ttl,
iphdr->frag_off); iphdr->frag_off);
@ -797,14 +800,17 @@
t->dev = dev; t->dev = dev;
return GRE_SUCCESS; return GRE_SUCCESS;
} }
@@ -359,8 +359,8 @@ int nss_connmgr_gre_v6_get_config(struct @@ -359,8 +359,13 @@ int nss_connmgr_gre_v6_get_config(struct
/* /*
* IPv6 outer tos field is always inherited from inner IP header. * IPv6 outer tos field is always inherited from inner IP header.
*/ */
- cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags, +#if LINUX_VERSION_CODE <= KERNEL_VERSION(6, 10, 0)
- t->parms.i_flags, cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(t->parms.o_flags,
t->parms.i_flags,
+#else
+ cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags, + cmsg->flags |= nss_connmgr_gre_get_nss_config_flags(*t->parms.o_flags,
+ *t->parms.i_flags, + *t->parms.i_flags,
+#endif
t->parms.flowinfo, t->parms.flowinfo,
t->parms.hop_limit, 0); t->parms.hop_limit, 0);