diff options
author | David S. Miller <davem@davemloft.net> | 2008-11-27 02:48:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-11-27 02:48:40 -0500 |
commit | 5b9ab2ec04ec1e1e53939768805612ac191d7ba2 (patch) | |
tree | 22d29905c148d2d743b3eccb585fbe60fb91e25a /net | |
parent | 851fd7bd88524bb4e20f3def3127cd9167d6d0cf (diff) | |
parent | 3ec192559033ed457f0d7856838654c100fc659f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/hp-plus.c
drivers/net/wireless/ath5k/base.c
drivers/net/wireless/ath9k/recv.c
net/wireless/reg.c
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_netfilter.c | 12 | ||||
-rw-r--r-- | net/core/skbuff.c | 2 | ||||
-rw-r--r-- | net/core/sock.c | 31 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 7 | ||||
-rw-r--r-- | net/mac80211/wext.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_core.c | 2 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 7 | ||||
-rw-r--r-- | net/rose/af_rose.c | 10 |
8 files changed, 52 insertions, 27 deletions
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index db6176d96e71..274194b78247 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -101,6 +101,17 @@ static inline __be16 pppoe_proto(const struct sk_buff *skb) | |||
101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ | 101 | pppoe_proto(skb) == htons(PPP_IPV6) && \ |
102 | brnf_filter_pppoe_tagged) | 102 | brnf_filter_pppoe_tagged) |
103 | 103 | ||
104 | static void fake_update_pmtu(struct dst_entry *dst, u32 mtu) | ||
105 | { | ||
106 | } | ||
107 | |||
108 | static struct dst_ops fake_dst_ops = { | ||
109 | .family = AF_INET, | ||
110 | .protocol = __constant_htons(ETH_P_IP), | ||
111 | .update_pmtu = fake_update_pmtu, | ||
112 | .entries = ATOMIC_INIT(0), | ||
113 | }; | ||
114 | |||
104 | /* | 115 | /* |
105 | * Initialize bogus route table used to keep netfilter happy. | 116 | * Initialize bogus route table used to keep netfilter happy. |
106 | * Currently, we fill in the PMTU entry because netfilter | 117 | * Currently, we fill in the PMTU entry because netfilter |
@@ -117,6 +128,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) | |||
117 | rt->u.dst.path = &rt->u.dst; | 128 | rt->u.dst.path = &rt->u.dst; |
118 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; | 129 | rt->u.dst.metrics[RTAX_MTU - 1] = 1500; |
119 | rt->u.dst.flags = DST_NOXFRM; | 130 | rt->u.dst.flags = DST_NOXFRM; |
131 | rt->u.dst.ops = &fake_dst_ops; | ||
120 | } | 132 | } |
121 | 133 | ||
122 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) | 134 | static inline struct rtable *bridge_parent_rtable(const struct net_device *dev) |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index e03d77d4c1c9..b1f628741f4c 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -149,7 +149,7 @@ void skb_under_panic(struct sk_buff *skb, int sz, void *here) | |||
149 | 149 | ||
150 | void skb_truesize_bug(struct sk_buff *skb) | 150 | void skb_truesize_bug(struct sk_buff *skb) |
151 | { | 151 | { |
152 | printk(KERN_ERR "SKB BUG: Invalid truesize (%u) " | 152 | WARN(net_ratelimit(), KERN_ERR "SKB BUG: Invalid truesize (%u) " |
153 | "len=%u, sizeof(sk_buff)=%Zd\n", | 153 | "len=%u, sizeof(sk_buff)=%Zd\n", |
154 | skb->truesize, skb->len, sizeof(struct sk_buff)); | 154 | skb->truesize, skb->len, sizeof(struct sk_buff)); |
155 | } | 155 | } |
diff --git a/net/core/sock.c b/net/core/sock.c index b28764558a7d..ac4f0e79226b 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2043,9 +2043,6 @@ static inline void release_proto_idx(struct proto *prot) | |||
2043 | 2043 | ||
2044 | int proto_register(struct proto *prot, int alloc_slab) | 2044 | int proto_register(struct proto *prot, int alloc_slab) |
2045 | { | 2045 | { |
2046 | char *request_sock_slab_name = NULL; | ||
2047 | char *timewait_sock_slab_name; | ||
2048 | |||
2049 | if (alloc_slab) { | 2046 | if (alloc_slab) { |
2050 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, | 2047 | prot->slab = kmem_cache_create(prot->name, prot->obj_size, 0, |
2051 | SLAB_HWCACHE_ALIGN | prot->slab_flags, | 2048 | SLAB_HWCACHE_ALIGN | prot->slab_flags, |
@@ -2060,12 +2057,12 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2060 | if (prot->rsk_prot != NULL) { | 2057 | if (prot->rsk_prot != NULL) { |
2061 | static const char mask[] = "request_sock_%s"; | 2058 | static const char mask[] = "request_sock_%s"; |
2062 | 2059 | ||
2063 | request_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); | 2060 | prot->rsk_prot->slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); |
2064 | if (request_sock_slab_name == NULL) | 2061 | if (prot->rsk_prot->slab_name == NULL) |
2065 | goto out_free_sock_slab; | 2062 | goto out_free_sock_slab; |
2066 | 2063 | ||
2067 | sprintf(request_sock_slab_name, mask, prot->name); | 2064 | sprintf(prot->rsk_prot->slab_name, mask, prot->name); |
2068 | prot->rsk_prot->slab = kmem_cache_create(request_sock_slab_name, | 2065 | prot->rsk_prot->slab = kmem_cache_create(prot->rsk_prot->slab_name, |
2069 | prot->rsk_prot->obj_size, 0, | 2066 | prot->rsk_prot->obj_size, 0, |
2070 | SLAB_HWCACHE_ALIGN, NULL); | 2067 | SLAB_HWCACHE_ALIGN, NULL); |
2071 | 2068 | ||
@@ -2079,14 +2076,14 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2079 | if (prot->twsk_prot != NULL) { | 2076 | if (prot->twsk_prot != NULL) { |
2080 | static const char mask[] = "tw_sock_%s"; | 2077 | static const char mask[] = "tw_sock_%s"; |
2081 | 2078 | ||
2082 | timewait_sock_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); | 2079 | prot->twsk_prot->twsk_slab_name = kmalloc(strlen(prot->name) + sizeof(mask) - 1, GFP_KERNEL); |
2083 | 2080 | ||
2084 | if (timewait_sock_slab_name == NULL) | 2081 | if (prot->twsk_prot->twsk_slab_name == NULL) |
2085 | goto out_free_request_sock_slab; | 2082 | goto out_free_request_sock_slab; |
2086 | 2083 | ||
2087 | sprintf(timewait_sock_slab_name, mask, prot->name); | 2084 | sprintf(prot->twsk_prot->twsk_slab_name, mask, prot->name); |
2088 | prot->twsk_prot->twsk_slab = | 2085 | prot->twsk_prot->twsk_slab = |
2089 | kmem_cache_create(timewait_sock_slab_name, | 2086 | kmem_cache_create(prot->twsk_prot->twsk_slab_name, |
2090 | prot->twsk_prot->twsk_obj_size, | 2087 | prot->twsk_prot->twsk_obj_size, |
2091 | 0, | 2088 | 0, |
2092 | SLAB_HWCACHE_ALIGN | | 2089 | SLAB_HWCACHE_ALIGN | |
@@ -2104,14 +2101,14 @@ int proto_register(struct proto *prot, int alloc_slab) | |||
2104 | return 0; | 2101 | return 0; |
2105 | 2102 | ||
2106 | out_free_timewait_sock_slab_name: | 2103 | out_free_timewait_sock_slab_name: |
2107 | kfree(timewait_sock_slab_name); | 2104 | kfree(prot->twsk_prot->twsk_slab_name); |
2108 | out_free_request_sock_slab: | 2105 | out_free_request_sock_slab: |
2109 | if (prot->rsk_prot && prot->rsk_prot->slab) { | 2106 | if (prot->rsk_prot && prot->rsk_prot->slab) { |
2110 | kmem_cache_destroy(prot->rsk_prot->slab); | 2107 | kmem_cache_destroy(prot->rsk_prot->slab); |
2111 | prot->rsk_prot->slab = NULL; | 2108 | prot->rsk_prot->slab = NULL; |
2112 | } | 2109 | } |
2113 | out_free_request_sock_slab_name: | 2110 | out_free_request_sock_slab_name: |
2114 | kfree(request_sock_slab_name); | 2111 | kfree(prot->rsk_prot->slab_name); |
2115 | out_free_sock_slab: | 2112 | out_free_sock_slab: |
2116 | kmem_cache_destroy(prot->slab); | 2113 | kmem_cache_destroy(prot->slab); |
2117 | prot->slab = NULL; | 2114 | prot->slab = NULL; |
@@ -2134,18 +2131,14 @@ void proto_unregister(struct proto *prot) | |||
2134 | } | 2131 | } |
2135 | 2132 | ||
2136 | if (prot->rsk_prot != NULL && prot->rsk_prot->slab != NULL) { | 2133 | if (prot->rsk_prot != NULL && prot->rsk_prot->slab != NULL) { |
2137 | const char *name = kmem_cache_name(prot->rsk_prot->slab); | ||
2138 | |||
2139 | kmem_cache_destroy(prot->rsk_prot->slab); | 2134 | kmem_cache_destroy(prot->rsk_prot->slab); |
2140 | kfree(name); | 2135 | kfree(prot->rsk_prot->slab_name); |
2141 | prot->rsk_prot->slab = NULL; | 2136 | prot->rsk_prot->slab = NULL; |
2142 | } | 2137 | } |
2143 | 2138 | ||
2144 | if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) { | 2139 | if (prot->twsk_prot != NULL && prot->twsk_prot->twsk_slab != NULL) { |
2145 | const char *name = kmem_cache_name(prot->twsk_prot->twsk_slab); | ||
2146 | |||
2147 | kmem_cache_destroy(prot->twsk_prot->twsk_slab); | 2140 | kmem_cache_destroy(prot->twsk_prot->twsk_slab); |
2148 | kfree(name); | 2141 | kfree(prot->twsk_prot->twsk_slab_name); |
2149 | prot->twsk_prot->twsk_slab = NULL; | 2142 | prot->twsk_prot->twsk_slab = NULL; |
2150 | } | 2143 | } |
2151 | } | 2144 | } |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index c069ecb81ea5..76f840917bcb 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -722,7 +722,8 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
722 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, | 722 | static void tcp_set_skb_tso_segs(struct sock *sk, struct sk_buff *skb, |
723 | unsigned int mss_now) | 723 | unsigned int mss_now) |
724 | { | 724 | { |
725 | if (skb->len <= mss_now || !sk_can_gso(sk)) { | 725 | if (skb->len <= mss_now || !sk_can_gso(sk) || |
726 | tcp_urg_mode(tcp_sk(sk))) { | ||
726 | /* Avoid the costly divide in the normal | 727 | /* Avoid the costly divide in the normal |
727 | * non-TSO case. | 728 | * non-TSO case. |
728 | */ | 729 | */ |
@@ -1163,7 +1164,9 @@ static int tcp_init_tso_segs(struct sock *sk, struct sk_buff *skb, | |||
1163 | { | 1164 | { |
1164 | int tso_segs = tcp_skb_pcount(skb); | 1165 | int tso_segs = tcp_skb_pcount(skb); |
1165 | 1166 | ||
1166 | if (!tso_segs || (tso_segs > 1 && tcp_skb_mss(skb) != mss_now)) { | 1167 | if (!tso_segs || |
1168 | (tso_segs > 1 && (tcp_skb_mss(skb) != mss_now || | ||
1169 | tcp_urg_mode(tcp_sk(sk))))) { | ||
1167 | tcp_set_skb_tso_segs(sk, skb, mss_now); | 1170 | tcp_set_skb_tso_segs(sk, skb, mss_now); |
1168 | tso_segs = tcp_skb_pcount(skb); | 1171 | tso_segs = tcp_skb_pcount(skb); |
1169 | } | 1172 | } |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index 63f36e9d1af8..b3ce28d35611 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -271,6 +271,7 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
271 | __u32 *mode, char *extra) | 271 | __u32 *mode, char *extra) |
272 | { | 272 | { |
273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | 273 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); |
274 | struct ieee80211_local *local = sdata->local; | ||
274 | int type; | 275 | int type; |
275 | 276 | ||
276 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | 277 | if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
@@ -281,6 +282,13 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev, | |||
281 | type = NL80211_IFTYPE_STATION; | 282 | type = NL80211_IFTYPE_STATION; |
282 | break; | 283 | break; |
283 | case IW_MODE_ADHOC: | 284 | case IW_MODE_ADHOC: |
285 | /* Setting ad-hoc mode on non ibss channel is not | ||
286 | * supported. | ||
287 | */ | ||
288 | if (local->oper_channel && | ||
289 | (local->oper_channel->flags & IEEE80211_CHAN_NO_IBSS)) | ||
290 | return -EOPNOTSUPP; | ||
291 | |||
284 | type = NL80211_IFTYPE_ADHOC; | 292 | type = NL80211_IFTYPE_ADHOC; |
285 | break; | 293 | break; |
286 | case IW_MODE_REPEAT: | 294 | case IW_MODE_REPEAT: |
diff --git a/net/netfilter/nf_conntrack_core.c b/net/netfilter/nf_conntrack_core.c index 622d7c671cb7..233fdd2d7d21 100644 --- a/net/netfilter/nf_conntrack_core.c +++ b/net/netfilter/nf_conntrack_core.c | |||
@@ -305,9 +305,7 @@ void nf_conntrack_hash_insert(struct nf_conn *ct) | |||
305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); | 305 | hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple); |
306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); | 306 | repl_hash = hash_conntrack(&ct->tuplehash[IP_CT_DIR_REPLY].tuple); |
307 | 307 | ||
308 | spin_lock_bh(&nf_conntrack_lock); | ||
309 | __nf_conntrack_hash_insert(ct, hash, repl_hash); | 308 | __nf_conntrack_hash_insert(ct, hash, repl_hash); |
310 | spin_unlock_bh(&nf_conntrack_lock); | ||
311 | } | 309 | } |
312 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); | 310 | EXPORT_SYMBOL_GPL(nf_conntrack_hash_insert); |
313 | 311 | ||
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index a040d46f85d6..5f4a6516b3b6 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -1090,7 +1090,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1090 | struct nf_conn_help *help; | 1090 | struct nf_conn_help *help; |
1091 | struct nf_conntrack_helper *helper; | 1091 | struct nf_conntrack_helper *helper; |
1092 | 1092 | ||
1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_KERNEL); | 1093 | ct = nf_conntrack_alloc(&init_net, otuple, rtuple, GFP_ATOMIC); |
1094 | if (ct == NULL || IS_ERR(ct)) | 1094 | if (ct == NULL || IS_ERR(ct)) |
1095 | return -ENOMEM; | 1095 | return -ENOMEM; |
1096 | 1096 | ||
@@ -1138,7 +1138,7 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1138 | } | 1138 | } |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | nf_ct_acct_ext_add(ct, GFP_KERNEL); | 1141 | nf_ct_acct_ext_add(ct, GFP_ATOMIC); |
1142 | 1142 | ||
1143 | #if defined(CONFIG_NF_CONNTRACK_MARK) | 1143 | #if defined(CONFIG_NF_CONNTRACK_MARK) |
1144 | if (cda[CTA_MARK]) | 1144 | if (cda[CTA_MARK]) |
@@ -1212,13 +1212,14 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb, | |||
1212 | atomic_inc(&master_ct->ct_general.use); | 1212 | atomic_inc(&master_ct->ct_general.use); |
1213 | } | 1213 | } |
1214 | 1214 | ||
1215 | spin_unlock_bh(&nf_conntrack_lock); | ||
1216 | err = -ENOENT; | 1215 | err = -ENOENT; |
1217 | if (nlh->nlmsg_flags & NLM_F_CREATE) | 1216 | if (nlh->nlmsg_flags & NLM_F_CREATE) |
1218 | err = ctnetlink_create_conntrack(cda, | 1217 | err = ctnetlink_create_conntrack(cda, |
1219 | &otuple, | 1218 | &otuple, |
1220 | &rtuple, | 1219 | &rtuple, |
1221 | master_ct); | 1220 | master_ct); |
1221 | spin_unlock_bh(&nf_conntrack_lock); | ||
1222 | |||
1222 | if (err < 0 && master_ct) | 1223 | if (err < 0 && master_ct) |
1223 | nf_ct_put(master_ct); | 1224 | nf_ct_put(master_ct); |
1224 | 1225 | ||
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index a7f1ce11bc22..0c1cc7612800 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1072,6 +1072,10 @@ static int rose_sendmsg(struct kiocb *iocb, struct socket *sock, | |||
1072 | unsigned char *asmptr; | 1072 | unsigned char *asmptr; |
1073 | int n, size, qbit = 0; | 1073 | int n, size, qbit = 0; |
1074 | 1074 | ||
1075 | /* ROSE empty frame has no meaning : don't send */ | ||
1076 | if (len == 0) | ||
1077 | return 0; | ||
1078 | |||
1075 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) | 1079 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_CMSG_COMPAT)) |
1076 | return -EINVAL; | 1080 | return -EINVAL; |
1077 | 1081 | ||
@@ -1265,6 +1269,12 @@ static int rose_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1265 | skb_reset_transport_header(skb); | 1269 | skb_reset_transport_header(skb); |
1266 | copied = skb->len; | 1270 | copied = skb->len; |
1267 | 1271 | ||
1272 | /* ROSE empty frame has no meaning : ignore it */ | ||
1273 | if (copied == 0) { | ||
1274 | skb_free_datagram(sk, skb); | ||
1275 | return copied; | ||
1276 | } | ||
1277 | |||
1268 | if (copied > size) { | 1278 | if (copied > size) { |
1269 | copied = size; | 1279 | copied = size; |
1270 | msg->msg_flags |= MSG_TRUNC; | 1280 | msg->msg_flags |= MSG_TRUNC; |