-
Notifications
You must be signed in to change notification settings - Fork 455
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong MAC when sending broadcast #59
Comments
Committed, thanks. |
Hi there! First post so: thanks a lot for the work, I'm using this lib for a while now! Best one IMO :-) I was actually using the following hack to cope with this issue, because I want to send the packets to the network broadcast IP, not full broadcast (i.e. 192.168.1.255) : if ((dip[0] & 0xF0) == 0xE0 || dip[3] == 0xFF) Thanks! |
Indeed, works as well. But I thought the partial broadcast was not Le 01/11/2012 20:54, RaphYot a écrit :
|
You are welcome. Le 01/11/2012 10:19, Jean-Claude Wippler a écrit :
|
I can send broadcast packet that way without issue. The only problem I see is that it's just a partial solution as without the mask you don't know the real broadcast address. What kind of issue do you mean? With the new lib it seems I'm not receiving my network broadcast anymore on the arduino (although I enabled broadcast), but it was working on an older project so I suppose this should be feasible. |
I'd be happy to change it to a single-byte check, and just make 255.255.255.0 the default netmask that way. Ought to work for msot cases. |
I am having problem with sendUdp() and I traced the problem to this line Does anyone know what the problem is? |
I'm try use sendTcp() and doesn't work, but if comment the line proposed for shagru, then works OK. |
The problem @shagru has might be related to the multicast check (I don't know) but @jnogues makes no sense, those lines are unrelated to sendTcp() I also have the problem that UDP broadcast has a mac of 0x00000000, and the proposed fix doesn't work for me because I do
Would the fix be more correct if the check was for ether.broadcastip?
? |
Hello,
When sending a broadcast packet (255.255.255.255) the recipient MAC remains to 00:00:00:00:00:00. If not wrong, it should be also set to the broadcast MAC (as for the WOL packets for instance).
I made the following fix in tcpip.cpp, function EtherCard::udpPrepare:
replaced
if ((dip[0] & 0xF0) == 0xE0) // multicast address
by
if ((dip[0] & 0xF0) == 0xE0 || *((long *) dip) == 0xFFFFFFFF) // multicast or broadcast address
Seems to work.
Rgds,
L.
The text was updated successfully, but these errors were encountered: