Problematic port field in struct ip_service in Samba.
Jeremy Allison
jra at samba.org
Fri Jul 17 22:05:00 UTC 2020
On Fri, Jul 17, 2020 at 07:58:38AM +0200, Andreas Schneider wrote:
> 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
Good point. But I'll move to struct sockaddr_storage first
- I already have that working with my test async DNS
resolver code:
https://gitlab.com/samba-team/devel/samba/-/commits/WIP-jra-resolve_ads_test
as that's what most of the calling code expects.
We can then move to struct samba_sockaddr in stages after.
Don't want to boil the ocean today, just heat up some
small pots and pans full :-).
More information about the samba-technical
mailing list