From 2b5e0d8b6ad0f0901e29d70a6324f225a5bb6dd4 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Wed, 16 Sep 2020 21:58:52 +0200 Subject: [PATCH] MEDIUM: proto_udp: replace last AF_CUST_UDP* with AF_INET* We don't need to cheat with the sock_domain anymore, we now always have the SOCK_DGRAM sock_type as a complementary selector. This patch restores the sock_domain to AF_INET* in the udp* protocols and removes all traces of the now unused AF_CUST_*. --- include/haproxy/protocol-t.h | 4 +--- src/proto_udp.c | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/haproxy/protocol-t.h b/include/haproxy/protocol-t.h index f74a2e1a6c..2c5b66227c 100644 --- a/include/haproxy/protocol-t.h +++ b/include/haproxy/protocol-t.h @@ -39,9 +39,7 @@ struct connection; */ #define AF_CUST_EXISTING_FD (AF_MAX + 1) #define AF_CUST_SOCKPAIR (AF_MAX + 2) -#define AF_CUST_UDP4 (AF_MAX + 3) -#define AF_CUST_UDP6 (AF_MAX + 4) -#define AF_CUST_MAX (AF_MAX + 5) +#define AF_CUST_MAX (AF_MAX + 3) /* * Test in case AF_CUST_MAX overflows the sa_family_t (unsigned int) diff --git a/src/proto_udp.c b/src/proto_udp.c index 74408b4ec7..2333b5d9ee 100644 --- a/src/proto_udp.c +++ b/src/proto_udp.c @@ -1,5 +1,5 @@ /* - * AF_CUST_UDP/AF_CUST_UDP6 UDP protocol layer + * UDP protocol layer on top of AF_INET/AF_INET6 * * Copyright 2019 HAProxy Technologies, Frédéric Lécaille * @@ -49,7 +49,7 @@ static struct protocol proto_udp4 = { .name = "udp4", .fam = &proto_fam_inet4, .ctrl_type = SOCK_DGRAM, - .sock_domain = AF_CUST_UDP4, + .sock_domain = AF_INET, .sock_type = SOCK_DGRAM, .sock_prot = IPPROTO_UDP, .accept = NULL, @@ -69,7 +69,7 @@ static struct protocol proto_udp6 = { .name = "udp6", .fam = &proto_fam_inet6, .ctrl_type = SOCK_DGRAM, - .sock_domain = AF_CUST_UDP6, + .sock_domain = AF_INET6, .sock_type = SOCK_DGRAM, .sock_prot = IPPROTO_UDP, .accept = NULL, -- 2.39.5