Re: New ppp code in 1.3.72 reveals bug in SOCK_PACKET code, patch included.

Alan Cox (alan@cymru.net)
Thu, 14 Mar 1996 18:16:55 +0000 (GMT)


> 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