lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] ip_addr_isbroadcast processing


From: Mandeep Sandhu
Subject: [lwip-users] ip_addr_isbroadcast processing
Date: Mon, 7 Sep 2009 18:05:54 +0530

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




reply via email to

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