Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-11 Thread Ed Schouten
* Oliver Fromme wrote: > If we push struct sockaddr to align(4), then we will also > have to do the same with all others that are not already > aligned to at least 4 bytes. That would be almost all of > them. Maybe it's better to just use __attribute__((aligned))? That makes it use the worst ali

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-11 Thread Dag-Erling Smørgrav
Oliver Fromme writes: > I did a small survey of all the sockaddr_ variants: I only did _in, _in6 and _un; who cares about the others? :P DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailma

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-11 Thread Oliver Fromme
Dag-Erling Smørgrav wrote: > "M. Warner Losh" writes: > > You'll find that a number of structures are potentially already > > allocated with less than required alignment. There's about a dozen > > places in the tree that would start to fail if we did this, or the > > stronger form of __align

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-11 Thread Dag-Erling Smørgrav
"M. Warner Losh" writes: > You'll find that a number of structures are potentially already > allocated with less than required alignment. There's about a dozen > places in the tree that would start to fail if we did this, or the > stronger form of __aligned(8). We could add that to the other > s

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Jilles Tjoelker
On Wed, Aug 11, 2010 at 07:05:53AM +1000, Bruce Evans wrote: > On Tue, 10 Aug 2010, M. Warner Losh wrote: > > > In message: <86sk2m1hsj@ds4.des.no> > >Dag-Erling Sm�rgrav writes: > > : "M. Warner Losh" writes: > > : > /* > > : > * Macros to cast a struct sockaddr, or parts there

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Bruce Evans
On Tue, 10 Aug 2010, M. Warner Losh wrote: In message: <86sk2m1hsj@ds4.des.no> Dag-Erling Sm?rgrav writes: : "M. Warner Losh" writes: : > /* : > * Macros to cast a struct sockaddr, or parts thereof. : > * On architectures with strict alignment requirements, the compiler : > *

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Dag-Erling Smørgrav
"M. Warner Losh" writes: > Dag-Erling Smørgrav writes: > > "M. Warner Losh" writes: > > > /* > > > * Macros to cast a struct sockaddr, or parts thereof. > > > * On architectures with strict alignment requirements, the compiler > > > * can bogusly warn about alignment problems since its static

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <201008101956.o7aju5ms044...@haluter.fromme.com> Oliver Fromme writes: : : M. Warner Losh wrote: : > /* : > * Macros to cast a struct sockaddr, or parts thereof. struct : > * sockaddr's alginment is loose to later be cast to a sockaddr_in or : > * sockaddr_in6. On

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Oliver Fromme
M. Warner Losh wrote: > /* > * Macros to cast a struct sockaddr, or parts thereof. struct > * sockaddr's alginment is loose to later be cast to a sockaddr_in or > * sockaddr_in6. On architectures with strict alignment requirements, > * this leads to compiler warnings because the compile

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <11606.1281464...@critter.freebsd.dk> "Poul-Henning Kamp" writes: : In message <20100810.115457.1126759349893144516@bsdimp.com>, "M. Warner Los : h" writes: : >In message: <20100811.023235.13138059@allbsd.org> : >Hiroki Sato writes: : >: Oliver Fromme

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Poul-Henning Kamp
In message <20100810.115457.1126759349893144516@bsdimp.com>, "M. Warner Los h" writes: >In message: <20100811.023235.13138059@allbsd.org> >Hiroki Sato writes: >: Oliver Fromme wrote >: in <201008101623.o7agns7i042...@haluter.fromme.com>: >: >: ol> -static int validate(

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <86sk2m1hsj@ds4.des.no> Dag-Erling Smørgrav writes: : "M. Warner Losh" writes: : > /* : > * Macros to cast a struct sockaddr, or parts thereof. : > * On architectures with strict alignment requirements, the compiler : > * can bogusly warn about alignment problems si

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <20100811.023235.13138059@allbsd.org> Hiroki Sato writes: : Oliver Fromme wrote : in <201008101623.o7agns7i042...@haluter.fromme.com>: : : ol> -static int validate(struct sockaddr *, const char *); : ol> -static void unmapped(struct sockaddr *); : ol> +st

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Dag-Erling Smørgrav
Hiroki Sato writes: > Why is s/struct sockaddr */struct sockaddr_storage */ needed here? Alignment. That's what this entire thread is about. DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/ma

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Dag-Erling Smørgrav
"M. Warner Losh" writes: > /* > * Macros to cast a struct sockaddr, or parts thereof. > * On architectures with strict alignment requirements, the compiler > * can bogusly warn about alignment problems since its static analysis > * is insufficient for it to know that with the APIs used, there

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <201008101623.o7agns7i042...@haluter.fromme.com> Oliver Fromme writes: : : M. Warner Losh wrote: : > In message: <201008101313.o7addhye040...@haluter.fromme.com> : > Oliver Fromme writes: : > : M. Warner Losh wrote: : > : > The casting that syslogd does w

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Hiroki Sato
Oliver Fromme wrote in <201008101623.o7agns7i042...@haluter.fromme.com>: ol> -static int validate(struct sockaddr *, const char *); ol> -static voidunmapped(struct sockaddr *); ol> +static int validate(struct sockaddr_storage *, const char *); ol> +static voidunmapped(struct soc

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Oliver Fromme
M. Warner Losh wrote: > In message: <201008101313.o7addhye040...@haluter.fromme.com> > Oliver Fromme writes: > : M. Warner Losh wrote: > : > The casting that syslogd does with struct sockaddrFOO is what triggers > : > it. I'm not sure how to fix it, so there's about 6 or 8 pro

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread M. Warner Losh
In message: <201008101313.o7addhye040...@haluter.fromme.com> Oliver Fromme writes: : M. Warner Losh wrote: : > The casting that syslogd does with struct sockaddrFOO is what triggers : > it. I'm not sure how to fix it, so there's about 6 or 8 programs in : > the tree that have WARNS

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Oliver Fromme
M. Warner Losh wrote: > The casting that syslogd does with struct sockaddrFOO is what triggers > it. I'm not sure how to fix it, so there's about 6 or 8 programs in > the tree that have WARNS lowered to 3 because of it. I've given it try, please see the patch below. This is not really pretty,

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-10 Thread Bruce Evans
On Mon, 9 Aug 2010, M. Warner Losh wrote: In message: <86tyn4tbuc@ds4.des.no> Dag-Erling Sm?rgrav writes: : Jilles Tjoelker writes: : > In other cases, I propose adding a cast to void * in between, like : > (struct sockaddr_in *)(void *)ai->ai_addr : : Better to cast through u

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-09 Thread Dag-Erling Smørgrav
"M. Warner Losh" writes: > I like the idea of a macro. Why is a cast through uintptr_t better? Without the uintptr_t cast, you'll get an error, or at least a warning, if the pointer is qualified (const and / or volatile). DES -- Dag-Erling Smørgrav - d...@des.no ___

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-09 Thread M. Warner Losh
In message: <86tyn4tbuc@ds4.des.no> Dag-Erling Smørgrav writes: : Jilles Tjoelker writes: : > In other cases, I propose adding a cast to void * in between, like : > (struct sockaddr_in *)(void *)ai->ai_addr : : Better to cast through uintptr_t. Perhaps we should have a : __DEC

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-09 Thread Dag-Erling Smørgrav
Jilles Tjoelker writes: > In other cases, I propose adding a cast to void * in between, like > (struct sockaddr_in *)(void *)ai->ai_addr Better to cast through uintptr_t. Perhaps we should have a __DECONST-like macro for this? #define __ALIGNED_CAST(t, v) ((t)(uintptr_t)(v)) DES -- Dag-Erli

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-09 Thread Bruce Evans
On Mon, 9 Aug 2010, Jilles Tjoelker wrote: On Sun, Aug 08, 2010 at 03:36:08PM -0600, M. Warner Losh wrote: The casting that syslogd does with struct sockaddrFOO is what triggers it. I'm not sure how to fix it, so there's about 6 or 8 programs in the tree that have WARNS lowered to 3 because

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread Jilles Tjoelker
On Sun, Aug 08, 2010 at 03:36:08PM -0600, M. Warner Losh wrote: > In message: <201008082037.o78kbldt022...@haluter.fromme.com> > Oliver Fromme writes: > : M. Warner Losh wrote: > : > In message: <201008071620.o77gkdbb091...@svn.freebsd.org> > : > Oliver Fromme writes: >

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread M. Warner Losh
In message: <201008082037.o78kbldt022...@haluter.fromme.com> Oliver Fromme writes: : : M. Warner Losh wrote: : > In message: <201008071620.o77gkdbb091...@svn.freebsd.org> : > Oliver Fromme writes: : > : Author: olli : > : Date: Sat Aug 7 16:20:12 2010 : > : New Revi

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-08 Thread Oliver Fromme
M. Warner Losh wrote: > In message: <201008071620.o77gkdbb091...@svn.freebsd.org> > Oliver Fromme writes: > : Author: olli > : Date: Sat Aug 7 16:20:12 2010 > : New Revision: 211023 > : URL: http://svn.freebsd.org/changeset/base/211023 > : Modified: head/usr.sbin/syslogd/Makef

Re: svn commit: r211023 - head/usr.sbin/syslogd

2010-08-07 Thread M. Warner Losh
In message: <201008071620.o77gkdbb091...@svn.freebsd.org> Oliver Fromme writes: : Author: olli : Date: Sat Aug 7 16:20:12 2010 : New Revision: 211023 : URL: http://svn.freebsd.org/changeset/base/211023 : Modified: head/usr.sbin/syslogd/Makefile : ==

svn commit: r211023 - head/usr.sbin/syslogd

2010-08-07 Thread Oliver Fromme
Author: olli Date: Sat Aug 7 16:20:12 2010 New Revision: 211023 URL: http://svn.freebsd.org/changeset/base/211023 Log: syslogd(8) already supports *sending* log messages to non- standard ports, but it can't *receive* them (port 514 is hardcoded). This commit adds that missing feature.