Skip to content

Commit

Permalink
change in udpPrepare, as suggested in issue #59
Browse files Browse the repository at this point in the history
  • Loading branch information
jcw committed Nov 1, 2012
1 parent 38ce251 commit 49affe0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tcpip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ byte EtherCard::ntpProcessAnswer (uint32_t *time,byte dstport_l) {
void EtherCard::udpPrepare (word sport, byte *dip, word dport) {
setMACandIPs(gwmacaddr, dip);
// see http://tldp.org/HOWTO/Multicast-HOWTO-2.html
if ((dip[0] & 0xF0) == 0xE0) // multicast address
// multicast or broadcast address, https://github.com/jcw/ethercard/issues/59
if ((dip[0] & 0xF0) == 0xE0 || *((long*) dip) == 0xFFFFFFFF)
EtherCard::copyMac(gPB + ETH_DST_MAC, allOnes);
gPB[ETH_TYPE_H_P] = ETHTYPE_IP_H_V;
gPB[ETH_TYPE_L_P] = ETHTYPE_IP_L_V;
Expand Down

0 comments on commit 49affe0

Please sign in to comment.