diff options
-rw-r--r-- | net/ax25/af_ax25.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c index fd9d06f291dc..7da5ebb84e97 100644 --- a/net/ax25/af_ax25.c +++ b/net/ax25/af_ax25.c | |||
@@ -1435,6 +1435,11 @@ static int ax25_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1435 | size_t size; | 1435 | size_t size; |
1436 | int lv, err, addr_len = msg->msg_namelen; | 1436 | int lv, err, addr_len = msg->msg_namelen; |
1437 | 1437 | ||
1438 | /* AX.25 empty data frame has no meaning : don't send */ | ||
1439 | if (len == 0) { | ||
1440 | return (0); | ||
1441 | } | ||
1442 | |||
1438 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) | 1443 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) |
1439 | return -EINVAL; | 1444 | return -EINVAL; |
1440 | 1445 | ||
@@ -1634,6 +1639,13 @@ static int ax25_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1634 | skb_reset_transport_header(skb); | 1639 | skb_reset_transport_header(skb); |
1635 | copied = skb->len; | 1640 | copied = skb->len; |
1636 | 1641 | ||
1642 | /* AX.25 empty data frame has no meaning : ignore it */ | ||
1643 | if (copied == 0) { | ||
1644 | err = copied; | ||
1645 | skb_free_datagram(sk, skb); | ||
1646 | goto out; | ||
1647 | } | ||
1648 | |||
1637 | if (copied > size) { | 1649 | if (copied > size) { |
1638 | copied = size; | 1650 | copied = size; |
1639 | msg->msg_flags |= MSG_TRUNC; | 1651 | msg->msg_flags |= MSG_TRUNC; |