At 6:13 PM -0700 2002/04/30, Guy Harris wrote:

>  They have type "struct in_addr", which means that the code in question
>  *SHOULD* be
>
>      if (pcap_lookupnet(iname, &(interf.net.s_addr),
>                                    &(interf.netmask.s_addr), errbuf) < 0) {
>
>  Change it to that, see if it eliminates that warning, and, if so, send
>  that change back to the maintainers of xprobe.

        I tried this change, and it doesn't work -- same results from 
xprobe.  I don't get the warning during compilation, but the 
behaviour of xprobe is unchanged.

>  I have no idea why "uint32_t" doesn't match "bpf_u_int32" as a type;
>  perhaps this is something like one of them being "int" and the other
>  being "long" (they're both 32 bits on MacOS X, but they're not the
>  *same* type, and have *different* sizes on other platforms).

        It is an issue of mixing int and long, as you figured and I 
previously discovered independently.  However, I also tried the code 
by replacing their uint32_t with bpf_u_int32 and compiling, and while 
that doesn't complain either, it also doesn't change the behaviour of 
xprobe.  Indeed, I also tried the bpf_u_int32 for uint32_t 
substitution along with your ".s_addr" substitution, and that didn't 
generate an error during compile, nor did it change the behaviour of 
xprobe.

        Of the three combinations, which would you suggest?  Remove the 
cast and add the .s_addr, change the cast and leave the rest along, 
or change the cast and add the .s_addr as well?


        It would be nice to be able to contribute back to the xprobe 
project, as well as hopefully getting a step closer to getting a 
proper libpcap (and tcpdump) built and installed on this machine.

-- 
Brad Knowles, <[EMAIL PROTECTED]>

"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
     -Benjamin Franklin, Historical Review of Pennsylvania.
-
This is the TCPDUMP workers list. It is archived at
http://www.tcpdump.org/lists/workers/index.html
To unsubscribe use mailto:[EMAIL PROTECTED]?body=unsubscribe

Reply via email to