Skip to content

Commit

Permalink
ieee802154 socket: Return EMSGSIZE from raw_sendmsg() if packet too big.
Browse files Browse the repository at this point in the history
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 <buytenh@wantstofly.org>
Acked-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Lennert Buytenhek authored and Marcel Holtmann committed May 26, 2015
1 parent e34fd87 commit c032705
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ieee802154/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit c032705

Please sign in to comment.