aboutsummaryrefslogtreecommitdiffstats
path: root/net/can/raw.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-01-28 00:19:34 -0500
committerDavid S. Miller <davem@davemloft.net>2013-01-28 00:19:34 -0500
commit61550022b9586972082904b80de26a464c558437 (patch)
tree590c21eed5f723162d3821a398b6d3831f75a488 /net/can/raw.c
parent0e36cbb344575e481167e090f0926701f83207d6 (diff)
parente6afa00a1409bc3bceed9ccb33111519463dfe7b (diff)
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
Marc Kleine-Budde says: ==================== this is a pull-request for net-next/master. There is are 9 patches by Fabio Baltieri and Kurt Van Dijck which add LED infrastructure and support for CAN devices. Bernd Krumboeck adds a driver for the USB CAN adapter from 8 devices. Oliver Hartkopp improves the CAN gateway functionality. There are 4 patches by me, which clean up the CAN's Kconfig. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/raw.c')
-rw-r--r--net/can/raw.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/can/raw.c b/net/can/raw.c
index 5b0e3e330d97..5d860e8dcc52 100644
--- a/net/can/raw.c
+++ b/net/can/raw.c
@@ -50,6 +50,7 @@
50#include <linux/skbuff.h> 50#include <linux/skbuff.h>
51#include <linux/can.h> 51#include <linux/can.h>
52#include <linux/can/core.h> 52#include <linux/can/core.h>
53#include <linux/can/skb.h>
53#include <linux/can/raw.h> 54#include <linux/can/raw.h>
54#include <net/sock.h> 55#include <net/sock.h>
55#include <net/net_namespace.h> 56#include <net/net_namespace.h>
@@ -699,11 +700,14 @@ static int raw_sendmsg(struct kiocb *iocb, struct socket *sock,
699 if (!dev) 700 if (!dev)
700 return -ENXIO; 701 return -ENXIO;
701 702
702 skb = sock_alloc_send_skb(sk, size, msg->msg_flags & MSG_DONTWAIT, 703 skb = sock_alloc_send_skb(sk, size + sizeof(struct can_skb_priv),
703 &err); 704 msg->msg_flags & MSG_DONTWAIT, &err);
704 if (!skb) 705 if (!skb)
705 goto put_dev; 706 goto put_dev;
706 707
708 skb_reserve(skb, sizeof(struct can_skb_priv));
709 ((struct can_skb_priv *)(skb->head))->ifindex = dev->ifindex;
710
707 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size); 711 err = memcpy_fromiovec(skb_put(skb, size), msg->msg_iov, size);
708 if (err < 0) 712 if (err < 0)
709 goto free_skb; 713 goto free_skb;