Date: Tue, 23 Nov 2021 22:10:10 -0500 From: Jan Schaumann via freebsd-net <freebsd-net@freebsd.org> To: freebsd-net@freebsd.org Subject: Re: bind() to ::1 fails with EADDRNOTAVAIL / clang vs gcc Message-ID: <20211124031010.GB11277@netmeister.org> In-Reply-To: <YZ2pOWNVMp3dCs6p@kib.kiev.ua> References: <20211124020839.GZ11277@netmeister.org> <YZ2pOWNVMp3dCs6p@kib.kiev.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov <kostikbel@gmail.com> wrote: > On Tue, Nov 23, 2021 at 09:08:39PM -0500, Jan Schaumann via freebsd-net wrote: > > - Why does _any_ of those fail? > > - Why does a.c succeed when compiled with clang, but > > b.c does not? > Most likely because you did not fully initialized *sin. > Really it is UB, try to memset(sin, 0, sizeof(*sin)). Nice, that works. Thanks! -Jan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20211124031010.GB11277>