diff options
Diffstat (limited to 'net/rose')
-rw-r--r-- | net/rose/af_rose.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index a7f1ce11bc22..0c1cc7612800 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1072,6 +1072,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1072 | unsigned char *asmptr; | 1072 | unsigned char *asmptr; |
1073 | int n, size, qbit = 0; | 1073 | int n, size, qbit = 0; |
1074 | 1074 | ||
1075 | /* ROSE empty frame has no meaning : don't send */ | ||
1076 | if (len == 0) | ||
1077 | return 0; | ||
1078 | |||
1075 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) | 1079 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) |
1076 | return -EINVAL; | 1080 | return -EINVAL; |
1077 | 1081 | ||
@@ -1265,6 +1269,12 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1265 | skb_reset_transport_header(skb); | 1269 | skb_reset_transport_header(skb); |
1266 | copied = skb->len; | 1270 | copied = skb->len; |
1267 | 1271 | ||
1272 | /* ROSE empty frame has no meaning : ignore it */ | ||
1273 | if (copied == 0) { | ||
1274 | skb_free_datagram(sk, skb); | ||
1275 | return copied; | ||
1276 | } | ||
1277 | |||
1268 | if (copied > size) { | 1278 | if (copied > size) { |
1269 | copied = size; | 1279 | copied = size; |
1270 | msg->msg_flags |= MSG_TRUNC; | 1280 | msg->msg_flags |= MSG_TRUNC; |