In article <[EMAIL PROTECTED]> (at Tue, 25 Jul 2006 10:45:51 -0400 (EDT)), 
James Morris <[EMAIL PROTECTED]> says:

> The recvmsg() for raw socket seems to return random u16 value
> from the kernel stack memory since port field is not initialized.
> But I'm not sure this patch is correct.
> Does raw socket return any information stored in port field?
> 
> ---------- Start of patch ----------
> diff -ur before/net/ipv4/raw.c after/net/ipv4/raw.c
> --- before/net/ipv4/raw.c       2006-06-18 10:49:35.000000000 +0900
> +++ after/net/ipv4/raw.c        2006-07-25 16:15:26.000000000 +0900
> @@ -609,6 +609,7 @@
>         if (sin) {
>                 sin->sin_family = AF_INET;
>                 sin->sin_addr.s_addr = skb->nh.iph->saddr;
> +               sin->sin_port = 0;
>                 memset(&sin->sin_zero, 0, sizeof(sin->sin_zero));
>         }
>         if (inet->cmsg_flags)

Well, instead, should it be initalized to protocol number, shouldn't it?

--yoshfuji
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to