]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Set skb->protocol on CAN frames sent from can_send().
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Mon, 4 Jun 2007 20:30:56 +0000 (20:30 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Mon, 4 Jun 2007 20:30:56 +0000 (20:30 +0000)
git-svn-id: svn://svn.berlios.de//socketcan/trunk@326 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/af_can.c

index 115e696ed41920fb7b4b6bb0f4239e87dec6e90c..2acca1a9d967e6dce1c6913c54af1fbd157533c5 100644 (file)
@@ -265,6 +265,8 @@ int can_send(struct sk_buff *skb, int loop)
                return -EPERM;
        }
 
+       skb->protocol = htons(ETH_P_CAN);
+
        if (loop) {
                /* local loopback of sent CAN frames (default) */
 
@@ -282,7 +284,6 @@ int can_send(struct sk_buff *skb, int loop)
                        struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
 
                        /* perform the local loopback here */
-                       newskb->protocol  = htons(ETH_P_CAN);
                        newskb->ip_summed = CHECKSUM_UNNECESSARY;
                        netif_rx(newskb);
                }