]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
As we're using skb_mac_header() functions which rely on the fact, that CAN
authorhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 31 Aug 2011 19:43:11 +0000 (19:43 +0000)
committerhartkopp <hartkopp@030b6a49-0b11-0410-94ab-b0dab22257f2>
Wed, 31 Aug 2011 19:43:11 +0000 (19:43 +0000)
netdevices do not use the header_ops, we should test if these header_ops are
really not in use.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@1267 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/net/can/gw.c

index 714985b22e7204a9e19598c4c5b90f8e43c2b83c..f09c75a65efcaa408aa9b6b0ce7cca02406bee8b 100644 (file)
@@ -824,6 +824,9 @@ static int cgw_create_job(struct sk_buff *skb,  struct nlmsghdr *nlh,
        if (gwj->src.dev->type != ARPHRD_CAN)
                goto put_src_out;
 
+       if (gwj->src.dev->header_ops)
+               goto put_src_out;
+
        gwj->dst.dev = dev_get_by_index(&init_net, gwj->ccgw.dst_idx);
 
        if (!gwj->dst.dev)
@@ -832,6 +835,9 @@ static int cgw_create_job(struct sk_buff *skb,  struct nlmsghdr *nlh,
        if (gwj->dst.dev->type != ARPHRD_CAN)
                goto put_src_dst_out;
                
+       if (gwj->dst.dev->header_ops)
+               goto put_src_dst_out;
+               
        ASSERT_RTNL();
 
        err = cgw_register_filter(gwj);