Date: Tue, 10 Aug 2010 18:15:44 +0000 From: "Poul-Henning Kamp" <phk@phk.freebsd.dk> To: "M. Warner Losh" <imp@bsdimp.com> Cc: src-committers@FreeBSD.org, jilles@stack.nl, svn-src-all@FreeBSD.org, hrs@FreeBSD.org, olli@fromme.com, olli@FreeBSD.org, svn-src-head@FreeBSD.org, des@des.no Subject: Re: svn commit: r211023 - head/usr.sbin/syslogd Message-ID: <11606.1281464144@critter.freebsd.dk> In-Reply-To: Your message of "Tue, 10 Aug 2010 11:54:57 CST." <20100810.115457.1126759349893144516.imp@bsdimp.com>
next in thread | previous in thread | raw e-mail | index | archive | help
In message <20100810.115457.1126759349893144516.imp@bsdimp.com>, "M. Warner Los h" writes: >In message: <20100811.023235.13138059.hrs@allbsd.org> > Hiroki Sato <hrs@FreeBSD.org> writes: >: Oliver Fromme <olli@fromme.com> wrote >: in <201008101623.o7AGNs7I042679@haluter.fromme.com>: >: >: ol> -static int validate(struct sockaddr *, const char *); >: ol> -static void unmapped(struct sockaddr *); >: ol> +static int validate(struct sockaddr_storage *, const char *); >: ol> +static void unmapped(struct sockaddr_storage *); >: >: Why is s/struct sockaddr */struct sockaddr_storage */ needed here? >: Using (struct sockaddr *) as an argument looks reasonable to me since >: the struct sockaddr_storage is mostly for memory allocation, not for >: access via pointer. > >Because struct sockaddr * has a too loose alignment requirement for >later casting, while sockaddr_storage has the proper alignment. This is the kind of detail Bruce, Warner and I know, but I bet it was news to most of you. Somebody should add it to the relevant manualpages... -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?11606.1281464144>