Re: recvfrom and sockaddr_in.sin_port

2001-07-08 Thread Adam

> isn't it set? to quote from the example I have attached:
>   socklen_t fromlen = sizeof(struct sockaddr_in);
> sorry, I misread the source (the memset line)
> you are using raw sockets, what does port mean for raw sockets?

well, from raw(7) man page:

   raw_socket = socket(PF_INET, SOCK_RAW, int protocol);
   [...]
   All packets [...] matching the protocol number  speci
   fied  for the raw socket are passed to this socket.

so it seem to imply that only tcp packets only are to be passed.
still group "SOCK_RAW" is subset of the PF_INET group (the way
I see it), so from ip(7) man page I should use sockaddr_in
structure, which should be defined in this particular case,
as it ought be for IPPROTO_UDP.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: recvfrom and sockaddr_in.sin_port

2001-07-08 Thread Adam

>   I have attached a simple program I used for generating those
>   results.
>
> 'fromlen' needs to be set to sizeof 'from' before the recvfrom syscall

isn't it set? to quote from the example I have attached:

  socklen_t fromlen = sizeof(struct sockaddr_in);



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: recvfrom and sockaddr_in.sin_port

2001-07-08 Thread Adam

   I have attached a simple program I used for generating those
   results.

 'fromlen' needs to be set to sizeof 'from' before the recvfrom syscall

isn't it set? to quote from the example I have attached:

  socklen_t fromlen = sizeof(struct sockaddr_in);



-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/



Re: recvfrom and sockaddr_in.sin_port

2001-07-08 Thread Adam

 isn't it set? to quote from the example I have attached:
   socklen_t fromlen = sizeof(struct sockaddr_in);
 sorry, I misread the source (the memset line)
 you are using raw sockets, what does port mean for raw sockets?

well, from raw(7) man page:

   raw_socket = socket(PF_INET, SOCK_RAW, int protocol);
   [...]
   All packets [...] matching the protocol number  speci
   fied  for the raw socket are passed to this socket.

so it seem to imply that only tcp packets only are to be passed.
still group SOCK_RAW is subset of the PF_INET group (the way
I see it), so from ip(7) man page I should use sockaddr_in
structure, which should be defined in this particular case,
as it ought be for IPPROTO_UDP.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/