[PATCH] struct sockaddr_storage: Rename internal members
Carlos O'Donell
carlos@redhat.com
Fri Sep 1 16:40:00 GMT 2017
On 09/01/2017 11:16 AM, Florian Weimer wrote:
> In commit 3375cfafa7961c6ae0e509c31c3b3cef9ad1f03d (Make padding in
> struct sockaddr_storage explicit), the offsets of the members
> changed. Some broken applications use these members to find
> the start of the address data in struct sockaddr_in or
> struct sockaddr_in6, and the change meant that they silently ended
> up with an incorrect offset. Changing the struct member names
> triggers a compilation failure, hopefully leading to a complete fix.
>
> 2017-09-01 Florian Weimer <fweimer@redhat.com>
>
> * bits/socket.h (struct sockaddr_storage): Rename __ss_padding to
> __ss_padding_reserved and __ss_align to __ss_align_reserved.
> * sysdeps/mach/hurd/bits/socket.h (struct sockaddr_storage): Likewise.
> * sysdeps/unix/sysv/linux/bits/socket.h
> (struct sockaddr_storage): Likewise.
> * inet/tst-sockaddr.c (do_test): Adjust.
We've been consistently using __glibc_reserved* prefix for this kind of thing,
but perhaps __glibc_reserved_ss_align and __glibc_reserved_ss_aligntype are
too long?
I like that using __glibc_reserved_* clearly indicates who reserved it, and
that it is reserved like all other instances of __glibc_reserved_* should never
clash with other reserved named in other operating systems.
The patch looks good. I'm just bike shedding on the name.
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list