diff options
author | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-25 22:26:14 -0500 |
---|---|---|
committer | Lachlan McIlroy <lachlan@redback.melbourne.sgi.com> | 2008-02-25 22:26:14 -0500 |
commit | 91e229bbad6524aabaac8717b2f559283670c37a (patch) | |
tree | 84a55e4ac2dcf23add97bd9fde3e9cb232c12b30 /net/ipv4 | |
parent | 6e5e93424dc66542c548dfaa3bfebe30d46d50dd (diff) | |
parent | bfa274e2436fc7ef72ef51c878083647f1cfd429 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/arp.c | 3 | ||||
-rw-r--r-- | net/ipv4/fib_hash.c | 10 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 12 | ||||
-rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
-rw-r--r-- | net/ipv4/ipip.c | 12 | ||||
-rw-r--r-- | net/ipv4/netfilter/arpt_mangle.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/ip_queue.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 2 |
8 files changed, 22 insertions, 33 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index c663fa5339ee..8e17f65f4002 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -368,6 +368,7 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
368 | if (!(neigh->nud_state&NUD_VALID)) | 368 | if (!(neigh->nud_state&NUD_VALID)) |
369 | printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n"); | 369 | printk(KERN_DEBUG "trying to ucast probe in NUD_INVALID\n"); |
370 | dst_ha = neigh->ha; | 370 | dst_ha = neigh->ha; |
371 | read_lock_bh(&neigh->lock); | ||
371 | } else if ((probes -= neigh->parms->app_probes) < 0) { | 372 | } else if ((probes -= neigh->parms->app_probes) < 0) { |
372 | #ifdef CONFIG_ARPD | 373 | #ifdef CONFIG_ARPD |
373 | neigh_app_ns(neigh); | 374 | neigh_app_ns(neigh); |
@@ -377,6 +378,8 @@ static void arp_solicit(struct neighbour *neigh, struct sk_buff *skb) | |||
377 | 378 | ||
378 | arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, | 379 | arp_send(ARPOP_REQUEST, ETH_P_ARP, target, dev, saddr, |
379 | dst_ha, dev->dev_addr, NULL); | 380 | dst_ha, dev->dev_addr, NULL); |
381 | if (dst_ha) | ||
382 | read_unlock_bh(&neigh->lock); | ||
380 | } | 383 | } |
381 | 384 | ||
382 | static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) | 385 | static int arp_ignore(struct in_device *in_dev, __be32 sip, __be32 tip) |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 76b9c684cccd..8d58d85dfac6 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -372,7 +372,8 @@ static struct fib_node *fib_find_node(struct fn_zone *fz, __be32 key) | |||
372 | static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | 372 | static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) |
373 | { | 373 | { |
374 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; | 374 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; |
375 | struct fib_node *new_f, *f; | 375 | struct fib_node *new_f = NULL; |
376 | struct fib_node *f; | ||
376 | struct fib_alias *fa, *new_fa; | 377 | struct fib_alias *fa, *new_fa; |
377 | struct fn_zone *fz; | 378 | struct fn_zone *fz; |
378 | struct fib_info *fi; | 379 | struct fib_info *fi; |
@@ -496,7 +497,6 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
496 | 497 | ||
497 | err = -ENOBUFS; | 498 | err = -ENOBUFS; |
498 | 499 | ||
499 | new_f = NULL; | ||
500 | if (!f) { | 500 | if (!f) { |
501 | new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL); | 501 | new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL); |
502 | if (new_f == NULL) | 502 | if (new_f == NULL) |
@@ -512,7 +512,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
512 | if (new_fa->fa_info != NULL) { | 512 | if (new_fa->fa_info != NULL) { |
513 | new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); | 513 | new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); |
514 | if (new_fa == NULL) | 514 | if (new_fa == NULL) |
515 | goto out_free_new_f; | 515 | goto out; |
516 | } | 516 | } |
517 | new_fa->fa_info = fi; | 517 | new_fa->fa_info = fi; |
518 | new_fa->fa_tos = tos; | 518 | new_fa->fa_tos = tos; |
@@ -540,9 +540,9 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
540 | &cfg->fc_nlinfo, 0); | 540 | &cfg->fc_nlinfo, 0); |
541 | return 0; | 541 | return 0; |
542 | 542 | ||
543 | out_free_new_f: | ||
544 | kmem_cache_free(fn_hash_kmem, new_f); | ||
545 | out: | 543 | out: |
544 | if (new_f) | ||
545 | kmem_cache_free(fn_hash_kmem, new_f); | ||
546 | fib_release_info(fi); | 546 | fib_release_info(fi); |
547 | return err; | 547 | return err; |
548 | } | 548 | } |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 63f691719353..906cb1ada4c3 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -259,16 +259,8 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int | |||
259 | 259 | ||
260 | if (parms->name[0]) | 260 | if (parms->name[0]) |
261 | strlcpy(name, parms->name, IFNAMSIZ); | 261 | strlcpy(name, parms->name, IFNAMSIZ); |
262 | else { | 262 | else |
263 | int i; | 263 | sprintf(name, "gre%%d"); |
264 | for (i=1; i<100; i++) { | ||
265 | sprintf(name, "gre%d", i); | ||
266 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
267 | break; | ||
268 | } | ||
269 | if (i==100) | ||
270 | goto failed; | ||
271 | } | ||
272 | 264 | ||
273 | dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); | 265 | dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); |
274 | if (!dev) | 266 | if (!dev) |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index a52b5853aaa8..10013ccee8dd 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
@@ -1390,7 +1390,7 @@ static int __init ip_auto_config(void) | |||
1390 | * Clue in the operator. | 1390 | * Clue in the operator. |
1391 | */ | 1391 | */ |
1392 | printk("IP-Config: Complete:"); | 1392 | printk("IP-Config: Complete:"); |
1393 | printk("\n device=%s", ic_dev->name); | 1393 | printk("\n device=%s", ic_dev->name); |
1394 | printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr)); | 1394 | printk(", addr=%u.%u.%u.%u", NIPQUAD(ic_myaddr)); |
1395 | printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask)); | 1395 | printk(", mask=%u.%u.%u.%u", NIPQUAD(ic_netmask)); |
1396 | printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway)); | 1396 | printk(", gw=%u.%u.%u.%u", NIPQUAD(ic_gateway)); |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index da281581692c..e77e3b855834 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -221,16 +221,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c | |||
221 | 221 | ||
222 | if (parms->name[0]) | 222 | if (parms->name[0]) |
223 | strlcpy(name, parms->name, IFNAMSIZ); | 223 | strlcpy(name, parms->name, IFNAMSIZ); |
224 | else { | 224 | else |
225 | int i; | 225 | sprintf(name, "tunl%%d"); |
226 | for (i=1; i<100; i++) { | ||
227 | sprintf(name, "tunl%d", i); | ||
228 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
229 | break; | ||
230 | } | ||
231 | if (i==100) | ||
232 | goto failed; | ||
233 | } | ||
234 | 226 | ||
235 | dev = alloc_netdev(sizeof(*t), name, ipip_tunnel_setup); | 227 | dev = alloc_netdev(sizeof(*t), name, ipip_tunnel_setup); |
236 | if (dev == NULL) | 228 | if (dev == NULL) |
diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c index 45fa4e20094a..3f4222b0a803 100644 --- a/net/ipv4/netfilter/arpt_mangle.c +++ b/net/ipv4/netfilter/arpt_mangle.c | |||
@@ -19,7 +19,7 @@ target(struct sk_buff *skb, | |||
19 | unsigned char *arpptr; | 19 | unsigned char *arpptr; |
20 | int pln, hln; | 20 | int pln, hln; |
21 | 21 | ||
22 | if (skb_make_writable(skb, skb->len)) | 22 | if (!skb_make_writable(skb, skb->len)) |
23 | return NF_DROP; | 23 | return NF_DROP; |
24 | 24 | ||
25 | arp = arp_hdr(skb); | 25 | arp = arp_hdr(skb); |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 6bda1102851b..fe05da41d6ba 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -283,8 +283,8 @@ static int | |||
283 | ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | 283 | ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) |
284 | { | 284 | { |
285 | int diff; | 285 | int diff; |
286 | int err; | ||
287 | struct iphdr *user_iph = (struct iphdr *)v->payload; | 286 | struct iphdr *user_iph = (struct iphdr *)v->payload; |
287 | struct sk_buff *nskb; | ||
288 | 288 | ||
289 | if (v->data_len < sizeof(*user_iph)) | 289 | if (v->data_len < sizeof(*user_iph)) |
290 | return 0; | 290 | return 0; |
@@ -296,14 +296,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | |||
296 | if (v->data_len > 0xFFFF) | 296 | if (v->data_len > 0xFFFF) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | if (diff > skb_tailroom(e->skb)) { | 298 | if (diff > skb_tailroom(e->skb)) { |
299 | err = pskb_expand_head(e->skb, 0, | 299 | nskb = skb_copy_expand(e->skb, 0, |
300 | diff - skb_tailroom(e->skb), | 300 | diff - skb_tailroom(e->skb), |
301 | GFP_ATOMIC); | 301 | GFP_ATOMIC); |
302 | if (err) { | 302 | if (!nskb) { |
303 | printk(KERN_WARNING "ip_queue: error " | 303 | printk(KERN_WARNING "ip_queue: error " |
304 | "in mangle, dropping packet: %d\n", -err); | 304 | "in mangle, dropping packet\n"); |
305 | return err; | 305 | return -ENOMEM; |
306 | } | 306 | } |
307 | kfree_skb(e->skb); | ||
308 | e->skb = nskb; | ||
307 | } | 309 | } |
308 | skb_put(e->skb, diff); | 310 | skb_put(e->skb, diff); |
309 | } | 311 | } |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 63414ea427c5..00156bf421ca 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -719,7 +719,7 @@ static void tcp_v4_reqsk_send_ack(struct sk_buff *skb, | |||
719 | } | 719 | } |
720 | 720 | ||
721 | /* | 721 | /* |
722 | * Send a SYN-ACK after having received an ACK. | 722 | * Send a SYN-ACK after having received a SYN. |
723 | * This still operates on a request_sock only, not on a big | 723 | * This still operates on a request_sock only, not on a big |
724 | * socket. | 724 | * socket. |
725 | */ | 725 | */ |