aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-04-23 07:08:24 -0400
committerDavid S. Miller <davem@davemloft.net>2009-04-23 07:08:24 -0400
commit5802b140ed52957ad150eaf40239a95f5f45fbd3 (patch)
treee5c37962611bc5f39c56a1ec479b9059072f056a /net
parent09488e2e0fab14ebe41135f0d066cfe2c56ba9e5 (diff)
parent29fe1b481283a1bada994a69f65736db4ae6f35f (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: net/iucv/af_iucv.c
Diffstat (limited to 'net')
-rw-r--r--net/iucv/af_iucv.c26
-rw-r--r--net/mac80211/pm.c15
-rw-r--r--net/mac80211/rx.c2
-rw-r--r--net/netfilter/nf_conntrack_netlink.c4
-rw-r--r--net/netlabel/netlabel_addrlist.c26
-rw-r--r--net/netrom/af_netrom.c6
6 files changed, 49 insertions, 30 deletions
diff --git a/net/iucv/af_iucv.c b/net/iucv/af_iucv.c
index 264c6b36931c..0fc00087ea8b 100644
--- a/net/iucv/af_iucv.c
+++ b/net/iucv/af_iucv.c
@@ -215,6 +215,7 @@ static void iucv_sock_close(struct sock *sk)
215 err = iucv_sock_wait_state(sk, IUCV_CLOSED, 0, timeo); 215 err = iucv_sock_wait_state(sk, IUCV_CLOSED, 0, timeo);
216 } 216 }
217 217
218 case IUCV_CLOSING: /* fall through */
218 sk->sk_state = IUCV_CLOSED; 219 sk->sk_state = IUCV_CLOSED;
219 sk->sk_state_change(sk); 220 sk->sk_state_change(sk);
220 221
@@ -269,6 +270,8 @@ static struct sock *iucv_sock_alloc(struct socket *sock, int proto, gfp_t prio)
269 iucv_sk(sk)->send_tag = 0; 270 iucv_sk(sk)->send_tag = 0;
270 iucv_sk(sk)->flags = 0; 271 iucv_sk(sk)->flags = 0;
271 iucv_sk(sk)->msglimit = IUCV_QUEUELEN_DEFAULT; 272 iucv_sk(sk)->msglimit = IUCV_QUEUELEN_DEFAULT;
273 iucv_sk(sk)->path = NULL;
274 memset(&iucv_sk(sk)->src_user_id , 0, 32);
272 275
273 sk->sk_destruct = iucv_sock_destruct; 276 sk->sk_destruct = iucv_sock_destruct;
274 sk->sk_sndtimeo = IUCV_CONN_TIMEOUT; 277 sk->sk_sndtimeo = IUCV_CONN_TIMEOUT;
@@ -979,6 +982,10 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
979 if (flags & (MSG_OOB)) 982 if (flags & (MSG_OOB))
980 return -EOPNOTSUPP; 983 return -EOPNOTSUPP;
981 984
985 target = sock_rcvlowat(sk, flags & MSG_WAITALL, len);
986
987 /* receive/dequeue next skb:
988 * the function understands MSG_PEEK and, thus, does not dequeue skb */
982 skb = skb_recv_datagram(sk, flags, noblock, &err); 989 skb = skb_recv_datagram(sk, flags, noblock, &err);
983 if (!skb) { 990 if (!skb) {
984 if (sk->sk_shutdown & RCV_SHUTDOWN) 991 if (sk->sk_shutdown & RCV_SHUTDOWN)
@@ -1046,9 +1053,7 @@ static int iucv_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
1046 iucv_process_message_q(sk); 1053 iucv_process_message_q(sk);
1047 spin_unlock_bh(&iucv->message_q.lock); 1054 spin_unlock_bh(&iucv->message_q.lock);
1048 } 1055 }
1049 1056 }
1050 } else
1051 skb_queue_head(&sk->sk_receive_queue, skb);
1052 1057
1053done: 1058done:
1054 /* SOCK_SEQPACKET: return real length if MSG_TRUNC is set */ 1059 /* SOCK_SEQPACKET: return real length if MSG_TRUNC is set */
@@ -1125,6 +1130,9 @@ static int iucv_sock_shutdown(struct socket *sock, int how)
1125 1130
1126 lock_sock(sk); 1131 lock_sock(sk);
1127 switch (sk->sk_state) { 1132 switch (sk->sk_state) {
1133 case IUCV_DISCONN:
1134 case IUCV_CLOSING:
1135 case IUCV_SEVERED:
1128 case IUCV_CLOSED: 1136 case IUCV_CLOSED:
1129 err = -ENOTCONN; 1137 err = -ENOTCONN;
1130 goto fail; 1138 goto fail;
@@ -1398,8 +1406,12 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
1398 struct sock_msg_q *save_msg; 1406 struct sock_msg_q *save_msg;
1399 int len; 1407 int len;
1400 1408
1401 if (sk->sk_shutdown & RCV_SHUTDOWN) 1409 if (sk->sk_shutdown & RCV_SHUTDOWN) {
1410 iucv_message_reject(path, msg);
1402 return; 1411 return;
1412 }
1413
1414 spin_lock(&iucv->message_q.lock);
1403 1415
1404 if (!list_empty(&iucv->message_q.list) || 1416 if (!list_empty(&iucv->message_q.list) ||
1405 !skb_queue_empty(&iucv->backlog_skb_q)) 1417 !skb_queue_empty(&iucv->backlog_skb_q))
@@ -1414,9 +1426,8 @@ static void iucv_callback_rx(struct iucv_path *path, struct iucv_message *msg)
1414 if (!skb) 1426 if (!skb)
1415 goto save_message; 1427 goto save_message;
1416 1428
1417 spin_lock(&iucv->message_q.lock);
1418 iucv_process_message(sk, skb, path, msg); 1429 iucv_process_message(sk, skb, path, msg);
1419 spin_unlock(&iucv->message_q.lock); 1430 goto out_unlock;
1420 1431
1421 return; 1432 return;
1422 1433
@@ -1427,8 +1438,9 @@ save_message:
1427 save_msg->path = path; 1438 save_msg->path = path;
1428 save_msg->msg = *msg; 1439 save_msg->msg = *msg;
1429 1440
1430 spin_lock(&iucv->message_q.lock);
1431 list_add_tail(&save_msg->list, &iucv->message_q.list); 1441 list_add_tail(&save_msg->list, &iucv->message_q.list);
1442
1443out_unlock:
1432 spin_unlock(&iucv->message_q.lock); 1444 spin_unlock(&iucv->message_q.lock);
1433} 1445}
1434 1446
diff --git a/net/mac80211/pm.c b/net/mac80211/pm.c
index 027302326498..81985d27cbda 100644
--- a/net/mac80211/pm.c
+++ b/net/mac80211/pm.c
@@ -156,8 +156,19 @@ int __ieee80211_resume(struct ieee80211_hw *hw)
156 case NL80211_IFTYPE_ADHOC: 156 case NL80211_IFTYPE_ADHOC:
157 case NL80211_IFTYPE_AP: 157 case NL80211_IFTYPE_AP:
158 case NL80211_IFTYPE_MESH_POINT: 158 case NL80211_IFTYPE_MESH_POINT:
159 WARN_ON(ieee80211_if_config(sdata, changed)); 159 /*
160 ieee80211_bss_info_change_notify(sdata, ~0); 160 * Driver's config_interface can fail if rfkill is
161 * enabled. Accommodate this return code.
162 * FIXME: When mac80211 has knowledge of rfkill
163 * state the code below can change back to:
164 * WARN(ieee80211_if_config(sdata, changed));
165 * ieee80211_bss_info_change_notify(sdata, ~0);
166 */
167 if (ieee80211_if_config(sdata, changed))
168 printk(KERN_DEBUG "%s: failed to configure interface during resume\n",
169 sdata->dev->name);
170 else
171 ieee80211_bss_info_change_notify(sdata, ~0);
161 break; 172 break;
162 case NL80211_IFTYPE_WDS: 173 case NL80211_IFTYPE_WDS:
163 break; 174 break;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 5fa7aedd90ed..9776f73c51ad 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1397,7 +1397,7 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1397 * mac80211. That also explains the __skb_push() 1397 * mac80211. That also explains the __skb_push()
1398 * below. 1398 * below.
1399 */ 1399 */
1400 align = (unsigned long)skb->data & 4; 1400 align = (unsigned long)skb->data & 3;
1401 if (align) { 1401 if (align) {
1402 if (WARN_ON(skb_headroom(skb) < 3)) { 1402 if (WARN_ON(skb_headroom(skb) < 3)) {
1403 dev_kfree_skb(skb); 1403 dev_kfree_skb(skb);
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 0ea36e0c8a0e..f13fc57e1ecb 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -988,7 +988,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[])
988{ 988{
989 struct nf_conntrack_helper *helper; 989 struct nf_conntrack_helper *helper;
990 struct nf_conn_help *help = nfct_help(ct); 990 struct nf_conn_help *help = nfct_help(ct);
991 char *helpname; 991 char *helpname = NULL;
992 int err; 992 int err;
993 993
994 /* don't change helper of sibling connections */ 994 /* don't change helper of sibling connections */
@@ -1231,7 +1231,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
1231 1231
1232 rcu_read_lock(); 1232 rcu_read_lock();
1233 if (cda[CTA_HELP]) { 1233 if (cda[CTA_HELP]) {
1234 char *helpname; 1234 char *helpname = NULL;
1235 1235
1236 err = ctnetlink_parse_help(cda[CTA_HELP], &helpname); 1236 err = ctnetlink_parse_help(cda[CTA_HELP], &helpname);
1237 if (err < 0) 1237 if (err < 0)
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index 834c6eb7f484..c0519139679e 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -256,13 +256,11 @@ struct netlbl_af4list *netlbl_af4list_remove(__be32 addr, __be32 mask,
256{ 256{
257 struct netlbl_af4list *entry; 257 struct netlbl_af4list *entry;
258 258
259 entry = netlbl_af4list_search(addr, head); 259 entry = netlbl_af4list_search_exact(addr, mask, head);
260 if (entry != NULL && entry->addr == addr && entry->mask == mask) { 260 if (entry == NULL)
261 netlbl_af4list_remove_entry(entry); 261 return NULL;
262 return entry; 262 netlbl_af4list_remove_entry(entry);
263 } 263 return entry;
264
265 return NULL;
266} 264}
267 265
268#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 266#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
@@ -299,15 +297,11 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr,
299{ 297{
300 struct netlbl_af6list *entry; 298 struct netlbl_af6list *entry;
301 299
302 entry = netlbl_af6list_search(addr, head); 300 entry = netlbl_af6list_search_exact(addr, mask, head);
303 if (entry != NULL && 301 if (entry == NULL)
304 ipv6_addr_equal(&entry->addr, addr) && 302 return NULL;
305 ipv6_addr_equal(&entry->mask, mask)) { 303 netlbl_af6list_remove_entry(entry);
306 netlbl_af6list_remove_entry(entry); 304 return entry;
307 return entry;
308 }
309
310 return NULL;
311} 305}
312#endif /* IPv6 */ 306#endif /* IPv6 */
313 307
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 4e705f87969f..3be0e016ab7d 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1084,8 +1084,10 @@ static int nr_sendmsg(struct kiocb *iocb, struct socket *sock,
1084 1084
1085 /* Build a packet - the conventional user limit is 236 bytes. We can 1085 /* Build a packet - the conventional user limit is 236 bytes. We can
1086 do ludicrously large NetROM frames but must not overflow */ 1086 do ludicrously large NetROM frames but must not overflow */
1087 if (len > 65536) 1087 if (len > 65536) {
1088 return -EMSGSIZE; 1088 err = -EMSGSIZE;
1089 goto out;
1090 }
1089 1091
1090 SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n"); 1092 SOCK_DEBUG(sk, "NET/ROM: sendto: building packet.\n");
1091 size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN; 1093 size = len + NR_NETWORK_LEN + NR_TRANSPORT_LEN;