Skip to main content
GameDev.net gamedev.net
🔒 Locked

Cannot receive UDP broadcasts

Started by tomva Feb 2, 2010 at 12:24 AM 3 replies 1.9k views
Original Post
tomva
tomva
Hello all- Apologies, this is a really basic problem, but I've been banging my head against the wall for over an hour and haven't been able to figure this out, or found any Internet searches to shed light. On a single local host, I am broadcasting UDP packets from one process, and receiving them from another. This all worked fine on Fedora 10. I've just upgraded to Fedora 12, and now I can't receive the UDP broadcasts. Running tcpdump, I can see the bytes being sent from the broadcasting process! But the receiver can't see them. If I send to the UDP port directly instead of broadcasting, then the listener gets the datagram. I've disabled SELinux, but that hasn't made a difference. Is there another firewall running anywhere that may be blocking reception of UDP broadcasts? Anything else I can do to debug the problem? I don't see anything in /var/log/messages. Thanks for any pointers! -Thomas
frob
frob
Google says there were some issues where the subnet mask would be reset, effectively causing all broadcasts to be dropped.

Check that with ifconfig and make sure your connection's mask is correct.



Also, IIRC there are configuration options that will cause the INADDR_BROADCAST address (255.255.255.255) to be dropped as well.
tomva
tomva

Good idea! I checked the netmask, and it seems to be okay (192.168.0.255, which is correct for my network). I'm not doing any global broadcasting.

I'll keep playing with it. I may just revert to Fedora 10 for now, since this isn't really something I want to debug. It doesn't sound like a common problem or mistake in any case.
frob
frob
Quote:
Original post by tomva

Good idea! I checked the netmask, and it seems to be okay (192.168.0.255, which is correct for my network).
It is not correct if you want to broadcast to your network.

Try the netmask of 255.255.255.0, which will allow you to broadcast to the peers inside your class C network.
tomva
tomva

Sorry, you're right: I was looking at the broadcast address and not the netmask.

The netmask was set correctly 255.255.255.0

I found my problem: tweaking SELinux wasn't doing anything. I believe the firewall is modeled as a layer below SELinux.

Instead of running

 % system-config-selinux 


I had to run

 % system-config-firewall 


and open the ports from there.

Worked fine!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.