Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 11 May 2021 13:40:44 +0200
From:      "Patrick M. Hausen" <hausen@punkt.de>
To:        Peter Jeremy <peter@rulingia.com>
Cc:        freebsd-net@freebsd.org
Subject:   Re: sender source IP address on UDP socket bound to INADDR_ANY in golang
Message-ID:  <846FFF4A-0D81-4F04-8358-1B14F996C0A2@punkt.de>
In-Reply-To: <YJpenW9tB7LzlyS9@server.rulingia.com>
References:  <2B26D5AB-0F77-4E36-AD9A-D7D6CE5F173C@punkt.de> <YJpenW9tB7LzlyS9@server.rulingia.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail=_D570B725-284C-47E1-9CFE-A86D10271DD7
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hi!

> Am 11.05.2021 um 12:38 schrieb Peter Jeremy <peter@rulingia.com>:
>=20
> On 2021-May-08 19:05:56 +0200, "Patrick M. Hausen" <hausen@punkt.de> =
wrote:
>> I am facing a problem that is perfectly explained by the semantics
>> of the socket interface for UDP, if one assumes that the application
>> in question binds to INADDR_ANY and does not specifically set the
>> sender address when sending datagrams.
> ...
>> Their code in question is here:
>> =
https://github.com/AdguardTeam/dnsproxy/blob/1163404e605c3dfbeab360fc3540f=
c290f61a321/proxyutil/udp_unix.go#L47
>=20
> So, they say that they retrieve "the net interface IP the packet was
> sent to (dst addr) from the socket's OOB data" and I agree that's what
> the referenced code does.  I hadn't heard of that behaviour before and
> went digging...

Thank you. I received some code with internal debugging added from the
AdGuard core team and will try that today or tomorrow. If I read the =
quote
from the documentation correctly, on possible explanation would be them
calling recvmsg() but forgetting to setsockopt()?

Kind regards,
Patrick
--
punkt.de GmbH
Patrick M. Hausen
.infrastructure

Kaiserallee 13a
76133 Karlsruhe

Tel. +49 721 9109500

https://infrastructure.punkt.de
info@punkt.de

AG Mannheim 108285
Gesch=C3=A4ftsf=C3=BChrer: J=C3=BCrgen Egeling, Daniel Lienert, Fabian =
Stein


--Apple-Mail=_D570B725-284C-47E1-9CFE-A86D10271DD7
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename=signature.asc
Content-Type: application/pgp-signature;
	name=signature.asc
Content-Description: Message signed with OpenPGP

-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEgzqrjO/mj9CSsTg2kG8u4u3aiVwFAmCabTwACgkQkG8u4u3a
iVziTwf/QUvq7YXWreIzK7uO486J3pk/pjWqazNAsfioPcIECJEq0O3s8PY7H8Wy
GcP0IzS4gi5AdHEo8PE02yqB1DZxnTL1yjL7kpOIi4pssE4fEBMmrPa6bR9604nb
dF80d1bq9PxiUaZeh9wUTksxfntnnnhOSOBADXBqvjR/2G0jZyQNKT0k7QWNIQi2
ReLhsUBKmk3TDdFY29RVGx5RqonQmjVgynSZSScdVFxOBCW6iCXvydk8elf9xKnG
O0fIcneXQjJSRQ3i6OqDl8j77DvySvlgMgrqk6cKPtgwjUtSy6x1kbEepiZ6yBQN
b1pRadbFAmp+5ok0Yjdrdb3nN7VFEA==
=xU/M
-----END PGP SIGNATURE-----

--Apple-Mail=_D570B725-284C-47E1-9CFE-A86D10271DD7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?846FFF4A-0D81-4F04-8358-1B14F996C0A2>