From 716a926ef485602d3e5aafd93ed5893d1eca39b6 Mon Sep 17 00:00:00 2001 From: David Gibson Date: Fri, 6 Jan 2023 11:43:14 +1100 Subject: util: Parameterize ethernet header initializer macro We have separate IPv4 and IPv6 versions of a macro to construct an initializer for ethernet headers. However, now that we have htons_constant it's easy to simply paramterize this with the ethernet protocol number. Signed-off-by: David Gibson Signed-off-by: Stefano Brivio --- udp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'udp.c') diff --git a/udp.c b/udp.c index fb3f790..4549316 100644 --- a/udp.c +++ b/udp.c @@ -329,7 +329,7 @@ static void udp_sock4_iov_init(const struct ctx *c) for (i = 0; i < ARRAY_SIZE(udp4_l2_buf); i++) { udp4_l2_buf[i] = (struct udp4_l2_buf_t) { - .eh = L2_BUF_ETH_IP4_INIT, + .eh = L2_BUF_ETH_INIT(ETH_P_IP), .iph = L2_BUF_IP4_INIT(IPPROTO_UDP) }; } @@ -370,7 +370,7 @@ static void udp_sock6_iov_init(const struct ctx *c) for (i = 0; i < ARRAY_SIZE(udp6_l2_buf); i++) { udp6_l2_buf[i] = (struct udp6_l2_buf_t) { - .eh = L2_BUF_ETH_IP6_INIT, + .eh = L2_BUF_ETH_INIT(ETH_P_IPV6), .ip6h = L2_BUF_IP6_INIT(IPPROTO_UDP) }; } -- cgit v1.2.3