From 3b18de779e60d140c8bec0887c055699a7f2aee2 Mon Sep 17 00:00:00 2001 From: hartkopp Date: Wed, 31 Aug 2011 19:43:11 +0000 Subject: [PATCH] As we're using skb_mac_header() functions which rely on the fact, that CAN 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/kernel/2.6/net/can/gw.c b/kernel/2.6/net/can/gw.c index 714985b..f09c75a 100644 --- a/kernel/2.6/net/can/gw.c +++ b/kernel/2.6/net/can/gw.c @@ -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); -- 2.39.2