git: f2582653a429 - main - ip: use standard C types for ECN helper functions
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 21 Nov 2025 08:02:07 UTC
The branch main has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=f2582653a429a7c8d55b023c6f5a006f5d51ea34
commit f2582653a429a7c8d55b023c6f5a006f5d51ea34
Author: Seyed Pouria Mousavizadeh Tehrani <p.mousavizadeh@protonmail.com>
AuthorDate: 2025-11-21 07:58:12 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2025-11-21 07:58:12 +0000
ip: use standard C types for ECN helper functions
No functional change intended, suggested by glebius.
Reviewed by: rscheff, zlei, tuexen
Differential Revision: https://reviews.freebsd.org/D53739
---
sys/netinet/ip_ecn.c | 16 ++++++++--------
sys/netinet/ip_ecn.h | 4 ++--
sys/netinet6/ip6_ecn.h | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/sys/netinet/ip_ecn.c b/sys/netinet/ip_ecn.c
index 30d2c95ddbd7..2f700c43bbfa 100644
--- a/sys/netinet/ip_ecn.c
+++ b/sys/netinet/ip_ecn.c
@@ -92,7 +92,7 @@
* modify outer ECN (TOS) field on ingress operation (tunnel encapsulation).
*/
void
-ip_ecn_ingress(int mode, u_int8_t *outer, const u_int8_t *inner)
+ip_ecn_ingress(int mode, uint8_t *outer, const uint8_t *inner)
{
if (!outer || !inner)
@@ -124,7 +124,7 @@ ip_ecn_ingress(int mode, u_int8_t *outer, const u_int8_t *inner)
* the caller should drop the packet if the return value is 0.
*/
int
-ip_ecn_egress(int mode, const u_int8_t *outer, u_int8_t *inner)
+ip_ecn_egress(int mode, const uint8_t *outer, uint8_t *inner)
{
if (!outer || !inner)
@@ -158,9 +158,9 @@ ip_ecn_egress(int mode, const u_int8_t *outer, u_int8_t *inner)
#ifdef INET6
void
-ip6_ecn_ingress(int mode, u_int32_t *outer, const u_int32_t *inner)
+ip6_ecn_ingress(int mode, uint32_t *outer, const uint32_t *inner)
{
- u_int8_t outer8, inner8;
+ uint8_t outer8, inner8;
if (!outer || !inner)
panic("NULL pointer passed to ip6_ecn_ingress");
@@ -168,13 +168,13 @@ ip6_ecn_ingress(int mode, u_int32_t *outer, const u_int32_t *inner)
inner8 = (ntohl(*inner) >> 20) & 0xff;
ip_ecn_ingress(mode, &outer8, &inner8);
*outer &= ~htonl(0xff << 20);
- *outer |= htonl((u_int32_t)outer8 << 20);
+ *outer |= htonl((uint32_t)outer8 << 20);
}
int
-ip6_ecn_egress(int mode, const u_int32_t *outer, u_int32_t *inner)
+ip6_ecn_egress(int mode, const uint32_t *outer, uint32_t *inner)
{
- u_int8_t outer8, inner8, oinner8;
+ uint8_t outer8, inner8, oinner8;
if (!outer || !inner)
panic("NULL pointer passed to ip6_ecn_egress");
@@ -185,7 +185,7 @@ ip6_ecn_egress(int mode, const u_int32_t *outer, u_int32_t *inner)
return (0);
if (inner8 != oinner8) {
*inner &= ~htonl(0xff << 20);
- *inner |= htonl((u_int32_t)inner8 << 20);
+ *inner |= htonl((uint32_t)inner8 << 20);
}
return (1);
}
diff --git a/sys/netinet/ip_ecn.h b/sys/netinet/ip_ecn.h
index 7390d812606f..6632418fc9ca 100644
--- a/sys/netinet/ip_ecn.h
+++ b/sys/netinet/ip_ecn.h
@@ -44,7 +44,7 @@
#define ECN_NOCARE (-1) /* no consideration to ECN */
#ifdef _KERNEL
-extern void ip_ecn_ingress(int, u_int8_t *, const u_int8_t *);
-extern int ip_ecn_egress(int, const u_int8_t *, u_int8_t *);
+extern void ip_ecn_ingress(int, uint8_t *, const uint8_t *);
+extern int ip_ecn_egress(int, const uint8_t *, uint8_t *);
#endif
#endif
diff --git a/sys/netinet6/ip6_ecn.h b/sys/netinet6/ip6_ecn.h
index 45a28e9f419a..169e027dc265 100644
--- a/sys/netinet6/ip6_ecn.h
+++ b/sys/netinet6/ip6_ecn.h
@@ -37,6 +37,6 @@
*/
#ifdef _KERNEL
-extern void ip6_ecn_ingress(int, u_int32_t *, const u_int32_t *);
-extern int ip6_ecn_egress(int, const u_int32_t *, u_int32_t *);
+extern void ip6_ecn_ingress(int, uint32_t *, const uint32_t *);
+extern int ip6_ecn_egress(int, const uint32_t *, uint32_t *);
#endif