[2101] in linux-net channel archive
Re: New ppp code in 1.3.72 reveals bug in SOCK_PACKET code, patch included.
daemon@ATHENA.MIT.EDU (Alan Cox)
Thu Mar 14 21:52:06 1996
From: Alan Cox <alan@cymru.net>
To: schenk@rnode84.cs.toronto.edu (Eric Schenk)
Date: Thu, 14 Mar 1996 18:16:55 +0000 (GMT)
Cc: linux-net@vger.rutgers.edu, linux-kernel@vger.rutgers.edu, alan@cymru.net
In-Reply-To: <199603141717.MAA00528@rnode84.cs.toronto.edu> from "Eric Schenk" at Mar 14, 96 12:17:36 pm
> The following patch fixes the problem.
>
> --- CUT HERE --------------------------------------------------------------
> --- linux/net/ipv4/packet.c.orig Thu Mar 14 00:12:10 1996
> +++ linux/net/ipv4/packet.c Thu Mar 14 00:12:57 1996
> @@ -183,6 +183,7 @@
>
> skb->sk = sk;
> skb->free = 1;
> + skb->protocol = htons(ETH_P_IP);
> memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len);
> skb->arp = 1; /* No ARP needs doing on this (complete) frame */
>
That forces IP only. I'll change the sendto() to add a new sockaddr_packet
which is the same as the other one with an optional protocol field on the end
that will keep binary compatibility just fine and fix it properly.
Alan