From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id CF5275A0270 for ; Tue, 22 Nov 2022 04:44:09 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4NGVVX0v8Cz4xN6; Tue, 22 Nov 2022 14:44:04 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1669088644; bh=2X2s5kfVA6wrGLlXvRUbZB+IJV+Lpojs4E2WjclZwE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MmpeHV9nYp85j7tE5Xh9QUFe7r5Z8bF/+f99vjz7YFIV7RDlLRrftxybpAEggtxxm vfB8tY+fQbkJjy3cGloCDtnWT6fyjrdJubNw5F7wqAZH0CXHjLe2Sbvr/Vi9cYLFdk HyvElUillMR/Ra1Nqt158QLX66QWxXuGtyTYxLoo= From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 05/11] udp: Remove the @bound field from union udp_epoll_ref Date: Tue, 22 Nov 2022 14:43:56 +1100 Message-Id: <20221122034402.1517544-6-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221122034402.1517544-1-david@gibson.dropbear.id.au> References: <20221122034402.1517544-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 4PTDHD5BQN6A2QPTFQMF2OFZE6HU6AH3 X-Message-ID-Hash: 4PTDHD5BQN6A2QPTFQMF2OFZE6HU6AH3 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.3 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We set this field, but nothing ever checked it. Signed-off-by: David Gibson --- udp.c | 8 +++----- udp.h | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/udp.c b/udp.c index ed095ec..2c5e4e9 100644 --- a/udp.c +++ b/udp.c @@ -952,8 +952,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr, sl = sizeof(s_in); if (!(s = udp_tap_map[V4][src].sock)) { - union udp_epoll_ref uref = { .udp.bound = 1, - .udp.port = src }; + union udp_epoll_ref uref = { .udp.port = src }; s = sock_l4(c, AF_INET, IPPROTO_UDP, NULL, NULL, src, uref.u32); @@ -1005,8 +1004,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr, } if (!(s = udp_tap_map[V6][src].sock)) { - union udp_epoll_ref uref = { .udp.bound = 1, - .udp.v6 = 1, + union udp_epoll_ref uref = { .udp.v6 = 1, .udp.port = src }; s = sock_l4(c, AF_INET6, IPPROTO_UDP, bind_addr, NULL, @@ -1069,7 +1067,7 @@ int udp_tap_handler(struct ctx *c, int af, const void *addr, void udp_sock_init(const struct ctx *c, int ns, sa_family_t af, const void *addr, const char *ifname, in_port_t port) { - union udp_epoll_ref uref = { .udp.bound = 1 }; + union udp_epoll_ref uref = { .u32 = 0 }; const void *bind_addr; int s; diff --git a/udp.h b/udp.h index 2ac8610..43bd28a 100644 --- a/udp.h +++ b/udp.h @@ -29,8 +29,7 @@ void udp_update_l2_buf(const unsigned char *eth_d, const unsigned char *eth_s, */ union udp_epoll_ref { struct { - uint32_t bound:1, - splice:3, + uint32_t splice:3, #define UDP_TO_NS 1 #define UDP_TO_INIT 2 #define UDP_BACK_TO_NS 3 -- 2.38.1