CIDR notation bug (round 3?) (Re: CVS update: samba/source/lib)

Andrew Bird Andrew.Bird at goodrich.com
Fri Apr 25 08:40:35 GMT 2003


Guys
    I think that Tomokis fix is correct since the interpret_addr()
called for deriving /netmask notation already returns the mask in
network order. So with the fix in 1.37 the /network mask is converted
twice.

>         if (strlen(slash + 1) > 2) {
>                mask = interpret_addr(slash + 1);
>         } else {
>-               mask = (uint32)((ALLONES >> atoi(slash + 1)) ^
ALLONES);
>+               mask = htonl((uint32) ((ALLONES >> atoi(slash + 1)) ^
ALLONES));
 >        }


Best Regards


Andrew Bird(Unix Consultant)




> But I think location of htonl() in recent commit (1.37
> etc.) is wrong. (ex. 192.168.0.0/255.255.255.0 may not
> match host 192.168.0.1 on some platforms (including x86).)
> I found similar code in interpret_interface() in
> lib/interface.c , so (more) correct fix is:

> I hope this is the last fix on this area ...
----
> Tomoki AONO     (aono at cc.osaka-kyoiku.ac.jp)





More information about the samba-technical mailing list