From nobody Wed Feb 15 22:24:58 2023 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PHCLj4PQcz3rQRq for ; Wed, 15 Feb 2023 22:25:01 +0000 (UTC) (envelope-from possessor.assizer305@aceecat.org) Received: from beesty.loosely.org (beesty.loosely.org [IPv6:2600:3c01:e000:4c0::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4PHCLh6HXlz3jSQ for ; Wed, 15 Feb 2023 22:25:00 +0000 (UTC) (envelope-from possessor.assizer305@aceecat.org) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=aceecat.org header.s=rsa header.b=M8x+rUtT; spf=pass (mx1.freebsd.org: domain of possessor.assizer305@aceecat.org designates 2600:3c01:e000:4c0::2 as permitted sender) smtp.mailfrom=possessor.assizer305@aceecat.org; dmarc=none DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aceecat.org ; s=rsa; h=Sender:In-Reply-To:Content-Type:MIME-Version:References:Message-ID :Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=pE9mQS4swMalyTrKybfgyfCUwuGujHrUHMxghdjPl+U=; b=M8x+rUtTpWDaAw/+PcFmgTf3rH YbyVDvJEcbi6f/en0plosl+YJaCXWUF/Bh+t543EjqWXvbVUXNtBHHiu0IRF+47kTVg0PxrGVb0Vj He29QuOXAuS2Xdmu64Q/OdDA0m7lIuSRPm2I7WClanYKHx/VYLmn3RUlmw6mnx/3RawxpJsgEFSFn 4wP9nIc0NDUl6jfZjZt4gPPoLHwuab/06Qbm+urd3o5fdO2M/IvxrV5WB0/0+X11s1BHdt/NByvo4 hL7T8JP+GduqB1RplhHnXN6n2Z8ct8jmVa7vzEp1pX7XnYhNrQhhkAM+Usk/UCn2CO3SnM0dJVdV2 v0frRsaA==; Received: from [::1] (helo=beesty) by beesty.loosely.org with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.96-20-303f59ccb) (envelope-from ) id 1pSQCw-000O0O-1a for freebsd-questions@freebsd.org; Wed, 15 Feb 2023 14:24:58 -0800 Date: Wed, 15 Feb 2023 14:24:58 -0800 From: Ian Zimmerman To: freebsd-questions@freebsd.org Subject: Re: Source IP selection Message-ID: <20230215222458.bij5oh3wtaq6inje@beesty.loosely.org> Mail-Followup-To: freebsd-questions@freebsd.org References: <20230215174535.jlxuis3xwhxee3bq@beesty.loosely.org> <20230215214519.C9CC199766DF@ary.qy> List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230215214519.C9CC199766DF@ary.qy> Sender: itz@aceecat.org X-Spamd-Result: default: False [-3.24 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.95)[-0.952]; NEURAL_HAM_MEDIUM(-0.79)[-0.789]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[aceecat.org:s=rsa]; MIME_GOOD(-0.10)[text/plain]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; DKIM_TRACE(0.00)[aceecat.org:+]; ASN(0.00)[asn:63949, ipnet:2600:3c01::/32, country:SG]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[aceecat.org]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4PHCLh6HXlz3jSQ X-Spamd-Bar: --- X-ThisMailContainsUnwantedMimeParts: N On Wed, Feb 15, 2023 at 04:45:19PM -0500, John Levine wrote: > >how is the source IP address selected for an unbound socket, if there > >are multiple addresses (ie. aliases) configured on the outgoing > >interface? I am interested in particular in the UDP case, ie. > >the sendto() syscall. > >This is almost the question at the following link but ... not about > >THAT kernel but FreeBSD. > > > >https://stackoverflow.com/questions/63955841/how-does-tcp-ip-select-a-source-ip-address > > Same answer, use bind() if you want to bind to a specific address. Let me ask a little more specifically then :) May the kernel choose an address through which there's no route to the destination? -- Ian