aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.osdl.org>2006-11-21 21:36:59 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-21 21:36:59 -0500
commitc5dd27337a70b34cc400120e70a80fcb84c4fd7a (patch)
tree5c41d10ecb9169b9c3dd31a9cdad6af3b6f974b2
parent6af6e1efb161ffe36e718b1fd58385710879af7c (diff)
parent12862086f24d7382b24379bbcbe0dadf12ca5945 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [TG3]: Add missing unlock in tg3_open() error path. [IPV6]: Fix address/interface handling in UDP and DCCP, according to the scoping architecture. [IRDA]: Lockdep fix. [BLUETOOTH]: Fix unaligned access in hci_send_to_sock. [XFRM]: nlmsg length not computed correctly in the presence of subpolicies [XFRM]: Sub-policies broke policy events [IGMP]: Fix IGMPV3_EXP() normalization bit shift value. [Bluetooth] Ignore L2CAP config requests on disconnect [Bluetooth] Always include MTU in L2CAP config responses [Bluetooth] Check if RFCOMM session is still attached to the TTY [Bluetooth] Handling pending connect attempts after inquiry [Bluetooth] Attach low-level connections to the Bluetooth bus [IPV6] IP6TUNNEL: Add missing nf_reset() on input path. [IPV6] IP6TUNNEL: Delete all tunnel device when unloading module. [IPV6] ROUTE: Do not enable router reachability probing in router mode. [IPV6] ROUTE: Prefer reachable nexthop only if the caller requests. [IPV6] ROUTE: Try to use router which is not known unreachable.
-rw-r--r--drivers/net/tg3.c4
-rw-r--r--include/linux/igmp.h2
-rw-r--r--net/bluetooth/hci_event.c19
-rw-r--r--net/bluetooth/hci_sock.c11
-rw-r--r--net/bluetooth/hci_sysfs.c4
-rw-r--r--net/bluetooth/l2cap.c11
-rw-r--r--net/bluetooth/rfcomm/tty.c2
-rw-r--r--net/dccp/ipv6.c2
-rw-r--r--net/ipv6/ip6_tunnel.c19
-rw-r--r--net/ipv6/route.c15
-rw-r--r--net/ipv6/udp.c7
-rw-r--r--net/irda/irlmp.c3
-rw-r--r--net/xfrm/xfrm_user.c13
13 files changed, 85 insertions, 27 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 1dbdd6bb587b..c20bb998e0e5 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6979,8 +6979,10 @@ static int tg3_open(struct net_device *dev)
6979 tg3_full_lock(tp, 0); 6979 tg3_full_lock(tp, 0);
6980 6980
6981 err = tg3_set_power_state(tp, PCI_D0); 6981 err = tg3_set_power_state(tp, PCI_D0);
6982 if (err) 6982 if (err) {
6983 tg3_full_unlock(tp);
6983 return err; 6984 return err;
6985 }
6984 6986
6985 tg3_disable_ints(tp); 6987 tg3_disable_ints(tp);
6986 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE; 6988 tp->tg3_flags &= ~TG3_FLAG_INIT_COMPLETE;
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 03f43e2893a4..21dd56905271 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -191,7 +191,7 @@ struct ip_mc_list
191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ 192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
193 ((value) < (thresh) ? (value) : \ 193 ((value) < (thresh) ? (value) : \
194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ 194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
196 196
197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) 197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index 65f094845719..bb94e6da223c 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -57,6 +57,7 @@
57static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb) 57static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb)
58{ 58{
59 __u8 status; 59 __u8 status;
60 struct hci_conn *pend;
60 61
61 BT_DBG("%s ocf 0x%x", hdev->name, ocf); 62 BT_DBG("%s ocf 0x%x", hdev->name, ocf);
62 63
@@ -71,6 +72,15 @@ static void hci_cc_link_ctl(struct hci_dev *hdev, __u16 ocf, struct sk_buff *skb
71 clear_bit(HCI_INQUIRY, &hdev->flags); 72 clear_bit(HCI_INQUIRY, &hdev->flags);
72 hci_req_complete(hdev, status); 73 hci_req_complete(hdev, status);
73 } 74 }
75
76 hci_dev_lock(hdev);
77
78 pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
79 if (pend)
80 hci_acl_connect(pend);
81
82 hci_dev_unlock(hdev);
83
74 break; 84 break;
75 85
76 default: 86 default:
@@ -565,11 +575,20 @@ static void hci_cs_info_param(struct hci_dev *hdev, __u16 ocf, __u8 status)
565static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb) 575static inline void hci_inquiry_complete_evt(struct hci_dev *hdev, struct sk_buff *skb)
566{ 576{
567 __u8 status = *((__u8 *) skb->data); 577 __u8 status = *((__u8 *) skb->data);
578 struct hci_conn *pend;
568 579
569 BT_DBG("%s status %d", hdev->name, status); 580 BT_DBG("%s status %d", hdev->name, status);
570 581
571 clear_bit(HCI_INQUIRY, &hdev->flags); 582 clear_bit(HCI_INQUIRY, &hdev->flags);
572 hci_req_complete(hdev, status); 583 hci_req_complete(hdev, status);
584
585 hci_dev_lock(hdev);
586
587 pend = hci_conn_hash_lookup_state(hdev, ACL_LINK, BT_CONNECT2);
588 if (pend)
589 hci_acl_connect(pend);
590
591 hci_dev_unlock(hdev);
573} 592}
574 593
575/* Inquiry Result */ 594/* Inquiry Result */
diff --git a/net/bluetooth/hci_sock.c b/net/bluetooth/hci_sock.c
index f26a9eb49945..711a085eca5b 100644
--- a/net/bluetooth/hci_sock.c
+++ b/net/bluetooth/hci_sock.c
@@ -120,10 +120,13 @@ void hci_send_to_sock(struct hci_dev *hdev, struct sk_buff *skb)
120 if (!hci_test_bit(evt, &flt->event_mask)) 120 if (!hci_test_bit(evt, &flt->event_mask))
121 continue; 121 continue;
122 122
123 if (flt->opcode && ((evt == HCI_EV_CMD_COMPLETE && 123 if (flt->opcode &&
124 flt->opcode != *(__u16 *)(skb->data + 3)) || 124 ((evt == HCI_EV_CMD_COMPLETE &&
125 (evt == HCI_EV_CMD_STATUS && 125 flt->opcode !=
126 flt->opcode != *(__u16 *)(skb->data + 4)))) 126 get_unaligned((__u16 *)(skb->data + 3))) ||
127 (evt == HCI_EV_CMD_STATUS &&
128 flt->opcode !=
129 get_unaligned((__u16 *)(skb->data + 4)))))
127 continue; 130 continue;
128 } 131 }
129 132
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 954eb74eb370..3eeeb7a86e75 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -259,7 +259,9 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
259 259
260 BT_DBG("conn %p", conn); 260 BT_DBG("conn %p", conn);
261 261
262 conn->dev.parent = &hdev->dev; 262 conn->dev.bus = &bt_bus;
263 conn->dev.parent = &hdev->dev;
264
263 conn->dev.release = bt_release; 265 conn->dev.release = bt_release;
264 266
265 snprintf(conn->dev.bus_id, BUS_ID_SIZE, 267 snprintf(conn->dev.bus_id, BUS_ID_SIZE,
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 2b3dcb8f90fa..bbf78e6a7bc3 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -1353,12 +1353,12 @@ static inline int l2cap_conf_output(struct sock *sk, void **ptr)
1353 1353
1354 /* Configure output options and let the other side know 1354 /* Configure output options and let the other side know
1355 * which ones we don't like. */ 1355 * which ones we don't like. */
1356 if (pi->conf_mtu < pi->omtu) { 1356 if (pi->conf_mtu < pi->omtu)
1357 l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
1358 result = L2CAP_CONF_UNACCEPT; 1357 result = L2CAP_CONF_UNACCEPT;
1359 } else { 1358 else
1360 pi->omtu = pi->conf_mtu; 1359 pi->omtu = pi->conf_mtu;
1361 } 1360
1361 l2cap_add_conf_opt(ptr, L2CAP_CONF_MTU, 2, pi->omtu);
1362 1362
1363 BT_DBG("sk %p result %d", sk, result); 1363 BT_DBG("sk %p result %d", sk, result);
1364 return result; 1364 return result;
@@ -1533,6 +1533,9 @@ static inline int l2cap_config_req(struct l2cap_conn *conn, struct l2cap_cmd_hdr
1533 if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid))) 1533 if (!(sk = l2cap_get_chan_by_scid(&conn->chan_list, dcid)))
1534 return -ENOENT; 1534 return -ENOENT;
1535 1535
1536 if (sk->sk_state == BT_DISCONN)
1537 goto unlock;
1538
1536 l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req)); 1539 l2cap_parse_conf_req(sk, req->data, cmd->len - sizeof(*req));
1537 1540
1538 if (flags & 0x0001) { 1541 if (flags & 0x0001) {
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c
index b8e3a5f1c8a8..1fb5d42f37ae 100644
--- a/net/bluetooth/rfcomm/tty.c
+++ b/net/bluetooth/rfcomm/tty.c
@@ -765,7 +765,7 @@ static void rfcomm_tty_set_termios(struct tty_struct *tty, struct termios *old)
765 765
766 BT_DBG("tty %p termios %p", tty, old); 766 BT_DBG("tty %p termios %p", tty, old);
767 767
768 if (!dev) 768 if (!dev || !dev->dlc || !dev->dlc->session)
769 return; 769 return;
770 770
771 /* Handle turning off CRTSCTS */ 771 /* Handle turning off CRTSCTS */
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index eb0ff7ab05ed..fc4242c0767c 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -277,7 +277,7 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
277 __u64 seq; 277 __u64 seq;
278 278
279 sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport, 279 sk = inet6_lookup(&dccp_hashinfo, &hdr->daddr, dh->dccph_dport,
280 &hdr->saddr, dh->dccph_sport, skb->dev->ifindex); 280 &hdr->saddr, dh->dccph_sport, inet6_iif(skb));
281 281
282 if (sk == NULL) { 282 if (sk == NULL) {
283 ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); 283 ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index 84d7ebdb9d21..b9f40290d12a 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -542,6 +542,7 @@ ip6ip6_rcv(struct sk_buff *skb)
542 skb->dev = t->dev; 542 skb->dev = t->dev;
543 dst_release(skb->dst); 543 dst_release(skb->dst);
544 skb->dst = NULL; 544 skb->dst = NULL;
545 nf_reset(skb);
545 if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY) 546 if (t->parms.flags & IP6_TNL_F_RCV_DSCP_COPY)
546 ipv6_copy_dscp(ipv6h, skb->nh.ipv6h); 547 ipv6_copy_dscp(ipv6h, skb->nh.ipv6h);
547 ip6ip6_ecn_decapsulate(ipv6h, skb); 548 ip6ip6_ecn_decapsulate(ipv6h, skb);
@@ -1149,6 +1150,20 @@ fail:
1149 return err; 1150 return err;
1150} 1151}
1151 1152
1153static void __exit ip6ip6_destroy_tunnels(void)
1154{
1155 int h;
1156 struct ip6_tnl *t;
1157
1158 for (h = 0; h < HASH_SIZE; h++) {
1159 while ((t = tnls_r_l[h]) != NULL)
1160 unregister_netdevice(t->dev);
1161 }
1162
1163 t = tnls_wc[0];
1164 unregister_netdevice(t->dev);
1165}
1166
1152/** 1167/**
1153 * ip6_tunnel_cleanup - free resources and unregister protocol 1168 * ip6_tunnel_cleanup - free resources and unregister protocol
1154 **/ 1169 **/
@@ -1158,7 +1173,9 @@ static void __exit ip6_tunnel_cleanup(void)
1158 if (xfrm6_tunnel_deregister(&ip6ip6_handler)) 1173 if (xfrm6_tunnel_deregister(&ip6ip6_handler))
1159 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n"); 1174 printk(KERN_INFO "ip6ip6 close: can't deregister tunnel\n");
1160 1175
1161 unregister_netdev(ip6ip6_fb_tnl_dev); 1176 rtnl_lock();
1177 ip6ip6_destroy_tunnels();
1178 rtnl_unlock();
1162} 1179}
1163 1180
1164module_init(ip6_tunnel_init); 1181module_init(ip6_tunnel_init);
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index c953466b7afd..b39ae99122d5 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -330,6 +330,8 @@ static int inline rt6_check_neigh(struct rt6_info *rt)
330 read_lock_bh(&neigh->lock); 330 read_lock_bh(&neigh->lock);
331 if (neigh->nud_state & NUD_VALID) 331 if (neigh->nud_state & NUD_VALID)
332 m = 2; 332 m = 2;
333 else if (!(neigh->nud_state & NUD_FAILED))
334 m = 1;
333 read_unlock_bh(&neigh->lock); 335 read_unlock_bh(&neigh->lock);
334 } 336 }
335 return m; 337 return m;
@@ -347,9 +349,7 @@ static int rt6_score_route(struct rt6_info *rt, int oif,
347 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2; 349 m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
348#endif 350#endif
349 n = rt6_check_neigh(rt); 351 n = rt6_check_neigh(rt);
350 if (n > 1) 352 if (!n && (strict & RT6_LOOKUP_F_REACHABLE))
351 m |= 16;
352 else if (!n && strict & RT6_LOOKUP_F_REACHABLE)
353 return -1; 353 return -1;
354 return m; 354 return m;
355} 355}
@@ -380,10 +380,11 @@ static struct rt6_info *rt6_select(struct rt6_info **head, int oif,
380 continue; 380 continue;
381 381
382 if (m > mpri) { 382 if (m > mpri) {
383 rt6_probe(match); 383 if (strict & RT6_LOOKUP_F_REACHABLE)
384 rt6_probe(match);
384 match = rt; 385 match = rt;
385 mpri = m; 386 mpri = m;
386 } else { 387 } else if (strict & RT6_LOOKUP_F_REACHABLE) {
387 rt6_probe(rt); 388 rt6_probe(rt);
388 } 389 }
389 } 390 }
@@ -636,7 +637,7 @@ static struct rt6_info *ip6_pol_route_input(struct fib6_table *table,
636 int strict = 0; 637 int strict = 0;
637 int attempts = 3; 638 int attempts = 3;
638 int err; 639 int err;
639 int reachable = RT6_LOOKUP_F_REACHABLE; 640 int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
640 641
641 strict |= flags & RT6_LOOKUP_F_IFACE; 642 strict |= flags & RT6_LOOKUP_F_IFACE;
642 643
@@ -733,7 +734,7 @@ static struct rt6_info *ip6_pol_route_output(struct fib6_table *table,
733 int strict = 0; 734 int strict = 0;
734 int attempts = 3; 735 int attempts = 3;
735 int err; 736 int err;
736 int reachable = RT6_LOOKUP_F_REACHABLE; 737 int reachable = ipv6_devconf.forwarding ? 0 : RT6_LOOKUP_F_REACHABLE;
737 738
738 strict |= flags & RT6_LOOKUP_F_IFACE; 739 strict |= flags & RT6_LOOKUP_F_IFACE;
739 740
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index e0c3934a7e4b..c83f23e51c46 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -242,14 +242,13 @@ static void udpv6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
242{ 242{
243 struct ipv6_pinfo *np; 243 struct ipv6_pinfo *np;
244 struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data; 244 struct ipv6hdr *hdr = (struct ipv6hdr*)skb->data;
245 struct net_device *dev = skb->dev;
246 struct in6_addr *saddr = &hdr->saddr; 245 struct in6_addr *saddr = &hdr->saddr;
247 struct in6_addr *daddr = &hdr->daddr; 246 struct in6_addr *daddr = &hdr->daddr;
248 struct udphdr *uh = (struct udphdr*)(skb->data+offset); 247 struct udphdr *uh = (struct udphdr*)(skb->data+offset);
249 struct sock *sk; 248 struct sock *sk;
250 int err; 249 int err;
251 250
252 sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, dev->ifindex); 251 sk = udp_v6_lookup(daddr, uh->dest, saddr, uh->source, inet6_iif(skb));
253 252
254 if (sk == NULL) 253 if (sk == NULL)
255 return; 254 return;
@@ -348,7 +347,7 @@ static void udpv6_mcast_deliver(struct udphdr *uh,
348 347
349 read_lock(&udp_hash_lock); 348 read_lock(&udp_hash_lock);
350 sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]); 349 sk = sk_head(&udp_hash[ntohs(uh->dest) & (UDP_HTABLE_SIZE - 1)]);
351 dif = skb->dev->ifindex; 350 dif = inet6_iif(skb);
352 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif); 351 sk = udp_v6_mcast_next(sk, uh->dest, daddr, uh->source, saddr, dif);
353 if (!sk) { 352 if (!sk) {
354 kfree_skb(skb); 353 kfree_skb(skb);
@@ -429,7 +428,7 @@ static int udpv6_rcv(struct sk_buff **pskb)
429 * check socket cache ... must talk to Alan about his plans 428 * check socket cache ... must talk to Alan about his plans
430 * for sock caches... i'll skip this for now. 429 * for sock caches... i'll skip this for now.
431 */ 430 */
432 sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, dev->ifindex); 431 sk = udp_v6_lookup(saddr, uh->source, daddr, uh->dest, inet6_iif(skb));
433 432
434 if (sk == NULL) { 433 if (sk == NULL) {
435 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) 434 if (!xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb))
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 5073261b9d0c..fede83763095 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -1678,7 +1678,8 @@ static int irlmp_slsap_inuse(__u8 slsap_sel)
1678 * every IrLAP connection and check every LSAP associated with each 1678 * every IrLAP connection and check every LSAP associated with each
1679 * the connection. 1679 * the connection.
1680 */ 1680 */
1681 spin_lock_irqsave(&irlmp->links->hb_spinlock, flags); 1681 spin_lock_irqsave_nested(&irlmp->links->hb_spinlock, flags,
1682 SINGLE_DEPTH_NESTING);
1682 lap = (struct lap_cb *) hashbin_get_first(irlmp->links); 1683 lap = (struct lap_cb *) hashbin_get_first(irlmp->links);
1683 while (lap != NULL) { 1684 while (lap != NULL) {
1684 IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;); 1685 IRDA_ASSERT(lap->magic == LMP_LAP_MAGIC, goto errlap;);
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c
index b43e7647e125..c4cde57d9216 100644
--- a/net/xfrm/xfrm_user.c
+++ b/net/xfrm/xfrm_user.c
@@ -1927,6 +1927,9 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
1927 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 1927 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
1928 len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire)); 1928 len += NLMSG_SPACE(sizeof(struct xfrm_user_acquire));
1929 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 1929 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
1930#ifdef CONFIG_XFRM_SUB_POLICY
1931 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
1932#endif
1930 skb = alloc_skb(len, GFP_ATOMIC); 1933 skb = alloc_skb(len, GFP_ATOMIC);
1931 if (skb == NULL) 1934 if (skb == NULL)
1932 return -ENOMEM; 1935 return -ENOMEM;
@@ -2034,6 +2037,9 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
2034 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr); 2037 len = RTA_SPACE(sizeof(struct xfrm_user_tmpl) * xp->xfrm_nr);
2035 len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire)); 2038 len += NLMSG_SPACE(sizeof(struct xfrm_user_polexpire));
2036 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp)); 2039 len += RTA_SPACE(xfrm_user_sec_ctx_size(xp));
2040#ifdef CONFIG_XFRM_SUB_POLICY
2041 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2042#endif
2037 skb = alloc_skb(len, GFP_ATOMIC); 2043 skb = alloc_skb(len, GFP_ATOMIC);
2038 if (skb == NULL) 2044 if (skb == NULL)
2039 return -ENOMEM; 2045 return -ENOMEM;
@@ -2060,6 +2066,9 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *
2060 len += RTA_SPACE(headlen); 2066 len += RTA_SPACE(headlen);
2061 headlen = sizeof(*id); 2067 headlen = sizeof(*id);
2062 } 2068 }
2069#ifdef CONFIG_XFRM_SUB_POLICY
2070 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2071#endif
2063 len += NLMSG_SPACE(headlen); 2072 len += NLMSG_SPACE(headlen);
2064 2073
2065 skb = alloc_skb(len, GFP_ATOMIC); 2074 skb = alloc_skb(len, GFP_ATOMIC);
@@ -2106,10 +2115,12 @@ static int xfrm_notify_policy_flush(struct km_event *c)
2106 struct nlmsghdr *nlh; 2115 struct nlmsghdr *nlh;
2107 struct sk_buff *skb; 2116 struct sk_buff *skb;
2108 unsigned char *b; 2117 unsigned char *b;
2118 int len = 0;
2109#ifdef CONFIG_XFRM_SUB_POLICY 2119#ifdef CONFIG_XFRM_SUB_POLICY
2110 struct xfrm_userpolicy_type upt; 2120 struct xfrm_userpolicy_type upt;
2121 len += RTA_SPACE(sizeof(struct xfrm_userpolicy_type));
2111#endif 2122#endif
2112 int len = NLMSG_LENGTH(0); 2123 len += NLMSG_LENGTH(0);
2113 2124
2114 skb = alloc_skb(len, GFP_ATOMIC); 2125 skb = alloc_skb(len, GFP_ATOMIC);
2115 if (skb == NULL) 2126 if (skb == NULL)