Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135350
b: refs/heads/master
c: a3ac80a
h: refs/heads/master
v: v3
  • Loading branch information
Bernard Pidoux authored and David S. Miller committed Mar 21, 2009
1 parent df2f106 commit 5c3fb27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f99bcff7a290768e035f3d4726e103c6ebe858bf
refs/heads/master: a3ac80a130300573de351083cf4a5b46d233e8bf
11 changes: 10 additions & 1 deletion trunk/net/netrom/af_netrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,10 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
unsigned char *asmptr;
int size;

/* Netrom empty data frame has no meaning : don't send */
if (len == 0)
return 0;

if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
return -EINVAL;

Expand Down Expand Up @@ -1167,6 +1171,11 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
skb_reset_transport_header(skb);
copied = skb->len;

/* NetRom empty data frame has no meaning : ignore it */
if (copied == 0) {
goto out;
}

if (copied > size) {
copied = size;
msg->msg_flags |= MSG_TRUNC;
Expand All @@ -1182,7 +1191,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,

msg->msg_namelen = sizeof(*sax);

skb_free_datagram(sk, skb);
out: skb_free_datagram(sk, skb);

release_sock(sk);
return copied;
Expand Down

0 comments on commit 5c3fb27

Please sign in to comment.