diff options
author | David S. Miller <davem@davemloft.net> | 2010-12-17 15:27:22 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-12-17 15:27:22 -0500 |
commit | b4aa9e05a61b845541fa6f5b1d246976922601f0 (patch) | |
tree | ca94478c3df281ab76a3399f5ba6341ade3f5791 /net | |
parent | 1dc0f3c54ce1df957f99c17b145488fd03eb1a59 (diff) | |
parent | 4b8fe66300acb2fba8b16d62606e0d30204022fc (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/bnx2x/bnx2x.h
drivers/net/wireless/iwlwifi/iwl-1000.c
drivers/net/wireless/iwlwifi/iwl-6000.c
drivers/net/wireless/iwlwifi/iwl-core.h
drivers/vhost/vhost.c
Diffstat (limited to 'net')
-rw-r--r-- | net/atm/atm_sysfs.c | 3 | ||||
-rw-r--r-- | net/atm/resources.c | 7 | ||||
-rw-r--r-- | net/atm/resources.h | 2 | ||||
-rw-r--r-- | net/bluetooth/rfcomm/core.c | 1 | ||||
-rw-r--r-- | net/bridge/br_multicast.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 47 | ||||
-rw-r--r-- | net/core/timestamping.c | 6 | ||||
-rw-r--r-- | net/econet/af_econet.c | 6 | ||||
-rw-r--r-- | net/ipv4/udp.c | 1 | ||||
-rw-r--r-- | net/ipv4/udplite.c | 1 | ||||
-rw-r--r-- | net/ipv6/addrconf.c | 8 | ||||
-rw-r--r-- | net/ipv6/route.c | 7 | ||||
-rw-r--r-- | net/ipv6/udp.c | 1 | ||||
-rw-r--r-- | net/ipv6/udplite.c | 1 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 4 | ||||
-rw-r--r-- | net/mac80211/work.c | 5 | ||||
-rw-r--r-- | net/sctp/socket.c | 10 | ||||
-rw-r--r-- | net/socket.c | 15 | ||||
-rw-r--r-- | net/xfrm/xfrm_state.c | 2 |
19 files changed, 101 insertions, 28 deletions
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c index 799c631f0fed..f7fa67c78766 100644 --- a/net/atm/atm_sysfs.c +++ b/net/atm/atm_sysfs.c | |||
@@ -143,12 +143,13 @@ static struct class atm_class = { | |||
143 | .dev_uevent = atm_uevent, | 143 | .dev_uevent = atm_uevent, |
144 | }; | 144 | }; |
145 | 145 | ||
146 | int atm_register_sysfs(struct atm_dev *adev) | 146 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent) |
147 | { | 147 | { |
148 | struct device *cdev = &adev->class_dev; | 148 | struct device *cdev = &adev->class_dev; |
149 | int i, j, err; | 149 | int i, j, err; |
150 | 150 | ||
151 | cdev->class = &atm_class; | 151 | cdev->class = &atm_class; |
152 | cdev->parent = parent; | ||
152 | dev_set_drvdata(cdev, adev); | 153 | dev_set_drvdata(cdev, adev); |
153 | 154 | ||
154 | dev_set_name(cdev, "%s%d", adev->type, adev->number); | 155 | dev_set_name(cdev, "%s%d", adev->type, adev->number); |
diff --git a/net/atm/resources.c b/net/atm/resources.c index d29e58261511..23f45ce6f351 100644 --- a/net/atm/resources.c +++ b/net/atm/resources.c | |||
@@ -74,8 +74,9 @@ struct atm_dev *atm_dev_lookup(int number) | |||
74 | } | 74 | } |
75 | EXPORT_SYMBOL(atm_dev_lookup); | 75 | EXPORT_SYMBOL(atm_dev_lookup); |
76 | 76 | ||
77 | struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | 77 | struct atm_dev *atm_dev_register(const char *type, struct device *parent, |
78 | int number, unsigned long *flags) | 78 | const struct atmdev_ops *ops, int number, |
79 | unsigned long *flags) | ||
79 | { | 80 | { |
80 | struct atm_dev *dev, *inuse; | 81 | struct atm_dev *dev, *inuse; |
81 | 82 | ||
@@ -115,7 +116,7 @@ struct atm_dev *atm_dev_register(const char *type, const struct atmdev_ops *ops, | |||
115 | goto out_fail; | 116 | goto out_fail; |
116 | } | 117 | } |
117 | 118 | ||
118 | if (atm_register_sysfs(dev) < 0) { | 119 | if (atm_register_sysfs(dev, parent) < 0) { |
119 | pr_err("atm_register_sysfs failed for dev %s\n", type); | 120 | pr_err("atm_register_sysfs failed for dev %s\n", type); |
120 | atm_proc_dev_deregister(dev); | 121 | atm_proc_dev_deregister(dev); |
121 | goto out_fail; | 122 | goto out_fail; |
diff --git a/net/atm/resources.h b/net/atm/resources.h index 126fb1840dfb..521431e30507 100644 --- a/net/atm/resources.h +++ b/net/atm/resources.h | |||
@@ -42,6 +42,6 @@ static inline void atm_proc_dev_deregister(struct atm_dev *dev) | |||
42 | 42 | ||
43 | #endif /* CONFIG_PROC_FS */ | 43 | #endif /* CONFIG_PROC_FS */ |
44 | 44 | ||
45 | int atm_register_sysfs(struct atm_dev *adev); | 45 | int atm_register_sysfs(struct atm_dev *adev, struct device *parent); |
46 | void atm_unregister_sysfs(struct atm_dev *adev); | 46 | void atm_unregister_sysfs(struct atm_dev *adev); |
47 | #endif | 47 | #endif |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index c1e2bbafb549..ff8aaa736650 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -311,6 +311,7 @@ static void rfcomm_dlc_clear_state(struct rfcomm_dlc *d) | |||
311 | d->state = BT_OPEN; | 311 | d->state = BT_OPEN; |
312 | d->flags = 0; | 312 | d->flags = 0; |
313 | d->mscex = 0; | 313 | d->mscex = 0; |
314 | d->sec_level = BT_SECURITY_LOW; | ||
314 | d->mtu = RFCOMM_DEFAULT_MTU; | 315 | d->mtu = RFCOMM_DEFAULT_MTU; |
315 | d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV; | 316 | d->v24_sig = RFCOMM_V24_RTC | RFCOMM_V24_RTR | RFCOMM_V24_DV; |
316 | 317 | ||
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index 85a0398b221e..f03e2e98cd44 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -445,7 +445,7 @@ static struct sk_buff *br_ip6_multicast_alloc_query(struct net_bridge *br, | |||
445 | ip6h = ipv6_hdr(skb); | 445 | ip6h = ipv6_hdr(skb); |
446 | 446 | ||
447 | *(__force __be32 *)ip6h = htonl(0x60000000); | 447 | *(__force __be32 *)ip6h = htonl(0x60000000); |
448 | ip6h->payload_len = 8 + sizeof(*mldq); | 448 | ip6h->payload_len = htons(8 + sizeof(*mldq)); |
449 | ip6h->nexthdr = IPPROTO_HOPOPTS; | 449 | ip6h->nexthdr = IPPROTO_HOPOPTS; |
450 | ip6h->hop_limit = 1; | 450 | ip6h->hop_limit = 1; |
451 | ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); | 451 | ipv6_addr_set(&ip6h->saddr, 0, 0, 0, 0); |
diff --git a/net/core/sock.c b/net/core/sock.c index bcdb6ff6e621..a6b9e8061f34 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -1010,6 +1010,36 @@ static void sock_copy(struct sock *nsk, const struct sock *osk) | |||
1010 | #endif | 1010 | #endif |
1011 | } | 1011 | } |
1012 | 1012 | ||
1013 | /* | ||
1014 | * caches using SLAB_DESTROY_BY_RCU should let .next pointer from nulls nodes | ||
1015 | * un-modified. Special care is taken when initializing object to zero. | ||
1016 | */ | ||
1017 | static inline void sk_prot_clear_nulls(struct sock *sk, int size) | ||
1018 | { | ||
1019 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1020 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1021 | memset(&sk->sk_node.pprev, 0, | ||
1022 | size - offsetof(struct sock, sk_node.pprev)); | ||
1023 | } | ||
1024 | |||
1025 | void sk_prot_clear_portaddr_nulls(struct sock *sk, int size) | ||
1026 | { | ||
1027 | unsigned long nulls1, nulls2; | ||
1028 | |||
1029 | nulls1 = offsetof(struct sock, __sk_common.skc_node.next); | ||
1030 | nulls2 = offsetof(struct sock, __sk_common.skc_portaddr_node.next); | ||
1031 | if (nulls1 > nulls2) | ||
1032 | swap(nulls1, nulls2); | ||
1033 | |||
1034 | if (nulls1 != 0) | ||
1035 | memset((char *)sk, 0, nulls1); | ||
1036 | memset((char *)sk + nulls1 + sizeof(void *), 0, | ||
1037 | nulls2 - nulls1 - sizeof(void *)); | ||
1038 | memset((char *)sk + nulls2 + sizeof(void *), 0, | ||
1039 | size - nulls2 - sizeof(void *)); | ||
1040 | } | ||
1041 | EXPORT_SYMBOL(sk_prot_clear_portaddr_nulls); | ||
1042 | |||
1013 | static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | 1043 | static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, |
1014 | int family) | 1044 | int family) |
1015 | { | 1045 | { |
@@ -1022,19 +1052,12 @@ static struct sock *sk_prot_alloc(struct proto *prot, gfp_t priority, | |||
1022 | if (!sk) | 1052 | if (!sk) |
1023 | return sk; | 1053 | return sk; |
1024 | if (priority & __GFP_ZERO) { | 1054 | if (priority & __GFP_ZERO) { |
1025 | /* | 1055 | if (prot->clear_sk) |
1026 | * caches using SLAB_DESTROY_BY_RCU should let | 1056 | prot->clear_sk(sk, prot->obj_size); |
1027 | * sk_node.next un-modified. Special care is taken | 1057 | else |
1028 | * when initializing object to zero. | 1058 | sk_prot_clear_nulls(sk, prot->obj_size); |
1029 | */ | ||
1030 | if (offsetof(struct sock, sk_node.next) != 0) | ||
1031 | memset(sk, 0, offsetof(struct sock, sk_node.next)); | ||
1032 | memset(&sk->sk_node.pprev, 0, | ||
1033 | prot->obj_size - offsetof(struct sock, | ||
1034 | sk_node.pprev)); | ||
1035 | } | 1059 | } |
1036 | } | 1060 | } else |
1037 | else | ||
1038 | sk = kmalloc(prot->obj_size, priority); | 1061 | sk = kmalloc(prot->obj_size, priority); |
1039 | 1062 | ||
1040 | if (sk != NULL) { | 1063 | if (sk != NULL) { |
diff --git a/net/core/timestamping.c b/net/core/timestamping.c index b124d28ff1c8..7e7ca375d431 100644 --- a/net/core/timestamping.c +++ b/net/core/timestamping.c | |||
@@ -96,11 +96,13 @@ bool skb_defer_rx_timestamp(struct sk_buff *skb) | |||
96 | struct phy_device *phydev; | 96 | struct phy_device *phydev; |
97 | unsigned int type; | 97 | unsigned int type; |
98 | 98 | ||
99 | skb_push(skb, ETH_HLEN); | 99 | if (skb_headroom(skb) < ETH_HLEN) |
100 | return false; | ||
101 | __skb_push(skb, ETH_HLEN); | ||
100 | 102 | ||
101 | type = classify(skb); | 103 | type = classify(skb); |
102 | 104 | ||
103 | skb_pull(skb, ETH_HLEN); | 105 | __skb_pull(skb, ETH_HLEN); |
104 | 106 | ||
105 | switch (type) { | 107 | switch (type) { |
106 | case PTP_CLASS_V1_IPV4: | 108 | case PTP_CLASS_V1_IPV4: |
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c index f180371fa415..15dcc1a586b4 100644 --- a/net/econet/af_econet.c +++ b/net/econet/af_econet.c | |||
@@ -851,9 +851,13 @@ static void aun_incoming(struct sk_buff *skb, struct aunhdr *ah, size_t len) | |||
851 | { | 851 | { |
852 | struct iphdr *ip = ip_hdr(skb); | 852 | struct iphdr *ip = ip_hdr(skb); |
853 | unsigned char stn = ntohl(ip->saddr) & 0xff; | 853 | unsigned char stn = ntohl(ip->saddr) & 0xff; |
854 | struct dst_entry *dst = skb_dst(skb); | ||
855 | struct ec_device *edev = NULL; | ||
854 | struct sock *sk = NULL; | 856 | struct sock *sk = NULL; |
855 | struct sk_buff *newskb; | 857 | struct sk_buff *newskb; |
856 | struct ec_device *edev = skb->dev->ec_ptr; | 858 | |
859 | if (dst) | ||
860 | edev = dst->dev->ec_ptr; | ||
857 | 861 | ||
858 | if (! edev) | 862 | if (! edev) |
859 | goto bad; | 863 | goto bad; |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index 1198adf45102..8157b17959ee 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -1897,6 +1897,7 @@ struct proto udp_prot = { | |||
1897 | .compat_setsockopt = compat_udp_setsockopt, | 1897 | .compat_setsockopt = compat_udp_setsockopt, |
1898 | .compat_getsockopt = compat_udp_getsockopt, | 1898 | .compat_getsockopt = compat_udp_getsockopt, |
1899 | #endif | 1899 | #endif |
1900 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
1900 | }; | 1901 | }; |
1901 | EXPORT_SYMBOL(udp_prot); | 1902 | EXPORT_SYMBOL(udp_prot); |
1902 | 1903 | ||
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c index ab76aa928fa9..aee9963f7f5a 100644 --- a/net/ipv4/udplite.c +++ b/net/ipv4/udplite.c | |||
@@ -57,6 +57,7 @@ struct proto udplite_prot = { | |||
57 | .compat_setsockopt = compat_udp_setsockopt, | 57 | .compat_setsockopt = compat_udp_setsockopt, |
58 | .compat_getsockopt = compat_udp_getsockopt, | 58 | .compat_getsockopt = compat_udp_getsockopt, |
59 | #endif | 59 | #endif |
60 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
60 | }; | 61 | }; |
61 | EXPORT_SYMBOL(udplite_prot); | 62 | EXPORT_SYMBOL(udplite_prot); |
62 | 63 | ||
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index 1023ad0d2b15..99d1888af363 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -2669,7 +2669,9 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2669 | 2669 | ||
2670 | ASSERT_RTNL(); | 2670 | ASSERT_RTNL(); |
2671 | 2671 | ||
2672 | rt6_ifdown(net, dev); | 2672 | /* Flush routes if device is being removed or it is not loopback */ |
2673 | if (how || !(dev->flags & IFF_LOOPBACK)) | ||
2674 | rt6_ifdown(net, dev); | ||
2673 | neigh_ifdown(&nd_tbl, dev); | 2675 | neigh_ifdown(&nd_tbl, dev); |
2674 | 2676 | ||
2675 | idev = __in6_dev_get(dev); | 2677 | idev = __in6_dev_get(dev); |
@@ -4057,11 +4059,11 @@ void inet6_ifinfo_notify(int event, struct inet6_dev *idev) | |||
4057 | kfree_skb(skb); | 4059 | kfree_skb(skb); |
4058 | goto errout; | 4060 | goto errout; |
4059 | } | 4061 | } |
4060 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFADDR, NULL, GFP_ATOMIC); | 4062 | rtnl_notify(skb, net, 0, RTNLGRP_IPV6_IFINFO, NULL, GFP_ATOMIC); |
4061 | return; | 4063 | return; |
4062 | errout: | 4064 | errout: |
4063 | if (err < 0) | 4065 | if (err < 0) |
4064 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFADDR, err); | 4066 | rtnl_set_sk_err(net, RTNLGRP_IPV6_IFINFO, err); |
4065 | } | 4067 | } |
4066 | 4068 | ||
4067 | static inline size_t inet6_prefix_nlmsg_size(void) | 4069 | static inline size_t inet6_prefix_nlmsg_size(void) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index e7efb269a6e9..d5c3b45d829e 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1566,11 +1566,16 @@ static void rt6_do_pmtu_disc(struct in6_addr *daddr, struct in6_addr *saddr, | |||
1566 | { | 1566 | { |
1567 | struct rt6_info *rt, *nrt; | 1567 | struct rt6_info *rt, *nrt; |
1568 | int allfrag = 0; | 1568 | int allfrag = 0; |
1569 | 1569 | again: | |
1570 | rt = rt6_lookup(net, daddr, saddr, ifindex, 0); | 1570 | rt = rt6_lookup(net, daddr, saddr, ifindex, 0); |
1571 | if (rt == NULL) | 1571 | if (rt == NULL) |
1572 | return; | 1572 | return; |
1573 | 1573 | ||
1574 | if (rt6_check_expired(rt)) { | ||
1575 | ip6_del_rt(rt); | ||
1576 | goto again; | ||
1577 | } | ||
1578 | |||
1574 | if (pmtu >= dst_mtu(&rt->dst)) | 1579 | if (pmtu >= dst_mtu(&rt->dst)) |
1575 | goto out; | 1580 | goto out; |
1576 | 1581 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 26a8da3f2044..9a009c66c8a3 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1477,6 +1477,7 @@ struct proto udpv6_prot = { | |||
1477 | .compat_setsockopt = compat_udpv6_setsockopt, | 1477 | .compat_setsockopt = compat_udpv6_setsockopt, |
1478 | .compat_getsockopt = compat_udpv6_getsockopt, | 1478 | .compat_getsockopt = compat_udpv6_getsockopt, |
1479 | #endif | 1479 | #endif |
1480 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
1480 | }; | 1481 | }; |
1481 | 1482 | ||
1482 | static struct inet_protosw udpv6_protosw = { | 1483 | static struct inet_protosw udpv6_protosw = { |
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c index 5f48fadc27f7..986c4de5292e 100644 --- a/net/ipv6/udplite.c +++ b/net/ipv6/udplite.c | |||
@@ -55,6 +55,7 @@ struct proto udplitev6_prot = { | |||
55 | .compat_setsockopt = compat_udpv6_setsockopt, | 55 | .compat_setsockopt = compat_udpv6_setsockopt, |
56 | .compat_getsockopt = compat_udpv6_getsockopt, | 56 | .compat_getsockopt = compat_udpv6_getsockopt, |
57 | #endif | 57 | #endif |
58 | .clear_sk = sk_prot_clear_portaddr_nulls, | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | static struct inet_protosw udplite6_protosw = { | 61 | static struct inet_protosw udplite6_protosw = { |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index 410d104b1347..53c7077ffd4f 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -780,6 +780,9 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
780 | 780 | ||
781 | mutex_lock(&sdata->u.ibss.mtx); | 781 | mutex_lock(&sdata->u.ibss.mtx); |
782 | 782 | ||
783 | if (!sdata->u.ibss.ssid_len) | ||
784 | goto mgmt_out; /* not ready to merge yet */ | ||
785 | |||
783 | switch (fc & IEEE80211_FCTL_STYPE) { | 786 | switch (fc & IEEE80211_FCTL_STYPE) { |
784 | case IEEE80211_STYPE_PROBE_REQ: | 787 | case IEEE80211_STYPE_PROBE_REQ: |
785 | ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len); | 788 | ieee80211_rx_mgmt_probe_req(sdata, mgmt, skb->len); |
@@ -797,6 +800,7 @@ void ieee80211_ibss_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
797 | break; | 800 | break; |
798 | } | 801 | } |
799 | 802 | ||
803 | mgmt_out: | ||
800 | mutex_unlock(&sdata->u.ibss.mtx); | 804 | mutex_unlock(&sdata->u.ibss.mtx); |
801 | } | 805 | } |
802 | 806 | ||
diff --git a/net/mac80211/work.c b/net/mac80211/work.c index de43753076d2..36305e0d06ef 100644 --- a/net/mac80211/work.c +++ b/net/mac80211/work.c | |||
@@ -1074,11 +1074,13 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1074 | { | 1074 | { |
1075 | struct ieee80211_local *local = sdata->local; | 1075 | struct ieee80211_local *local = sdata->local; |
1076 | struct ieee80211_work *wk; | 1076 | struct ieee80211_work *wk; |
1077 | bool cleanup = false; | ||
1077 | 1078 | ||
1078 | mutex_lock(&local->mtx); | 1079 | mutex_lock(&local->mtx); |
1079 | list_for_each_entry(wk, &local->work_list, list) { | 1080 | list_for_each_entry(wk, &local->work_list, list) { |
1080 | if (wk->sdata != sdata) | 1081 | if (wk->sdata != sdata) |
1081 | continue; | 1082 | continue; |
1083 | cleanup = true; | ||
1082 | wk->type = IEEE80211_WORK_ABORT; | 1084 | wk->type = IEEE80211_WORK_ABORT; |
1083 | wk->started = true; | 1085 | wk->started = true; |
1084 | wk->timeout = jiffies; | 1086 | wk->timeout = jiffies; |
@@ -1086,7 +1088,8 @@ void ieee80211_work_purge(struct ieee80211_sub_if_data *sdata) | |||
1086 | mutex_unlock(&local->mtx); | 1088 | mutex_unlock(&local->mtx); |
1087 | 1089 | ||
1088 | /* run cleanups etc. */ | 1090 | /* run cleanups etc. */ |
1089 | ieee80211_work_work(&local->work_work); | 1091 | if (cleanup) |
1092 | ieee80211_work_work(&local->work_work); | ||
1090 | 1093 | ||
1091 | mutex_lock(&local->mtx); | 1094 | mutex_lock(&local->mtx); |
1092 | list_for_each_entry(wk, &local->work_list, list) { | 1095 | list_for_each_entry(wk, &local->work_list, list) { |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 842c7f3650b9..a09b0dd25f50 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2932,6 +2932,7 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
2932 | struct sctp_association *asoc = NULL; | 2932 | struct sctp_association *asoc = NULL; |
2933 | struct sctp_setpeerprim prim; | 2933 | struct sctp_setpeerprim prim; |
2934 | struct sctp_chunk *chunk; | 2934 | struct sctp_chunk *chunk; |
2935 | struct sctp_af *af; | ||
2935 | int err; | 2936 | int err; |
2936 | 2937 | ||
2937 | sp = sctp_sk(sk); | 2938 | sp = sctp_sk(sk); |
@@ -2959,6 +2960,13 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva | |||
2959 | if (!sctp_state(asoc, ESTABLISHED)) | 2960 | if (!sctp_state(asoc, ESTABLISHED)) |
2960 | return -ENOTCONN; | 2961 | return -ENOTCONN; |
2961 | 2962 | ||
2963 | af = sctp_get_af_specific(prim.sspp_addr.ss_family); | ||
2964 | if (!af) | ||
2965 | return -EINVAL; | ||
2966 | |||
2967 | if (!af->addr_valid((union sctp_addr *)&prim.sspp_addr, sp, NULL)) | ||
2968 | return -EADDRNOTAVAIL; | ||
2969 | |||
2962 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) | 2970 | if (!sctp_assoc_lookup_laddr(asoc, (union sctp_addr *)&prim.sspp_addr)) |
2963 | return -EADDRNOTAVAIL; | 2971 | return -EADDRNOTAVAIL; |
2964 | 2972 | ||
@@ -5045,7 +5053,7 @@ static int sctp_getsockopt_partial_delivery_point(struct sock *sk, int len, | |||
5045 | if (copy_to_user(optval, &val, len)) | 5053 | if (copy_to_user(optval, &val, len)) |
5046 | return -EFAULT; | 5054 | return -EFAULT; |
5047 | 5055 | ||
5048 | return -ENOTSUPP; | 5056 | return 0; |
5049 | } | 5057 | } |
5050 | 5058 | ||
5051 | /* | 5059 | /* |
diff --git a/net/socket.c b/net/socket.c index c898df76e924..c1663c0ff3d3 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -732,6 +732,21 @@ static int sock_recvmsg_nosec(struct socket *sock, struct msghdr *msg, | |||
732 | return ret; | 732 | return ret; |
733 | } | 733 | } |
734 | 734 | ||
735 | /** | ||
736 | * kernel_recvmsg - Receive a message from a socket (kernel space) | ||
737 | * @sock: The socket to receive the message from | ||
738 | * @msg: Received message | ||
739 | * @vec: Input s/g array for message data | ||
740 | * @num: Size of input s/g array | ||
741 | * @size: Number of bytes to read | ||
742 | * @flags: Message flags (MSG_DONTWAIT, etc...) | ||
743 | * | ||
744 | * On return the msg structure contains the scatter/gather array passed in the | ||
745 | * vec argument. The array is modified so that it consists of the unfilled | ||
746 | * portion of the original array. | ||
747 | * | ||
748 | * The returned value is the total number of bytes received, or an error. | ||
749 | */ | ||
735 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, | 750 | int kernel_recvmsg(struct socket *sock, struct msghdr *msg, |
736 | struct kvec *vec, size_t num, size_t size, int flags) | 751 | struct kvec *vec, size_t num, size_t size, int flags) |
737 | { | 752 | { |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index eb96ce52f178..220ebc05c7af 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -1268,7 +1268,7 @@ struct xfrm_state * xfrm_state_migrate(struct xfrm_state *x, | |||
1268 | 1268 | ||
1269 | return xc; | 1269 | return xc; |
1270 | error: | 1270 | error: |
1271 | kfree(xc); | 1271 | xfrm_state_put(xc); |
1272 | return NULL; | 1272 | return NULL; |
1273 | } | 1273 | } |
1274 | EXPORT_SYMBOL(xfrm_state_migrate); | 1274 | EXPORT_SYMBOL(xfrm_state_migrate); |