[SCM] Samba Shared Repository - branch master updated
Jeremy Allison
jra at samba.org
Fri Apr 18 11:06:04 MDT 2014
On Thu, Apr 17, 2014 at 03:23:13PM -0400, Simo wrote:
> On Thu, 2014-04-17 at 19:57 +0200, Günther Deschner wrote:
> > +static bool ads_try_connect(ADS_STRUCT *ads, bool gc,
> > + struct sockaddr_storage *ss)
> > {
>
> FWIW, I think that you should pass around struct sockaddr *, and not
> struct socakddr_storage *.
> sockaddr_storage is an artifact used to make sure enough space for any
> of the available sockaddr types when a sockaddr is allocated, but should
> not be used as a pointer type to pass around, when you want to pass
> around an unqualified socket addres then 'struct sockaddr *' is the
> right one I think. Or even const struct sockaddr *, if you do not intend
> to touch it in the called function.
Yeah but using struct sockaddr_storage *ss here does make
the patch smaller (as it was already using that internal
to the function). I'm OK with Günther's change here, if
we want to tidy that up we should do it with a further
patch on top which tidies up more things.
Just my 2cents :-).
Jeremy.
More information about the samba-technical
mailing list