Hi All,

I have a question on the function ip_addr_isbroadcast():

Why do we check for destination address even before we've determined
if the network interface supports broadcast or not? Shouldn't that be
the first check?

<snip>
...
  /* all ones (broadcast) or all zeroes (old skool broadcast) */
  if ((~addr2test == IP_ADDR_ANY_VALUE) ||
      (addr2test == IP_ADDR_ANY_VALUE))
    return 1;
  /* no broadcast support on this network interface? */
  else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) <===
    /* the given address cannot be a broadcast address
     * nor can we check against any broadcast addresses */
    return 0;
...
</snip>

Regards,
-mandeep


_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to