diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-10-24 06:48:46 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-10-24 06:48:46 -0400 |
commit | 8c82a17e9c924c0e9f13e75e4c2f6bca19a4b516 (patch) | |
tree | d535f46a917e14e90deccb29ad00aac016ad18dd /net/ipv4 | |
parent | 4ce72a2c063a7fa8e42a9435440ae3364115a58d (diff) | |
parent | 57f8f7b60db6f1ed2c6918ab9230c4623a9dbe37 (diff) |
Merge commit 'v2.6.28-rc1' into sched/urgent
Diffstat (limited to 'net/ipv4')
-rw-r--r-- | net/ipv4/arp.c | 4 | ||||
-rw-r--r-- | net/ipv4/devinet.c | 2 | ||||
-rw-r--r-- | net/ipv4/inet_diag.c | 2 | ||||
-rw-r--r-- | net/ipv4/netfilter/nf_nat_snmp_basic.c | 1 | ||||
-rw-r--r-- | net/ipv4/route.c | 7 | ||||
-rw-r--r-- | net/ipv4/tcp_cong.c | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 25 |
7 files changed, 29 insertions, 16 deletions
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c index b043eda60b04..1a9dd66511fc 100644 --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c | |||
@@ -663,7 +663,7 @@ out: | |||
663 | void arp_xmit(struct sk_buff *skb) | 663 | void arp_xmit(struct sk_buff *skb) |
664 | { | 664 | { |
665 | /* Send it off, maybe filter it using firewalling first. */ | 665 | /* Send it off, maybe filter it using firewalling first. */ |
666 | NF_HOOK(NF_ARP, NF_ARP_OUT, skb, NULL, skb->dev, dev_queue_xmit); | 666 | NF_HOOK(NFPROTO_ARP, NF_ARP_OUT, skb, NULL, skb->dev, dev_queue_xmit); |
667 | } | 667 | } |
668 | 668 | ||
669 | /* | 669 | /* |
@@ -928,7 +928,7 @@ static int arp_rcv(struct sk_buff *skb, struct net_device *dev, | |||
928 | 928 | ||
929 | memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb)); | 929 | memset(NEIGH_CB(skb), 0, sizeof(struct neighbour_cb)); |
930 | 930 | ||
931 | return NF_HOOK(NF_ARP, NF_ARP_IN, skb, dev, NULL, arp_process); | 931 | return NF_HOOK(NFPROTO_ARP, NF_ARP_IN, skb, dev, NULL, arp_process); |
932 | 932 | ||
933 | freeskb: | 933 | freeskb: |
934 | kfree_skb(skb); | 934 | kfree_skb(skb); |
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c index 5154e729cf16..56fce3ab6c55 100644 --- a/net/ipv4/devinet.c +++ b/net/ipv4/devinet.c | |||
@@ -613,9 +613,7 @@ int devinet_ioctl(struct net *net, unsigned int cmd, void __user *arg) | |||
613 | if (colon) | 613 | if (colon) |
614 | *colon = 0; | 614 | *colon = 0; |
615 | 615 | ||
616 | #ifdef CONFIG_KMOD | ||
617 | dev_load(net, ifr.ifr_name); | 616 | dev_load(net, ifr.ifr_name); |
618 | #endif | ||
619 | 617 | ||
620 | switch (cmd) { | 618 | switch (cmd) { |
621 | case SIOCGIFADDR: /* Get interface address */ | 619 | case SIOCGIFADDR: /* Get interface address */ |
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c index 89cb047ab314..564230dabcb8 100644 --- a/net/ipv4/inet_diag.c +++ b/net/ipv4/inet_diag.c | |||
@@ -53,11 +53,9 @@ static DEFINE_MUTEX(inet_diag_table_mutex); | |||
53 | 53 | ||
54 | static const struct inet_diag_handler *inet_diag_lock_handler(int type) | 54 | static const struct inet_diag_handler *inet_diag_lock_handler(int type) |
55 | { | 55 | { |
56 | #ifdef CONFIG_KMOD | ||
57 | if (!inet_diag_table[type]) | 56 | if (!inet_diag_table[type]) |
58 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, | 57 | request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, |
59 | NETLINK_INET_DIAG, type); | 58 | NETLINK_INET_DIAG, type); |
60 | #endif | ||
61 | 59 | ||
62 | mutex_lock(&inet_diag_table_mutex); | 60 | mutex_lock(&inet_diag_table_mutex); |
63 | if (!inet_diag_table[type]) | 61 | if (!inet_diag_table[type]) |
diff --git a/net/ipv4/netfilter/nf_nat_snmp_basic.c b/net/ipv4/netfilter/nf_nat_snmp_basic.c index ffeaffc3fffe..8303e4b406c0 100644 --- a/net/ipv4/netfilter/nf_nat_snmp_basic.c +++ b/net/ipv4/netfilter/nf_nat_snmp_basic.c | |||
@@ -742,6 +742,7 @@ static unsigned char snmp_object_decode(struct asn1_ctx *ctx, | |||
742 | *obj = kmalloc(sizeof(struct snmp_object) + len, | 742 | *obj = kmalloc(sizeof(struct snmp_object) + len, |
743 | GFP_ATOMIC); | 743 | GFP_ATOMIC); |
744 | if (*obj == NULL) { | 744 | if (*obj == NULL) { |
745 | kfree(p); | ||
745 | kfree(id); | 746 | kfree(id); |
746 | if (net_ratelimit()) | 747 | if (net_ratelimit()) |
747 | printk("OOM in bsalg (%d)\n", __LINE__); | 748 | printk("OOM in bsalg (%d)\n", __LINE__); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 942be04e7955..2ea6dcc3e2cc 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1109,7 +1109,12 @@ restart: | |||
1109 | printk("\n"); | 1109 | printk("\n"); |
1110 | } | 1110 | } |
1111 | #endif | 1111 | #endif |
1112 | rt_hash_table[hash].chain = rt; | 1112 | /* |
1113 | * Since lookup is lockfree, we must make sure | ||
1114 | * previous writes to rt are comitted to memory | ||
1115 | * before making rt visible to other CPUS. | ||
1116 | */ | ||
1117 | rcu_assign_pointer(rt_hash_table[hash].chain, rt); | ||
1113 | spin_unlock_bh(rt_hash_lock_addr(hash)); | 1118 | spin_unlock_bh(rt_hash_lock_addr(hash)); |
1114 | *rp = rt; | 1119 | *rp = rt; |
1115 | return 0; | 1120 | return 0; |
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 6a250828b767..4ec5b4e97c4e 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
@@ -115,7 +115,7 @@ int tcp_set_default_congestion_control(const char *name) | |||
115 | 115 | ||
116 | spin_lock(&tcp_cong_list_lock); | 116 | spin_lock(&tcp_cong_list_lock); |
117 | ca = tcp_ca_find(name); | 117 | ca = tcp_ca_find(name); |
118 | #ifdef CONFIG_KMOD | 118 | #ifdef CONFIG_MODULES |
119 | if (!ca && capable(CAP_SYS_MODULE)) { | 119 | if (!ca && capable(CAP_SYS_MODULE)) { |
120 | spin_unlock(&tcp_cong_list_lock); | 120 | spin_unlock(&tcp_cong_list_lock); |
121 | 121 | ||
@@ -244,7 +244,7 @@ int tcp_set_congestion_control(struct sock *sk, const char *name) | |||
244 | if (ca == icsk->icsk_ca_ops) | 244 | if (ca == icsk->icsk_ca_ops) |
245 | goto out; | 245 | goto out; |
246 | 246 | ||
247 | #ifdef CONFIG_KMOD | 247 | #ifdef CONFIG_MODULES |
248 | /* not found attempt to autoload module */ | 248 | /* not found attempt to autoload module */ |
249 | if (!ca && capable(CAP_SYS_MODULE)) { | 249 | if (!ca && capable(CAP_SYS_MODULE)) { |
250 | rcu_read_unlock(); | 250 | rcu_read_unlock(); |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 990a58493235..e4c5ac9fe89b 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -362,6 +362,17 @@ struct tcp_out_options { | |||
362 | __u32 tsval, tsecr; /* need to include OPTION_TS */ | 362 | __u32 tsval, tsecr; /* need to include OPTION_TS */ |
363 | }; | 363 | }; |
364 | 364 | ||
365 | /* Beware: Something in the Internet is very sensitive to the ordering of | ||
366 | * TCP options, we learned this through the hard way, so be careful here. | ||
367 | * Luckily we can at least blame others for their non-compliance but from | ||
368 | * inter-operatibility perspective it seems that we're somewhat stuck with | ||
369 | * the ordering which we have been using if we want to keep working with | ||
370 | * those broken things (not that it currently hurts anybody as there isn't | ||
371 | * particular reason why the ordering would need to be changed). | ||
372 | * | ||
373 | * At least SACK_PERM as the first option is known to lead to a disaster | ||
374 | * (but it may well be that other scenarios fail similarly). | ||
375 | */ | ||
365 | static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, | 376 | static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, |
366 | const struct tcp_out_options *opts, | 377 | const struct tcp_out_options *opts, |
367 | __u8 **md5_hash) { | 378 | __u8 **md5_hash) { |
@@ -376,6 +387,12 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, | |||
376 | *md5_hash = NULL; | 387 | *md5_hash = NULL; |
377 | } | 388 | } |
378 | 389 | ||
390 | if (unlikely(opts->mss)) { | ||
391 | *ptr++ = htonl((TCPOPT_MSS << 24) | | ||
392 | (TCPOLEN_MSS << 16) | | ||
393 | opts->mss); | ||
394 | } | ||
395 | |||
379 | if (likely(OPTION_TS & opts->options)) { | 396 | if (likely(OPTION_TS & opts->options)) { |
380 | if (unlikely(OPTION_SACK_ADVERTISE & opts->options)) { | 397 | if (unlikely(OPTION_SACK_ADVERTISE & opts->options)) { |
381 | *ptr++ = htonl((TCPOPT_SACK_PERM << 24) | | 398 | *ptr++ = htonl((TCPOPT_SACK_PERM << 24) | |
@@ -392,12 +409,6 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, | |||
392 | *ptr++ = htonl(opts->tsecr); | 409 | *ptr++ = htonl(opts->tsecr); |
393 | } | 410 | } |
394 | 411 | ||
395 | if (unlikely(opts->mss)) { | ||
396 | *ptr++ = htonl((TCPOPT_MSS << 24) | | ||
397 | (TCPOLEN_MSS << 16) | | ||
398 | opts->mss); | ||
399 | } | ||
400 | |||
401 | if (unlikely(OPTION_SACK_ADVERTISE & opts->options && | 412 | if (unlikely(OPTION_SACK_ADVERTISE & opts->options && |
402 | !(OPTION_TS & opts->options))) { | 413 | !(OPTION_TS & opts->options))) { |
403 | *ptr++ = htonl((TCPOPT_NOP << 24) | | 414 | *ptr++ = htonl((TCPOPT_NOP << 24) | |
@@ -432,7 +443,7 @@ static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, | |||
432 | 443 | ||
433 | if (tp->rx_opt.dsack) { | 444 | if (tp->rx_opt.dsack) { |
434 | tp->rx_opt.dsack = 0; | 445 | tp->rx_opt.dsack = 0; |
435 | tp->rx_opt.eff_sacks--; | 446 | tp->rx_opt.eff_sacks = tp->rx_opt.num_sacks; |
436 | } | 447 | } |
437 | } | 448 | } |
438 | } | 449 | } |