提交 c032705e 编写于 作者: L Lennert Buytenhek 提交者: Marcel Holtmann

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: NLennert Buytenhek <buytenh@wantstofly.org>
Acked-by: NAlexander Aring <alex.aring@gmail.com>
Signed-off-by: NMarcel Holtmann <marcel@holtmann.org>
上级 e34fd879
...@@ -284,7 +284,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) ...@@ -284,7 +284,7 @@ static int raw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
if (size > mtu) { if (size > mtu) {
pr_debug("size = %Zu, mtu = %u\n", size, mtu); pr_debug("size = %Zu, mtu = %u\n", size, mtu);
err = -EINVAL; err = -EMSGSIZE;
goto out_dev; goto out_dev;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册