diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-07-29 06:10:50 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-07-29 06:10:50 -0400 |
| commit | 35780c8ea7ad5c6d5483244d5f5bf37176fda86a (patch) | |
| tree | 2bc34969f558da2a9b3de915e3f2499a959085da /net | |
| parent | 6ce37a58e334ef773f88283939afc9f4965c7697 (diff) | |
| parent | 6e86841d05f371b5b9b86ce76c02aaee83352298 (diff) | |
Merge commit 'v2.6.27-rc1' into x86/urgent
Diffstat (limited to 'net')
| -rw-r--r-- | net/dccp/dccp.h | 2 | ||||
| -rw-r--r-- | net/dccp/ipv4.c | 9 | ||||
| -rw-r--r-- | net/dccp/ipv6.c | 16 | ||||
| -rw-r--r-- | net/dccp/output.c | 53 | ||||
| -rw-r--r-- | net/dccp/timer.c | 20 | ||||
| -rw-r--r-- | net/ipv4/ipcomp.c | 4 | ||||
| -rw-r--r-- | net/ipv4/route.c | 11 | ||||
| -rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 14 | ||||
| -rw-r--r-- | net/ipv6/af_inet6.c | 12 | ||||
| -rw-r--r-- | net/ipv6/ipcomp6.c | 4 | ||||
| -rw-r--r-- | net/ipv6/sysctl_net_ipv6.c | 16 | ||||
| -rw-r--r-- | net/sunrpc/svc.c | 3 | ||||
| -rw-r--r-- | net/sysctl_net.c | 4 |
13 files changed, 100 insertions, 68 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 743d85fcd651..1c2e3ec2eb57 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
| @@ -226,7 +226,7 @@ static inline void dccp_csum_outgoing(struct sk_buff *skb) | |||
| 226 | 226 | ||
| 227 | extern void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); | 227 | extern void dccp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); |
| 228 | 228 | ||
| 229 | extern int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb); | 229 | extern int dccp_retransmit_skb(struct sock *sk); |
| 230 | 230 | ||
| 231 | extern void dccp_send_ack(struct sock *sk); | 231 | extern void dccp_send_ack(struct sock *sk); |
| 232 | extern void dccp_reqsk_send_ack(struct sk_buff *sk, struct request_sock *rsk); | 232 | extern void dccp_reqsk_send_ack(struct sk_buff *sk, struct request_sock *rsk); |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index a835b88237cb..882c5c4de69e 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -196,8 +196,8 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, | |||
| 196 | static void dccp_v4_err(struct sk_buff *skb, u32 info) | 196 | static void dccp_v4_err(struct sk_buff *skb, u32 info) |
| 197 | { | 197 | { |
| 198 | const struct iphdr *iph = (struct iphdr *)skb->data; | 198 | const struct iphdr *iph = (struct iphdr *)skb->data; |
| 199 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + | 199 | const u8 offset = iph->ihl << 2; |
| 200 | (iph->ihl << 2)); | 200 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); |
| 201 | struct dccp_sock *dp; | 201 | struct dccp_sock *dp; |
| 202 | struct inet_sock *inet; | 202 | struct inet_sock *inet; |
| 203 | const int type = icmp_hdr(skb)->type; | 203 | const int type = icmp_hdr(skb)->type; |
| @@ -207,7 +207,8 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) | |||
| 207 | int err; | 207 | int err; |
| 208 | struct net *net = dev_net(skb->dev); | 208 | struct net *net = dev_net(skb->dev); |
| 209 | 209 | ||
| 210 | if (skb->len < (iph->ihl << 2) + 8) { | 210 | if (skb->len < offset + sizeof(*dh) || |
| 211 | skb->len < offset + __dccp_basic_hdr_len(dh)) { | ||
| 211 | ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); | 212 | ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS); |
| 212 | return; | 213 | return; |
| 213 | } | 214 | } |
| @@ -238,7 +239,7 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info) | |||
| 238 | dp = dccp_sk(sk); | 239 | dp = dccp_sk(sk); |
| 239 | seq = dccp_hdr_seq(dh); | 240 | seq = dccp_hdr_seq(dh); |
| 240 | if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && | 241 | if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && |
| 241 | !between48(seq, dp->dccps_swl, dp->dccps_swh)) { | 242 | !between48(seq, dp->dccps_awl, dp->dccps_awh)) { |
| 242 | NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); | 243 | NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); |
| 243 | goto out; | 244 | goto out; |
| 244 | } | 245 | } |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index da509127e00c..5e1ee0da2c40 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -89,12 +89,19 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 89 | { | 89 | { |
| 90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; | 90 | struct ipv6hdr *hdr = (struct ipv6hdr *)skb->data; |
| 91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); | 91 | const struct dccp_hdr *dh = (struct dccp_hdr *)(skb->data + offset); |
| 92 | struct dccp_sock *dp; | ||
| 92 | struct ipv6_pinfo *np; | 93 | struct ipv6_pinfo *np; |
| 93 | struct sock *sk; | 94 | struct sock *sk; |
| 94 | int err; | 95 | int err; |
| 95 | __u64 seq; | 96 | __u64 seq; |
| 96 | struct net *net = dev_net(skb->dev); | 97 | struct net *net = dev_net(skb->dev); |
| 97 | 98 | ||
| 99 | if (skb->len < offset + sizeof(*dh) || | ||
| 100 | skb->len < offset + __dccp_basic_hdr_len(dh)) { | ||
| 101 | ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS); | ||
| 102 | return; | ||
| 103 | } | ||
| 104 | |||
| 98 | sk = inet6_lookup(net, &dccp_hashinfo, | 105 | sk = inet6_lookup(net, &dccp_hashinfo, |
| 99 | &hdr->daddr, dh->dccph_dport, | 106 | &hdr->daddr, dh->dccph_dport, |
| 100 | &hdr->saddr, dh->dccph_sport, inet6_iif(skb)); | 107 | &hdr->saddr, dh->dccph_sport, inet6_iif(skb)); |
| @@ -116,6 +123,14 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 116 | if (sk->sk_state == DCCP_CLOSED) | 123 | if (sk->sk_state == DCCP_CLOSED) |
| 117 | goto out; | 124 | goto out; |
| 118 | 125 | ||
| 126 | dp = dccp_sk(sk); | ||
| 127 | seq = dccp_hdr_seq(dh); | ||
| 128 | if ((1 << sk->sk_state) & ~(DCCPF_REQUESTING | DCCPF_LISTEN) && | ||
| 129 | !between48(seq, dp->dccps_awl, dp->dccps_awh)) { | ||
| 130 | NET_INC_STATS_BH(net, LINUX_MIB_OUTOFWINDOWICMPS); | ||
| 131 | goto out; | ||
| 132 | } | ||
| 133 | |||
| 119 | np = inet6_sk(sk); | 134 | np = inet6_sk(sk); |
| 120 | 135 | ||
| 121 | if (type == ICMPV6_PKT_TOOBIG) { | 136 | if (type == ICMPV6_PKT_TOOBIG) { |
| @@ -168,7 +183,6 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
| 168 | 183 | ||
| 169 | icmpv6_err_convert(type, code, &err); | 184 | icmpv6_err_convert(type, code, &err); |
| 170 | 185 | ||
| 171 | seq = dccp_hdr_seq(dh); | ||
| 172 | /* Might be for an request_sock */ | 186 | /* Might be for an request_sock */ |
| 173 | switch (sk->sk_state) { | 187 | switch (sk->sk_state) { |
| 174 | struct request_sock *req, **prev; | 188 | struct request_sock *req, **prev; |
diff --git a/net/dccp/output.c b/net/dccp/output.c index fe20068c5d8e..d06945c7d3df 100644 --- a/net/dccp/output.c +++ b/net/dccp/output.c | |||
| @@ -53,8 +53,11 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 53 | dccp_packet_hdr_len(dcb->dccpd_type); | 53 | dccp_packet_hdr_len(dcb->dccpd_type); |
| 54 | int err, set_ack = 1; | 54 | int err, set_ack = 1; |
| 55 | u64 ackno = dp->dccps_gsr; | 55 | u64 ackno = dp->dccps_gsr; |
| 56 | 56 | /* | |
| 57 | dccp_inc_seqno(&dp->dccps_gss); | 57 | * Increment GSS here already in case the option code needs it. |
| 58 | * Update GSS for real only if option processing below succeeds. | ||
| 59 | */ | ||
| 60 | dcb->dccpd_seq = ADD48(dp->dccps_gss, 1); | ||
| 58 | 61 | ||
| 59 | switch (dcb->dccpd_type) { | 62 | switch (dcb->dccpd_type) { |
| 60 | case DCCP_PKT_DATA: | 63 | case DCCP_PKT_DATA: |
| @@ -66,6 +69,9 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 66 | 69 | ||
| 67 | case DCCP_PKT_REQUEST: | 70 | case DCCP_PKT_REQUEST: |
| 68 | set_ack = 0; | 71 | set_ack = 0; |
| 72 | /* Use ISS on the first (non-retransmitted) Request. */ | ||
| 73 | if (icsk->icsk_retransmits == 0) | ||
| 74 | dcb->dccpd_seq = dp->dccps_iss; | ||
| 69 | /* fall through */ | 75 | /* fall through */ |
| 70 | 76 | ||
| 71 | case DCCP_PKT_SYNC: | 77 | case DCCP_PKT_SYNC: |
| @@ -84,8 +90,6 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 84 | break; | 90 | break; |
| 85 | } | 91 | } |
| 86 | 92 | ||
| 87 | dcb->dccpd_seq = dp->dccps_gss; | ||
| 88 | |||
| 89 | if (dccp_insert_options(sk, skb)) { | 93 | if (dccp_insert_options(sk, skb)) { |
| 90 | kfree_skb(skb); | 94 | kfree_skb(skb); |
| 91 | return -EPROTO; | 95 | return -EPROTO; |
| @@ -103,7 +107,7 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 103 | /* XXX For now we're using only 48 bits sequence numbers */ | 107 | /* XXX For now we're using only 48 bits sequence numbers */ |
| 104 | dh->dccph_x = 1; | 108 | dh->dccph_x = 1; |
| 105 | 109 | ||
| 106 | dp->dccps_awh = dp->dccps_gss; | 110 | dccp_update_gss(sk, dcb->dccpd_seq); |
| 107 | dccp_hdr_set_seq(dh, dp->dccps_gss); | 111 | dccp_hdr_set_seq(dh, dp->dccps_gss); |
| 108 | if (set_ack) | 112 | if (set_ack) |
| 109 | dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), ackno); | 113 | dccp_hdr_set_ack(dccp_hdr_ack_bits(skb), ackno); |
| @@ -112,6 +116,11 @@ static int dccp_transmit_skb(struct sock *sk, struct sk_buff *skb) | |||
| 112 | case DCCP_PKT_REQUEST: | 116 | case DCCP_PKT_REQUEST: |
| 113 | dccp_hdr_request(skb)->dccph_req_service = | 117 | dccp_hdr_request(skb)->dccph_req_service = |
| 114 | dp->dccps_service; | 118 | dp->dccps_service; |
| 119 | /* | ||
| 120 | * Limit Ack window to ISS <= P.ackno <= GSS, so that | ||
| 121 | * only Responses to Requests we sent are considered. | ||
| 122 | */ | ||
| 123 | dp->dccps_awl = dp->dccps_iss; | ||
| 115 | break; | 124 | break; |
| 116 | case DCCP_PKT_RESET: | 125 | case DCCP_PKT_RESET: |
| 117 | dccp_hdr_reset(skb)->dccph_reset_code = | 126 | dccp_hdr_reset(skb)->dccph_reset_code = |
| @@ -284,14 +293,26 @@ void dccp_write_xmit(struct sock *sk, int block) | |||
| 284 | } | 293 | } |
| 285 | } | 294 | } |
| 286 | 295 | ||
| 287 | int dccp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | 296 | /** |
| 297 | * dccp_retransmit_skb - Retransmit Request, Close, or CloseReq packets | ||
| 298 | * There are only four retransmittable packet types in DCCP: | ||
| 299 | * - Request in client-REQUEST state (sec. 8.1.1), | ||
| 300 | * - CloseReq in server-CLOSEREQ state (sec. 8.3), | ||
| 301 | * - Close in node-CLOSING state (sec. 8.3), | ||
| 302 | * - Acks in client-PARTOPEN state (sec. 8.1.5, handled by dccp_delack_timer()). | ||
| 303 | * This function expects sk->sk_send_head to contain the original skb. | ||
| 304 | */ | ||
| 305 | int dccp_retransmit_skb(struct sock *sk) | ||
| 288 | { | 306 | { |
| 307 | WARN_ON(sk->sk_send_head == NULL); | ||
| 308 | |||
| 289 | if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) | 309 | if (inet_csk(sk)->icsk_af_ops->rebuild_header(sk) != 0) |
| 290 | return -EHOSTUNREACH; /* Routing failure or similar. */ | 310 | return -EHOSTUNREACH; /* Routing failure or similar. */ |
| 291 | 311 | ||
| 292 | return dccp_transmit_skb(sk, (skb_cloned(skb) ? | 312 | /* this count is used to distinguish original and retransmitted skb */ |
| 293 | pskb_copy(skb, GFP_ATOMIC): | 313 | inet_csk(sk)->icsk_retransmits++; |
| 294 | skb_clone(skb, GFP_ATOMIC))); | 314 | |
| 315 | return dccp_transmit_skb(sk, skb_clone(sk->sk_send_head, GFP_ATOMIC)); | ||
| 295 | } | 316 | } |
| 296 | 317 | ||
| 297 | struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, | 318 | struct sk_buff *dccp_make_response(struct sock *sk, struct dst_entry *dst, |
| @@ -437,19 +458,7 @@ static inline void dccp_connect_init(struct sock *sk) | |||
| 437 | 458 | ||
| 438 | dccp_sync_mss(sk, dst_mtu(dst)); | 459 | dccp_sync_mss(sk, dst_mtu(dst)); |
| 439 | 460 | ||
| 440 | /* | 461 | /* Initialise GAR as per 8.5; AWL/AWH are set in dccp_transmit_skb() */ |
| 441 | * SWL and AWL are initially adjusted so that they are not less than | ||
| 442 | * the initial Sequence Numbers received and sent, respectively: | ||
| 443 | * SWL := max(GSR + 1 - floor(W/4), ISR), | ||
| 444 | * AWL := max(GSS - W' + 1, ISS). | ||
| 445 | * These adjustments MUST be applied only at the beginning of the | ||
| 446 | * connection. | ||
| 447 | */ | ||
| 448 | dccp_update_gss(sk, dp->dccps_iss); | ||
| 449 | dccp_set_seqno(&dp->dccps_awl, max48(dp->dccps_awl, dp->dccps_iss)); | ||
| 450 | |||
| 451 | /* S.GAR - greatest valid acknowledgement number received on a non-Sync; | ||
| 452 | * initialized to S.ISS (sec. 8.5) */ | ||
| 453 | dp->dccps_gar = dp->dccps_iss; | 462 | dp->dccps_gar = dp->dccps_iss; |
| 454 | 463 | ||
| 455 | icsk->icsk_retransmits = 0; | 464 | icsk->icsk_retransmits = 0; |
diff --git a/net/dccp/timer.c b/net/dccp/timer.c index 6a5b961b6f5c..54b3c7e9e016 100644 --- a/net/dccp/timer.c +++ b/net/dccp/timer.c | |||
| @@ -99,21 +99,11 @@ static void dccp_retransmit_timer(struct sock *sk) | |||
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | /* | 101 | /* |
| 102 | * sk->sk_send_head has to have one skb with | ||
| 103 | * DCCP_SKB_CB(skb)->dccpd_type set to one of the retransmittable DCCP | ||
| 104 | * packet types. The only packets eligible for retransmission are: | ||
| 105 | * -- Requests in client-REQUEST state (sec. 8.1.1) | ||
| 106 | * -- Acks in client-PARTOPEN state (sec. 8.1.5) | ||
| 107 | * -- CloseReq in server-CLOSEREQ state (sec. 8.3) | ||
| 108 | * -- Close in node-CLOSING state (sec. 8.3) */ | ||
| 109 | WARN_ON(sk->sk_send_head == NULL); | ||
| 110 | |||
| 111 | /* | ||
| 112 | * More than than 4MSL (8 minutes) has passed, a RESET(aborted) was | 102 | * More than than 4MSL (8 minutes) has passed, a RESET(aborted) was |
| 113 | * sent, no need to retransmit, this sock is dead. | 103 | * sent, no need to retransmit, this sock is dead. |
| 114 | */ | 104 | */ |
| 115 | if (dccp_write_timeout(sk)) | 105 | if (dccp_write_timeout(sk)) |
| 116 | goto out; | 106 | return; |
| 117 | 107 | ||
| 118 | /* | 108 | /* |
| 119 | * We want to know the number of packets retransmitted, not the | 109 | * We want to know the number of packets retransmitted, not the |
| @@ -122,30 +112,28 @@ static void dccp_retransmit_timer(struct sock *sk) | |||
| 122 | if (icsk->icsk_retransmits == 0) | 112 | if (icsk->icsk_retransmits == 0) |
| 123 | DCCP_INC_STATS_BH(DCCP_MIB_TIMEOUTS); | 113 | DCCP_INC_STATS_BH(DCCP_MIB_TIMEOUTS); |
| 124 | 114 | ||
| 125 | if (dccp_retransmit_skb(sk, sk->sk_send_head) < 0) { | 115 | if (dccp_retransmit_skb(sk) != 0) { |
| 126 | /* | 116 | /* |
| 127 | * Retransmission failed because of local congestion, | 117 | * Retransmission failed because of local congestion, |
| 128 | * do not backoff. | 118 | * do not backoff. |
| 129 | */ | 119 | */ |
| 130 | if (icsk->icsk_retransmits == 0) | 120 | if (--icsk->icsk_retransmits == 0) |
| 131 | icsk->icsk_retransmits = 1; | 121 | icsk->icsk_retransmits = 1; |
| 132 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, | 122 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, |
| 133 | min(icsk->icsk_rto, | 123 | min(icsk->icsk_rto, |
| 134 | TCP_RESOURCE_PROBE_INTERVAL), | 124 | TCP_RESOURCE_PROBE_INTERVAL), |
| 135 | DCCP_RTO_MAX); | 125 | DCCP_RTO_MAX); |
| 136 | goto out; | 126 | return; |
| 137 | } | 127 | } |
| 138 | 128 | ||
| 139 | backoff: | 129 | backoff: |
| 140 | icsk->icsk_backoff++; | 130 | icsk->icsk_backoff++; |
| 141 | icsk->icsk_retransmits++; | ||
| 142 | 131 | ||
| 143 | icsk->icsk_rto = min(icsk->icsk_rto << 1, DCCP_RTO_MAX); | 132 | icsk->icsk_rto = min(icsk->icsk_rto << 1, DCCP_RTO_MAX); |
| 144 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, | 133 | inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS, icsk->icsk_rto, |
| 145 | DCCP_RTO_MAX); | 134 | DCCP_RTO_MAX); |
| 146 | if (icsk->icsk_retransmits > sysctl_dccp_retries1) | 135 | if (icsk->icsk_retransmits > sysctl_dccp_retries1) |
| 147 | __sk_dst_reset(sk); | 136 | __sk_dst_reset(sk); |
| 148 | out:; | ||
| 149 | } | 137 | } |
| 150 | 138 | ||
| 151 | static void dccp_write_timer(unsigned long data) | 139 | static void dccp_write_timer(unsigned long data) |
diff --git a/net/ipv4/ipcomp.c b/net/ipv4/ipcomp.c index a42b64d040c4..38ccb6dfb02e 100644 --- a/net/ipv4/ipcomp.c +++ b/net/ipv4/ipcomp.c | |||
| @@ -104,9 +104,7 @@ out: | |||
| 104 | 104 | ||
| 105 | static int ipcomp4_init_state(struct xfrm_state *x) | 105 | static int ipcomp4_init_state(struct xfrm_state *x) |
| 106 | { | 106 | { |
| 107 | int err; | 107 | int err = -EINVAL; |
| 108 | struct ipcomp_data *ipcd; | ||
| 109 | struct xfrm_algo_desc *calg_desc; | ||
| 110 | 108 | ||
| 111 | x->props.header_len = 0; | 109 | x->props.header_len = 0; |
| 112 | switch (x->props.mode) { | 110 | switch (x->props.mode) { |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a507c5e27d0e..380d6474cf66 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
| @@ -2914,7 +2914,7 @@ static int ipv4_sysctl_rtcache_flush_strategy(ctl_table *table, | |||
| 2914 | return 0; | 2914 | return 0; |
| 2915 | } | 2915 | } |
| 2916 | 2916 | ||
| 2917 | ctl_table ipv4_route_table[] = { | 2917 | static ctl_table ipv4_route_table[] = { |
| 2918 | { | 2918 | { |
| 2919 | .ctl_name = NET_IPV4_ROUTE_GC_THRESH, | 2919 | .ctl_name = NET_IPV4_ROUTE_GC_THRESH, |
| 2920 | .procname = "gc_thresh", | 2920 | .procname = "gc_thresh", |
| @@ -3216,6 +3216,15 @@ int __init ip_rt_init(void) | |||
| 3216 | return rc; | 3216 | return rc; |
| 3217 | } | 3217 | } |
| 3218 | 3218 | ||
| 3219 | /* | ||
| 3220 | * We really need to sanitize the damn ipv4 init order, then all | ||
| 3221 | * this nonsense will go away. | ||
| 3222 | */ | ||
| 3223 | void __init ip_static_sysctl_init(void) | ||
| 3224 | { | ||
| 3225 | register_sysctl_paths(ipv4_route_path, ipv4_route_table); | ||
| 3226 | } | ||
| 3227 | |||
| 3219 | EXPORT_SYMBOL(__ip_select_ident); | 3228 | EXPORT_SYMBOL(__ip_select_ident); |
| 3220 | EXPORT_SYMBOL(ip_route_input); | 3229 | EXPORT_SYMBOL(ip_route_input); |
| 3221 | EXPORT_SYMBOL(ip_route_output_key); | 3230 | EXPORT_SYMBOL(ip_route_output_key); |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index d63e9388d92d..770d827f5ab8 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
| @@ -401,13 +401,6 @@ static struct ctl_table ipv4_table[] = { | |||
| 401 | .proc_handler = &ipv4_local_port_range, | 401 | .proc_handler = &ipv4_local_port_range, |
| 402 | .strategy = &ipv4_sysctl_local_port_range, | 402 | .strategy = &ipv4_sysctl_local_port_range, |
| 403 | }, | 403 | }, |
| 404 | { | ||
| 405 | .ctl_name = NET_IPV4_ROUTE, | ||
| 406 | .procname = "route", | ||
| 407 | .maxlen = 0, | ||
| 408 | .mode = 0555, | ||
| 409 | .child = ipv4_route_table | ||
| 410 | }, | ||
| 411 | #ifdef CONFIG_IP_MULTICAST | 404 | #ifdef CONFIG_IP_MULTICAST |
| 412 | { | 405 | { |
| 413 | .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, | 406 | .ctl_name = NET_IPV4_IGMP_MAX_MEMBERSHIPS, |
| @@ -882,11 +875,4 @@ static __init int sysctl_ipv4_init(void) | |||
| 882 | return 0; | 875 | return 0; |
| 883 | } | 876 | } |
| 884 | 877 | ||
| 885 | /* set enough of tree skeleton to get rid of ordering problems */ | ||
| 886 | void __init ip_static_sysctl_init(void) | ||
| 887 | { | ||
| 888 | static ctl_table table[1]; | ||
| 889 | register_sysctl_paths(net_ipv4_ctl_path, table); | ||
| 890 | } | ||
| 891 | |||
| 892 | __initcall(sysctl_ipv4_init); | 878 | __initcall(sysctl_ipv4_init); |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index c708ca842298..95055f8c3f35 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
| @@ -934,6 +934,11 @@ static int __init inet6_init(void) | |||
| 934 | if (err) | 934 | if (err) |
| 935 | goto out_unregister_sock; | 935 | goto out_unregister_sock; |
| 936 | 936 | ||
| 937 | #ifdef CONFIG_SYSCTL | ||
| 938 | err = ipv6_static_sysctl_register(); | ||
| 939 | if (err) | ||
| 940 | goto static_sysctl_fail; | ||
| 941 | #endif | ||
| 937 | /* | 942 | /* |
| 938 | * ipngwg API draft makes clear that the correct semantics | 943 | * ipngwg API draft makes clear that the correct semantics |
| 939 | * for TCP and UDP is to consider one TCP and UDP instance | 944 | * for TCP and UDP is to consider one TCP and UDP instance |
| @@ -1058,6 +1063,10 @@ ipmr_fail: | |||
| 1058 | icmp_fail: | 1063 | icmp_fail: |
| 1059 | unregister_pernet_subsys(&inet6_net_ops); | 1064 | unregister_pernet_subsys(&inet6_net_ops); |
| 1060 | register_pernet_fail: | 1065 | register_pernet_fail: |
| 1066 | #ifdef CONFIG_SYSCTL | ||
| 1067 | ipv6_static_sysctl_unregister(); | ||
| 1068 | static_sysctl_fail: | ||
| 1069 | #endif | ||
| 1061 | cleanup_ipv6_mibs(); | 1070 | cleanup_ipv6_mibs(); |
| 1062 | out_unregister_sock: | 1071 | out_unregister_sock: |
| 1063 | sock_unregister(PF_INET6); | 1072 | sock_unregister(PF_INET6); |
| @@ -1113,6 +1122,9 @@ static void __exit inet6_exit(void) | |||
| 1113 | rawv6_exit(); | 1122 | rawv6_exit(); |
| 1114 | 1123 | ||
| 1115 | unregister_pernet_subsys(&inet6_net_ops); | 1124 | unregister_pernet_subsys(&inet6_net_ops); |
| 1125 | #ifdef CONFIG_SYSCTL | ||
| 1126 | ipv6_static_sysctl_unregister(); | ||
| 1127 | #endif | ||
| 1116 | cleanup_ipv6_mibs(); | 1128 | cleanup_ipv6_mibs(); |
| 1117 | proto_unregister(&rawv6_prot); | 1129 | proto_unregister(&rawv6_prot); |
| 1118 | proto_unregister(&udplitev6_prot); | 1130 | proto_unregister(&udplitev6_prot); |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 0cfcea42153a..4545e4306862 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
| @@ -134,9 +134,7 @@ out: | |||
| 134 | 134 | ||
| 135 | static int ipcomp6_init_state(struct xfrm_state *x) | 135 | static int ipcomp6_init_state(struct xfrm_state *x) |
| 136 | { | 136 | { |
| 137 | int err; | 137 | int err = -EINVAL; |
| 138 | struct ipcomp_data *ipcd; | ||
| 139 | struct xfrm_algo_desc *calg_desc; | ||
| 140 | 138 | ||
| 141 | x->props.header_len = 0; | 139 | x->props.header_len = 0; |
| 142 | switch (x->props.mode) { | 140 | switch (x->props.mode) { |
diff --git a/net/ipv6/sysctl_net_ipv6.c b/net/ipv6/sysctl_net_ipv6.c index 5c99274558bf..e6dfaeac6be3 100644 --- a/net/ipv6/sysctl_net_ipv6.c +++ b/net/ipv6/sysctl_net_ipv6.c | |||
| @@ -150,3 +150,19 @@ void ipv6_sysctl_unregister(void) | |||
| 150 | unregister_net_sysctl_table(ip6_header); | 150 | unregister_net_sysctl_table(ip6_header); |
| 151 | unregister_pernet_subsys(&ipv6_sysctl_net_ops); | 151 | unregister_pernet_subsys(&ipv6_sysctl_net_ops); |
| 152 | } | 152 | } |
| 153 | |||
| 154 | static struct ctl_table_header *ip6_base; | ||
| 155 | |||
| 156 | int ipv6_static_sysctl_register(void) | ||
| 157 | { | ||
| 158 | static struct ctl_table empty[1]; | ||
| 159 | ip6_base = register_net_sysctl_rotable(net_ipv6_ctl_path, empty); | ||
| 160 | if (ip6_base == NULL) | ||
| 161 | return -ENOMEM; | ||
| 162 | return 0; | ||
| 163 | } | ||
| 164 | |||
| 165 | void ipv6_static_sysctl_unregister(void) | ||
| 166 | { | ||
| 167 | unregister_net_sysctl_table(ip6_base); | ||
| 168 | } | ||
diff --git a/net/sunrpc/svc.c b/net/sunrpc/svc.c index 835d27413083..5a32cb7c4bb4 100644 --- a/net/sunrpc/svc.c +++ b/net/sunrpc/svc.c | |||
| @@ -310,8 +310,7 @@ svc_pool_map_set_cpumask(struct task_struct *task, unsigned int pidx) | |||
| 310 | switch (m->mode) { | 310 | switch (m->mode) { |
| 311 | case SVC_POOL_PERCPU: | 311 | case SVC_POOL_PERCPU: |
| 312 | { | 312 | { |
| 313 | cpumask_of_cpu_ptr(cpumask, node); | 313 | set_cpus_allowed_ptr(task, &cpumask_of_cpu(node)); |
| 314 | set_cpus_allowed_ptr(task, cpumask); | ||
| 315 | break; | 314 | break; |
| 316 | } | 315 | } |
| 317 | case SVC_POOL_PERNODE: | 316 | case SVC_POOL_PERNODE: |
diff --git a/net/sysctl_net.c b/net/sysctl_net.c index cefbc367d8be..972201cd5fa7 100644 --- a/net/sysctl_net.c +++ b/net/sysctl_net.c | |||
| @@ -73,7 +73,9 @@ static struct ctl_table_root net_sysctl_ro_root = { | |||
| 73 | 73 | ||
| 74 | static int sysctl_net_init(struct net *net) | 74 | static int sysctl_net_init(struct net *net) |
| 75 | { | 75 | { |
| 76 | setup_sysctl_set(&net->sysctls, NULL, is_seen); | 76 | setup_sysctl_set(&net->sysctls, |
| 77 | &net_sysctl_ro_root.default_set, | ||
| 78 | is_seen); | ||
| 77 | return 0; | 79 | return 0; |
| 78 | } | 80 | } |
| 79 | 81 | ||
