From: Lennert Buytenhek Date: Mon, 25 May 2015 12:38:24 +0000 (+0300) Subject: ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c032705ebfed32a6dcda72d83c54f060d4bf1e6e;p=linux-beck.git ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big. The proper return code for trying to send a packet that exceeds the outgoing interface's MTU is EMSGSIZE, not EINVAL, so patch ieee802154's raw_sendmsg() to do the right thing. (Its dgram_sendmsg() was already returning EMSGSIZE for this case.) Signed-off-by: Lennert Buytenhek Acked-by: Alexander Aring Signed-off-by: Marcel Holtmann --- diff --git a/net/ieee802154/socket.c b/net/ieee802154/socket.c index e5cc2537c2a3..d9fc5ccb1d0d 100644 --- a/net/ieee802154/socket.c +++ b/net/ieee802154/socket.c @@ -284,7 +284,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) if (size > mtu) { pr_debug("size = %Zu, mtu = %u\n", size, mtu); - err = -EINVAL; + err = -EMSGSIZE; goto out_dev; }