|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
Is there a way I can pick UDP packets(data) through recvfrom call on a UDP socket, when the source IP address is 0.0.0.0 in the UDP packet. Right now, those packets are coming to my system(seen on tcpdump), but somehow not reaching the application. Thanks in advance. - Angshuman |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
In article <1161300294.819453.188430@b28g2000cwb.googlegroups .com>,
am.mukherjee@gmail.com wrote: > Hi, > > Is there a way I can pick UDP packets(data) through recvfrom call on a > UDP socket, when the source IP address is 0.0.0.0 in the UDP packet. > Right now, those packets are coming to my system(seen on tcpdump), but > somehow not reaching the application. Except in special cases like a DHCP client sending a broadcast before it has configured its IP address, 0.0.0.0 is not a valid source address. And RFC 1122 says that hosts must discard packets with invalid source addresses. To get around this, I think you may need to use a raw socket. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hello,
Barry Margolin a écrit : > am.mukherjee@gmail.com wrote: >> >>Is there a way I can pick UDP packets(data) through recvfrom call on a >>UDP socket, when the source IP address is 0.0.0.0 in the UDP packet. >>Right now, those packets are coming to my system(seen on tcpdump), but >>somehow not reaching the application. > > Except in special cases like a DHCP client sending a broadcast before it > has configured its IP address, 0.0.0.0 is not a valid source address. > And RFC 1122 says that hosts must discard packets with invalid source > addresses. > > To get around this, I think you may need to use a raw socket. That seems to be what the DHCP server dhcpd does. # netstat --inet -nlp Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name udp 0 0 0.0.0.0:67 0.0.0.0:* 629/dhcpd raw 0 0 0.0.0.0:1 0.0.0.0:* 7 629/dhcpd |
|
![]() |
| Outils de la discussion | |
|
|