lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Bug in ip_addr.c concerning Broadcast.


From: jack W
Subject: Re: [lwip-users] Bug in ip_addr.c concerning Broadcast.
Date: Sat, 20 Nov 2004 09:04:25 +0800

 hi  Rodney Brown

 i think that  the ip addr 123.123.123.63 is not invalid ip addr to the netmask 
255.255.255.192.

        



>I believe I've found a bug in ipp_addr.c and wanted some confirmation before
>fixing it.
>
>Snippet from ip_addr_isbroadcast(struct ip_addr *addr, struct netif *netif)
>.
>.
>  /* host identifier bits are all ones? => network broadcast address */
>  else if ((addr->addr & ~netif->netmask.addr) ==
>           (ip_addr_broadcast.addr & ~netif->netmask.addr))
>    return 1;
>
>
>addr is the destination. netif is the device's information. If the
>destination IP is 123.123.123.63, and the local subnet is 255.255.255.192,
>the routine will return true, no matter what subnet the address is on.
>
>Should the code read:  ??
>
>  else if (((addr->addr & ~netif->netmask.addr) ==
>            (ip_addr_broadcast.addr & ~netif->netmask.addr)) &&
>            ((addr->addr & netif->netmask.addr) == 
>               (netif->ip_addr.addr & netif->netmask.addr)))
>
>    return 1;
>
>This checks to be sure the device and destination are on the same subnet,
>and that the last address on that subnet is the destination.
>
>Thanks,
>Rodney
>
>
>
>_______________________________________________
>lwip-users mailing list
>address@hidden
>http://lists.nongnu.org/mailman/listinfo/lwip-users

= = = = = = = = = = = = = = = = = = = =
                        






reply via email to

[Prev in Thread] Current Thread [Next in Thread]