Can we send a Broadcast Packet via RAW Socket ?? I am unable to send it as "sendto" is returning err-101(Network Unreachable). I already Enabled the Broadcast Socket Option and IPHDR_INCL Options. Any Suggestions ??
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.
- Brian W. Kernighan
Thanks S_M_A for the link. That's informational.I am following all the Rules mentioned in the link. Socket type was DGRAM & Machine is having Valid IP Address & I am filling the IPHEADER with that IP Address and also enabled BROADCAST Option & IPHDR_INCL Options. Destination address was also filled up as "BROADCAST" Address & trying to send the packet via "sendto". Still; no Luck for me .Please let me know ; if U want me to send the code ?
Finally able to send the Broadcast via RAW Socket. Actual issue is not with Code. It is with System not having Default Gateway. Another Query was; How can I send the VLAN Information to application via RAW Sockets ?? Kernel is removing the 4 bytes VLAN Information and sending the remaining Ether/IP/UDP information. VLAN ID is not going to application.
Bookmarks