kascemadness.blogg.se

255 255 255 255
255 255 255 255




255 255 255 255
  1. #255 255 255 255 code#
  2. #255 255 255 255 plus#

Anybody see something that I'm missing? I can broadcast to 192.168.100.255, but that won't make it to the box I need to talk to, which for example might be at 192.168.200.10, 255.255.255.0 by default. I tried disabling the firewall: sudo iptables -Fīut that didn't do anything. And I can confirm that the number of TX packets shown in ifconfig doesn't increment.

255 255 255 255

Then if I set my IP statically to say, 192.168.100.1, I get: Sent msg: Hello World!, -1 bytes with socket 3 to 255.255.255.255Īnd I don't see the packet in Wireshark. If I'm using DHCP, the output is: Sent msg: Hello World!, 12 bytes with socket 3 to 255.255.255.255Īnd I can see the packet go out in Wireshark. Printf("Sent msg: %s, %d bytes with socket %d to %s\n", msg, nBytes, sock, ip) Size_t nBytes = sendto(sock, msg, strlen(msg), 0, If( setsockopt(sock, SOL_SOCKET, SO_BROADCAST, &broadcast, sizeof(broadcast)) != 0 ) If( (sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) = -1)

#255 255 255 255 code#

So basically this example code WORKS on Fedora 19 in a test environment (on a larger network where I have DHCP enabled), until I try to statically set my IP address: int main(int argc, char *argv)

#255 255 255 255 plus#

There is no router on the network, just a simple switch between my machine and the box I'm trying to talk to, plus a couple other Linux machines on the network. But, I can't seem to broadcast off my own subnet unless I'm using DHCP, which ultimately I won't be able to do. I need to send a broadcast packet to a piece of hardware which, when it powers up, is on a different subnet than my machine, in order to tell it to reset its IP address to one that's on my network. First time poster, hopefully this is an easy one:






255 255 255 255