aboutsummaryrefslogtreecommitdiffstats
path: root/net/netrom
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-27 21:35:03 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-27 21:35:03 -0400
commit5d80f8e5a9dc9c9a94d4aeaa567e219a808b8a4a (patch)
tree357258d77e2153ef7409926773655c5f8775a1f3 /net/netrom
parent7b616c8a2f5c8507b4aed6907336ec5b85803a39 (diff)
parent0870352bc6e0dee485c86a0c99dd60e7089c8917 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (166 commits) Revert "ax25: zero length frame filtering in AX25" Revert "netrom: zero length frame filtering in NetRom" cfg80211: default CONFIG_WIRELESS_OLD_REGULATORY to n mac80211/iwlwifi: move virtual A-MDPU queue bookkeeping to iwlwifi mac80211: fix aggregation to not require queue stop mac80211: add skb length sanity checking mac80211: unify and fix TX aggregation start mac80211: clean up __ieee80211_tx args mac80211: rework the pending packets code mac80211: fix A-MPDU queue assignment mac80211: rewrite fragmentation iwlwifi: show current driver status in user readable format b43: Add BCM4307 PCI-ID cfg80211: fix locking in nl80211_set_wiphy mac80211: fix RX path ath5k: properly drop packets from ops->tx ar9170: single module build ath9k: fix dma mapping leak of rx buffer upon rmmod rt2x00: New USB ID for rt73usb ath5k: warn and correct rate for unknown hw rate indexes ...
Diffstat (limited to 'net/netrom')
-rw-r--r--net/netrom/af_netrom.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 6d9c58ec56ac..4e705f87969f 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1037,10 +1037,6 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
1037 unsigned char *asmptr; 1037 unsigned char *asmptr;
1038 int size; 1038 int size;
1039 1039
1040 /* Netrom empty data frame has no meaning : don't send */
1041 if (len == 0)
1042 return 0;
1043
1044 if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) 1040 if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT))
1045 return -EINVAL; 1041 return -EINVAL;
1046 1042
@@ -1086,7 +1082,11 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
1086 1082
1087 SOCK_DEBUG(sk, "NET/ROM: sendto: Addresses built.\n"); 1083 SOCK_DEBUG(sk, "NET/ROM: sendto: Addresses built.\n");
1088 1084
1089 /* Build a packet */ 1085 /* Build a packet - the conventional user limit is 236 bytes. We can
1086 do ludicrously large NetROM frames but must not overflow */
1087 if (len > 65536)
1088 return -EMSGSIZE;
1089
1090 SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n"); 1090 SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n");
1091 size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN; 1091 size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN;
1092 1092
@@ -1171,11 +1171,6 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
1171 skb_reset_transport_header(skb); 1171 skb_reset_transport_header(skb);
1172 copied = skb->len; 1172 copied = skb->len;
1173 1173
1174 /* NetRom empty data frame has no meaning : ignore it */
1175 if (copied == 0) {
1176 goto out;
1177 }
1178
1179 if (copied > size) { 1174 if (copied > size) {
1180 copied = size; 1175 copied = size;
1181 msg->msg_flags |= MSG_TRUNC; 1176 msg->msg_flags |= MSG_TRUNC;
@@ -1191,7 +1186,7 @@ static int nr_recvmsg(struct kiocb *iocb, struct socket *sock,
1191 1186
1192 msg->msg_namelen = sizeof(*sax); 1187 msg->msg_namelen = sizeof(*sax);
1193 1188
1194out: skb_free_datagram(sk, skb); 1189 skb_free_datagram(sk, skb);
1195 1190
1196 release_sock(sk); 1191 release_sock(sk);
1197 return copied; 1192 return copied;