Problematic port field in struct ip_service in Samba.

Andreas Schneider asn at samba.org
Fri Jul 17 05:58:38 UTC 2020


On Friday, 17 July 2020 00:26:00 CEST Jeremy Allison via samba-team wrote:
> Hi Team & all interested parties,

Hi Jeremy,

> Eventually I'd like to replace all
> uses of struct ip_service -> struct sockaddr_storage,
> but that's a bigger cleanup for another
> day.. :-).

we actually should replace this with `struct samba_sockaddr`
to avoid strict aliasing issues!

See lib/util/util_net.h for `struct samba_sockaddr`

and

https://git.samba.org/?p=asn/samba.git;a=shortlog;h=refs/heads/master-strict-aliasing

I've just recently had to fix a crash on arm in nss_wrapper which was caused 
by not following strict aliasing rules:

https://gitlab.com/cwrap/nss_wrapper/-/commit/
6ec14bb96f0e0447132472910657569f1188149b


Best regards,


	Andreas


-- 
Andreas Schneider                      asn at samba.org
Samba Team                             www.samba.org
GPG-ID:     8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D





More information about the samba-technical mailing list