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 688155A0277 for ; Tue, 16 Jan 2024 06:16:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1705382181; bh=vSEwXrbFmXFO/tCdLY+vExmhezWevkBGh/jdJqtG/YE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ED3d6IsjE+J1mOoxURKfm/S0yvYM7t8B+Gi+durvz3OV5xcGmDDkvrgFFCrqVF4Hm KOMoinabxMiJyqi5c+0xBy9qvO3BjV1r1bkz7z2u+sfKCJHt6WSa/NlMZNRp+VZGMY yhfQ+lsXNSRjBZUvP2Kue3zNHoEO6F/Ujcr5LxPyTW3wW6TSW1DGWoKQlbA8fDdqBK dCg08o7RuMzM8th3UH1JM5k30D35ocEFjYwzNyPOWb8qJ4Xoi1Z05PWuPoYcSe14/l 7MoBw4PVVwHiHPzG2leawD0PFgDJlWSfQyREpImbW5AuVqeq+1Go4A6tZvVlNpAQQ1 w20a8/2HwnEqg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4TDcg90SQLz4wyS; Tue, 16 Jan 2024 16:16:21 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH v3 02/11] icmp: Remove redundant initialisation of sendto() address Date: Tue, 16 Jan 2024 16:16:09 +1100 Message-ID: <20240116051618.2746103-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240116051618.2746103-1-david@gibson.dropbear.id.au> References: <20240116051618.2746103-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: AFRHXJPKVOJSLKG7AMVBPUZACB4EP5C7 X-Message-ID-Hash: AFRHXJPKVOJSLKG7AMVBPUZACB4EP5C7 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.8 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 initialise the address portion of the sockaddr for sendto() to the unspecified address, but then always overwrite it with the actual destination address before we call the sendto(). Signed-off-by: David Gibson --- icmp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/icmp.c b/icmp.c index ca039f0..ed1a3d9 100644 --- a/icmp.c +++ b/icmp.c @@ -169,7 +169,6 @@ int icmp_tap_handler(const struct ctx *c, uint8_t pif, int af, if (af == AF_INET) { struct sockaddr_in sa = { .sin_family = AF_INET, - .sin_addr = IN4ADDR_ANY_INIT, }; union icmp_epoll_ref iref; const struct icmphdr *ih; @@ -213,7 +212,6 @@ int icmp_tap_handler(const struct ctx *c, uint8_t pif, int af, } else if (af == AF_INET6) { struct sockaddr_in6 sa = { .sin6_family = AF_INET6, - .sin6_addr = IN6ADDR_ANY_INIT, .sin6_scope_id = c->ifi6, }; union icmp_epoll_ref iref; -- 2.43.0