PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > recvfrom, source address 0.0.0.0
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

recvfrom, source address 0.0.0.0

Réponse
 
LinkBack Outils de la discussion
Vieux 20/10/2006, 00h24   #1
am.mukherjee@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut recvfrom, source address 0.0.0.0

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

  Réponse avec citation
Vieux 20/10/2006, 02h54   #2
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: recvfrom, source address 0.0.0.0

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 ***
  Réponse avec citation
Vieux 20/10/2006, 12h01   #3
Pascal Hambourg
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: recvfrom, source address 0.0.0.0

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
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 12h22.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,07496 seconds with 11 queries