diff options
| author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-25 01:01:33 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-25 01:01:33 -0400 |
| commit | 9eed28679282238210ad5e80bb91df30fec6d7db (patch) | |
| tree | e94e88cb57861c7820371fc8038f87c3631ee178 | |
| parent | 2099c99e3b24f86b131566aa9854249189ae9ea2 (diff) | |
| parent | 0e64e94e477f8ed04e9295b11a5898d443c28a47 (diff) | |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[DCCP]: Update documentation references.
[ATM] horizon: read_bia() needs to be __devinit
[NETFILTER]: Fix ip6_tables extension header bypass bug
[NETFILTER]: Fix ip6_tables protocol bypass bug
[XFRM]: Fix xfrm_state accounting
[IPV4] ipconfig: fix RARP ic_servaddr breakage
| -rw-r--r-- | drivers/atm/horizon.c | 2 | ||||
| -rw-r--r-- | net/dccp/Kconfig | 6 | ||||
| -rw-r--r-- | net/dccp/ackvec.c | 12 | ||||
| -rw-r--r-- | net/dccp/ackvec.h | 3 | ||||
| -rw-r--r-- | net/dccp/ccids/Kconfig | 17 | ||||
| -rw-r--r-- | net/dccp/ccids/ccid2.c | 2 | ||||
| -rw-r--r-- | net/dccp/ccids/ccid3.c | 3 | ||||
| -rw-r--r-- | net/dccp/dccp.h | 2 | ||||
| -rw-r--r-- | net/dccp/input.c | 4 | ||||
| -rw-r--r-- | net/dccp/ipv4.c | 4 | ||||
| -rw-r--r-- | net/dccp/ipv6.c | 2 | ||||
| -rw-r--r-- | net/dccp/options.c | 2 | ||||
| -rw-r--r-- | net/ipv4/ipconfig.c | 2 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6_tables.c | 21 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6t_ah.c | 7 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6t_frag.c | 7 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6t_hbh.c | 7 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6t_rt.c | 7 | ||||
| -rw-r--r-- | net/xfrm/xfrm_state.c | 18 |
19 files changed, 76 insertions, 52 deletions
diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 44268cba5a5a..4dc10105d610 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c | |||
| @@ -1789,7 +1789,7 @@ static inline void CLOCK_IT (const hrz_dev *dev, u32 ctrl) | |||
| 1789 | WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK); | 1789 | WRITE_IT_WAIT(dev, ctrl | SEEPROM_SK); |
| 1790 | } | 1790 | } |
| 1791 | 1791 | ||
| 1792 | static u16 __init read_bia (const hrz_dev * dev, u16 addr) | 1792 | static u16 __devinit read_bia (const hrz_dev * dev, u16 addr) |
| 1793 | { | 1793 | { |
| 1794 | u32 ctrl = rd_regl (dev, CONTROL_0_REG); | 1794 | u32 ctrl = rd_regl (dev, CONTROL_0_REG); |
| 1795 | 1795 | ||
diff --git a/net/dccp/Kconfig b/net/dccp/Kconfig index e2a095d0fd80..ef8919cca74b 100644 --- a/net/dccp/Kconfig +++ b/net/dccp/Kconfig | |||
| @@ -4,15 +4,15 @@ menu "DCCP Configuration (EXPERIMENTAL)" | |||
| 4 | config IP_DCCP | 4 | config IP_DCCP |
| 5 | tristate "The DCCP Protocol (EXPERIMENTAL)" | 5 | tristate "The DCCP Protocol (EXPERIMENTAL)" |
| 6 | ---help--- | 6 | ---help--- |
| 7 | Datagram Congestion Control Protocol | 7 | Datagram Congestion Control Protocol (RFC 4340) |
| 8 | 8 | ||
| 9 | From draft-ietf-dccp-spec-11 <http://www.icir.org/kohler/dcp/draft-ietf-dccp-spec-11.txt>. | 9 | From http://www.ietf.org/rfc/rfc4340.txt: |
| 10 | 10 | ||
| 11 | The Datagram Congestion Control Protocol (DCCP) is a transport | 11 | The Datagram Congestion Control Protocol (DCCP) is a transport |
| 12 | protocol that implements bidirectional, unicast connections of | 12 | protocol that implements bidirectional, unicast connections of |
| 13 | congestion-controlled, unreliable datagrams. It should be suitable | 13 | congestion-controlled, unreliable datagrams. It should be suitable |
| 14 | for use by applications such as streaming media, Internet telephony, | 14 | for use by applications such as streaming media, Internet telephony, |
| 15 | and on-line games | 15 | and on-line games. |
| 16 | 16 | ||
| 17 | To compile this protocol support as a module, choose M here: the | 17 | To compile this protocol support as a module, choose M here: the |
| 18 | module will be called dccp. | 18 | module will be called dccp. |
diff --git a/net/dccp/ackvec.c b/net/dccp/ackvec.c index 4d176d33983f..f8208874ac7d 100644 --- a/net/dccp/ackvec.c +++ b/net/dccp/ackvec.c | |||
| @@ -113,7 +113,7 @@ int dccp_insert_option_ackvec(struct sock *sk, struct sk_buff *skb) | |||
| 113 | 113 | ||
| 114 | memcpy(to, from, len); | 114 | memcpy(to, from, len); |
| 115 | /* | 115 | /* |
| 116 | * From draft-ietf-dccp-spec-11.txt: | 116 | * From RFC 4340, A.2: |
| 117 | * | 117 | * |
| 118 | * For each acknowledgement it sends, the HC-Receiver will add an | 118 | * For each acknowledgement it sends, the HC-Receiver will add an |
| 119 | * acknowledgement record. ack_seqno will equal the HC-Receiver | 119 | * acknowledgement record. ack_seqno will equal the HC-Receiver |
| @@ -224,7 +224,7 @@ static inline int dccp_ackvec_set_buf_head_state(struct dccp_ackvec *av, | |||
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | /* | 226 | /* |
| 227 | * Implements the draft-ietf-dccp-spec-11.txt Appendix A | 227 | * Implements the RFC 4340, Appendix A |
| 228 | */ | 228 | */ |
| 229 | int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | 229 | int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, |
| 230 | const u64 ackno, const u8 state) | 230 | const u64 ackno, const u8 state) |
| @@ -237,7 +237,7 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | |||
| 237 | * We may well decide to do buffer compression, etc, but for now lets | 237 | * We may well decide to do buffer compression, etc, but for now lets |
| 238 | * just drop. | 238 | * just drop. |
| 239 | * | 239 | * |
| 240 | * From Appendix A: | 240 | * From Appendix A.1.1 (`New Packets'): |
| 241 | * | 241 | * |
| 242 | * Of course, the circular buffer may overflow, either when the | 242 | * Of course, the circular buffer may overflow, either when the |
| 243 | * HC-Sender is sending data at a very high rate, when the | 243 | * HC-Sender is sending data at a very high rate, when the |
| @@ -274,9 +274,9 @@ int dccp_ackvec_add(struct dccp_ackvec *av, const struct sock *sk, | |||
| 274 | /* | 274 | /* |
| 275 | * A.1.2. Old Packets | 275 | * A.1.2. Old Packets |
| 276 | * | 276 | * |
| 277 | * When a packet with Sequence Number S arrives, and | 277 | * When a packet with Sequence Number S <= buf_ackno |
| 278 | * S <= buf_ackno, the HC-Receiver will scan the table | 278 | * arrives, the HC-Receiver will scan the table for |
| 279 | * for the byte corresponding to S. (Indexing structures | 279 | * the byte corresponding to S. (Indexing structures |
| 280 | * could reduce the complexity of this scan.) | 280 | * could reduce the complexity of this scan.) |
| 281 | */ | 281 | */ |
| 282 | u64 delta = dccp_delta_seqno(ackno, av->dccpav_buf_ackno); | 282 | u64 delta = dccp_delta_seqno(ackno, av->dccpav_buf_ackno); |
diff --git a/net/dccp/ackvec.h b/net/dccp/ackvec.h index 2424effac7f6..cf8f20ce23a9 100644 --- a/net/dccp/ackvec.h +++ b/net/dccp/ackvec.h | |||
| @@ -28,8 +28,7 @@ | |||
| 28 | 28 | ||
| 29 | /** struct dccp_ackvec - ack vector | 29 | /** struct dccp_ackvec - ack vector |
| 30 | * | 30 | * |
| 31 | * This data structure is the one defined in the DCCP draft | 31 | * This data structure is the one defined in RFC 4340, Appendix A. |
| 32 | * Appendix A. | ||
| 33 | * | 32 | * |
| 34 | * @dccpav_buf_head - circular buffer head | 33 | * @dccpav_buf_head - circular buffer head |
| 35 | * @dccpav_buf_tail - circular buffer tail | 34 | * @dccpav_buf_tail - circular buffer tail |
diff --git a/net/dccp/ccids/Kconfig b/net/dccp/ccids/Kconfig index 32752f750447..8533dabfb9f8 100644 --- a/net/dccp/ccids/Kconfig +++ b/net/dccp/ccids/Kconfig | |||
| @@ -22,11 +22,11 @@ config IP_DCCP_CCID2 | |||
| 22 | for lost packets, would prefer CCID 2 to CCID 3. On-line games may | 22 | for lost packets, would prefer CCID 2 to CCID 3. On-line games may |
| 23 | also prefer CCID 2. | 23 | also prefer CCID 2. |
| 24 | 24 | ||
| 25 | CCID 2 is further described in: | 25 | CCID 2 is further described in RFC 4341, |
| 26 | http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid2-10.txt | 26 | http://www.ietf.org/rfc/rfc4341.txt |
| 27 | 27 | ||
| 28 | This text was extracted from: | 28 | This text was extracted from RFC 4340 (sec. 10.1), |
| 29 | http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt | 29 | http://www.ietf.org/rfc/rfc4340.txt |
| 30 | 30 | ||
| 31 | If in doubt, say M. | 31 | If in doubt, say M. |
| 32 | 32 | ||
| @@ -53,15 +53,14 @@ config IP_DCCP_CCID3 | |||
| 53 | suitable than CCID 2 for applications such streaming media where a | 53 | suitable than CCID 2 for applications such streaming media where a |
| 54 | relatively smooth sending rate is of importance. | 54 | relatively smooth sending rate is of importance. |
| 55 | 55 | ||
| 56 | CCID 3 is further described in: | 56 | CCID 3 is further described in RFC 4342, |
| 57 | 57 | http://www.ietf.org/rfc/rfc4342.txt | |
| 58 | http://www.icir.org/kohler/dccp/draft-ietf-dccp-ccid3-11.txt. | ||
| 59 | 58 | ||
| 60 | The TFRC congestion control algorithms were initially described in | 59 | The TFRC congestion control algorithms were initially described in |
| 61 | RFC 3448. | 60 | RFC 3448. |
| 62 | 61 | ||
| 63 | This text was extracted from: | 62 | This text was extracted from RFC 4340 (sec. 10.2), |
| 64 | http://www.icir.org/kohler/dccp/draft-ietf-dccp-spec-13.txt | 63 | http://www.ietf.org/rfc/rfc4340.txt |
| 65 | 64 | ||
| 66 | If in doubt, say M. | 65 | If in doubt, say M. |
| 67 | 66 | ||
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c index 2efb505aeb35..2fbb84bf4e26 100644 --- a/net/dccp/ccids/ccid2.c +++ b/net/dccp/ccids/ccid2.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | */ | 23 | */ |
| 24 | 24 | ||
| 25 | /* | 25 | /* |
| 26 | * This implementation should follow: draft-ietf-dccp-ccid2-10.txt | 26 | * This implementation should follow RFC 4341 |
| 27 | * | 27 | * |
| 28 | * BUGS: | 28 | * BUGS: |
| 29 | * - sequence number wrapping | 29 | * - sequence number wrapping |
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c index 67d2dc0e7c67..cec23ad286de 100644 --- a/net/dccp/ccids/ccid3.c +++ b/net/dccp/ccids/ccid3.c | |||
| @@ -379,8 +379,7 @@ static void ccid3_hc_tx_packet_sent(struct sock *sk, int more, int len) | |||
| 379 | packet->dccphtx_seqno = dp->dccps_gss; | 379 | packet->dccphtx_seqno = dp->dccps_gss; |
| 380 | /* | 380 | /* |
| 381 | * Check if win_count have changed | 381 | * Check if win_count have changed |
| 382 | * Algorithm in "8.1. Window Counter Valuer" in | 382 | * Algorithm in "8.1. Window Counter Value" in RFC 4342. |
| 383 | * draft-ietf-dccp-ccid3-11.txt | ||
| 384 | */ | 383 | */ |
| 385 | quarter_rtt = timeval_delta(&now, &hctx->ccid3hctx_t_last_win_count); | 384 | quarter_rtt = timeval_delta(&now, &hctx->ccid3hctx_t_last_win_count); |
| 386 | if (likely(hctx->ccid3hctx_rtt > 8)) | 385 | if (likely(hctx->ccid3hctx_rtt > 8)) |
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 0a21be437ed3..272e8584564e 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
| @@ -50,7 +50,7 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo); | |||
| 50 | #define DCCP_TIMEWAIT_LEN (60 * HZ) /* how long to wait to destroy TIME-WAIT | 50 | #define DCCP_TIMEWAIT_LEN (60 * HZ) /* how long to wait to destroy TIME-WAIT |
| 51 | * state, about 60 seconds */ | 51 | * state, about 60 seconds */ |
| 52 | 52 | ||
| 53 | /* draft-ietf-dccp-spec-11.txt initial RTO value */ | 53 | /* RFC 1122, 4.2.3.1 initial RTO value */ |
| 54 | #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) | 54 | #define DCCP_TIMEOUT_INIT ((unsigned)(3 * HZ)) |
| 55 | 55 | ||
| 56 | /* Maximal interval between probes for local resources. */ | 56 | /* Maximal interval between probes for local resources. */ |
diff --git a/net/dccp/input.c b/net/dccp/input.c index 7f9dc6ac58c9..1d24881ac0ab 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
| @@ -216,11 +216,11 @@ send_sync: | |||
| 216 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, | 216 | dccp_send_sync(sk, DCCP_SKB_CB(skb)->dccpd_seq, |
| 217 | DCCP_PKT_SYNCACK); | 217 | DCCP_PKT_SYNCACK); |
| 218 | /* | 218 | /* |
| 219 | * From the draft: | 219 | * From RFC 4340, sec. 5.7 |
| 220 | * | 220 | * |
| 221 | * As with DCCP-Ack packets, DCCP-Sync and DCCP-SyncAck packets | 221 | * As with DCCP-Ack packets, DCCP-Sync and DCCP-SyncAck packets |
| 222 | * MAY have non-zero-length application data areas, whose | 222 | * MAY have non-zero-length application data areas, whose |
| 223 | * contents * receivers MUST ignore. | 223 | * contents receivers MUST ignore. |
| 224 | */ | 224 | */ |
| 225 | goto discard; | 225 | goto discard; |
| 226 | } | 226 | } |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index aaaf4d09516b..e08e7688a263 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -183,7 +183,7 @@ static inline void dccp_do_pmtu_discovery(struct sock *sk, | |||
| 183 | dccp_sync_mss(sk, mtu); | 183 | dccp_sync_mss(sk, mtu); |
| 184 | 184 | ||
| 185 | /* | 185 | /* |
| 186 | * From: draft-ietf-dccp-spec-11.txt | 186 | * From RFC 4340, sec. 14.1: |
| 187 | * | 187 | * |
| 188 | * DCCP-Sync packets are the best choice for upward | 188 | * DCCP-Sync packets are the best choice for upward |
| 189 | * probing, since DCCP-Sync probes do not risk application | 189 | * probing, since DCCP-Sync probes do not risk application |
| @@ -733,7 +733,7 @@ static void dccp_v4_ctl_send_reset(struct sk_buff *rxskb) | |||
| 733 | dccp_hdr_reset(skb)->dccph_reset_code = | 733 | dccp_hdr_reset(skb)->dccph_reset_code = |
| 734 | DCCP_SKB_CB(rxskb)->dccpd_reset_code; | 734 | DCCP_SKB_CB(rxskb)->dccpd_reset_code; |
| 735 | 735 | ||
| 736 | /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */ | 736 | /* See "8.3.1. Abnormal Termination" in RFC 4340 */ |
| 737 | seqno = 0; | 737 | seqno = 0; |
| 738 | if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 738 | if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
| 739 | dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); | 739 | dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index c8bf89bfb088..eb0ff7ab05ed 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -550,7 +550,7 @@ static void dccp_v6_ctl_send_reset(struct sk_buff *rxskb) | |||
| 550 | dccp_hdr_reset(skb)->dccph_reset_code = | 550 | dccp_hdr_reset(skb)->dccph_reset_code = |
| 551 | DCCP_SKB_CB(rxskb)->dccpd_reset_code; | 551 | DCCP_SKB_CB(rxskb)->dccpd_reset_code; |
| 552 | 552 | ||
| 553 | /* See "8.3.1. Abnormal Termination" in draft-ietf-dccp-spec-11 */ | 553 | /* See "8.3.1. Abnormal Termination" in RFC 4340 */ |
| 554 | seqno = 0; | 554 | seqno = 0; |
| 555 | if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) | 555 | if (DCCP_SKB_CB(rxskb)->dccpd_ack_seq != DCCP_PKT_WITHOUT_ACK_SEQ) |
| 556 | dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); | 556 | dccp_set_seqno(&seqno, DCCP_SKB_CB(rxskb)->dccpd_ack_seq + 1); |
diff --git a/net/dccp/options.c b/net/dccp/options.c index 07a34696ac97..fb0db1f7cd7b 100644 --- a/net/dccp/options.c +++ b/net/dccp/options.c | |||
| @@ -215,7 +215,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb) | |||
| 215 | elapsed_time); | 215 | elapsed_time); |
| 216 | break; | 216 | break; |
| 217 | /* | 217 | /* |
| 218 | * From draft-ietf-dccp-spec-11.txt: | 218 | * From RFC 4340, sec. 10.3: |
| 219 | * | 219 | * |
| 220 | * Option numbers 128 through 191 are for | 220 | * Option numbers 128 through 191 are for |
| 221 | * options sent from the HC-Sender to the | 221 | * options sent from the HC-Sender to the |
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c index f8ce84759159..955a07abb91d 100644 --- a/net/ipv4/ipconfig.c +++ b/net/ipv4/ipconfig.c | |||
| @@ -420,7 +420,7 @@ ic_rarp_recv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt | |||
| 420 | { | 420 | { |
| 421 | struct arphdr *rarp; | 421 | struct arphdr *rarp; |
| 422 | unsigned char *rarp_ptr; | 422 | unsigned char *rarp_ptr; |
| 423 | unsigned long sip, tip; | 423 | u32 sip, tip; |
| 424 | unsigned char *sha, *tha; /* s for "source", t for "target" */ | 424 | unsigned char *sha, *tha; /* s for "source", t for "target" */ |
| 425 | struct ic_device *d; | 425 | struct ic_device *d; |
| 426 | 426 | ||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c index 4ab368fa0b8f..53bf977cca63 100644 --- a/net/ipv6/netfilter/ip6_tables.c +++ b/net/ipv6/netfilter/ip6_tables.c | |||
| @@ -111,7 +111,7 @@ ip6_packet_match(const struct sk_buff *skb, | |||
| 111 | const char *outdev, | 111 | const char *outdev, |
| 112 | const struct ip6t_ip6 *ip6info, | 112 | const struct ip6t_ip6 *ip6info, |
| 113 | unsigned int *protoff, | 113 | unsigned int *protoff, |
| 114 | int *fragoff) | 114 | int *fragoff, int *hotdrop) |
| 115 | { | 115 | { |
| 116 | size_t i; | 116 | size_t i; |
| 117 | unsigned long ret; | 117 | unsigned long ret; |
| @@ -169,9 +169,11 @@ ip6_packet_match(const struct sk_buff *skb, | |||
| 169 | unsigned short _frag_off; | 169 | unsigned short _frag_off; |
| 170 | 170 | ||
| 171 | protohdr = ipv6_find_hdr(skb, protoff, -1, &_frag_off); | 171 | protohdr = ipv6_find_hdr(skb, protoff, -1, &_frag_off); |
| 172 | if (protohdr < 0) | 172 | if (protohdr < 0) { |
| 173 | if (_frag_off == 0) | ||
| 174 | *hotdrop = 1; | ||
| 173 | return 0; | 175 | return 0; |
| 174 | 176 | } | |
| 175 | *fragoff = _frag_off; | 177 | *fragoff = _frag_off; |
| 176 | 178 | ||
| 177 | dprintf("Packet protocol %hi ?= %s%hi.\n", | 179 | dprintf("Packet protocol %hi ?= %s%hi.\n", |
| @@ -290,7 +292,7 @@ ip6t_do_table(struct sk_buff **pskb, | |||
| 290 | IP_NF_ASSERT(e); | 292 | IP_NF_ASSERT(e); |
| 291 | IP_NF_ASSERT(back); | 293 | IP_NF_ASSERT(back); |
| 292 | if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6, | 294 | if (ip6_packet_match(*pskb, indev, outdev, &e->ipv6, |
| 293 | &protoff, &offset)) { | 295 | &protoff, &offset, &hotdrop)) { |
| 294 | struct ip6t_entry_target *t; | 296 | struct ip6t_entry_target *t; |
| 295 | 297 | ||
| 296 | if (IP6T_MATCH_ITERATE(e, do_match, | 298 | if (IP6T_MATCH_ITERATE(e, do_match, |
| @@ -1438,6 +1440,9 @@ static void __exit ip6_tables_fini(void) | |||
| 1438 | * If target header is found, its offset is set in *offset and return protocol | 1440 | * If target header is found, its offset is set in *offset and return protocol |
| 1439 | * number. Otherwise, return -1. | 1441 | * number. Otherwise, return -1. |
| 1440 | * | 1442 | * |
| 1443 | * If the first fragment doesn't contain the final protocol header or | ||
| 1444 | * NEXTHDR_NONE it is considered invalid. | ||
| 1445 | * | ||
| 1441 | * Note that non-1st fragment is special case that "the protocol number | 1446 | * Note that non-1st fragment is special case that "the protocol number |
| 1442 | * of last header" is "next header" field in Fragment header. In this case, | 1447 | * of last header" is "next header" field in Fragment header. In this case, |
| 1443 | * *offset is meaningless and fragment offset is stored in *fragoff if fragoff | 1448 | * *offset is meaningless and fragment offset is stored in *fragoff if fragoff |
| @@ -1461,12 +1466,12 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
| 1461 | if ((!ipv6_ext_hdr(nexthdr)) || nexthdr == NEXTHDR_NONE) { | 1466 | if ((!ipv6_ext_hdr(nexthdr)) || nexthdr == NEXTHDR_NONE) { |
| 1462 | if (target < 0) | 1467 | if (target < 0) |
| 1463 | break; | 1468 | break; |
| 1464 | return -1; | 1469 | return -ENOENT; |
| 1465 | } | 1470 | } |
| 1466 | 1471 | ||
| 1467 | hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); | 1472 | hp = skb_header_pointer(skb, start, sizeof(_hdr), &_hdr); |
| 1468 | if (hp == NULL) | 1473 | if (hp == NULL) |
| 1469 | return -1; | 1474 | return -EBADMSG; |
| 1470 | if (nexthdr == NEXTHDR_FRAGMENT) { | 1475 | if (nexthdr == NEXTHDR_FRAGMENT) { |
| 1471 | unsigned short _frag_off, *fp; | 1476 | unsigned short _frag_off, *fp; |
| 1472 | fp = skb_header_pointer(skb, | 1477 | fp = skb_header_pointer(skb, |
| @@ -1475,7 +1480,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
| 1475 | sizeof(_frag_off), | 1480 | sizeof(_frag_off), |
| 1476 | &_frag_off); | 1481 | &_frag_off); |
| 1477 | if (fp == NULL) | 1482 | if (fp == NULL) |
| 1478 | return -1; | 1483 | return -EBADMSG; |
| 1479 | 1484 | ||
| 1480 | _frag_off = ntohs(*fp) & ~0x7; | 1485 | _frag_off = ntohs(*fp) & ~0x7; |
| 1481 | if (_frag_off) { | 1486 | if (_frag_off) { |
| @@ -1486,7 +1491,7 @@ int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | |||
| 1486 | *fragoff = _frag_off; | 1491 | *fragoff = _frag_off; |
| 1487 | return hp->nexthdr; | 1492 | return hp->nexthdr; |
| 1488 | } | 1493 | } |
| 1489 | return -1; | 1494 | return -ENOENT; |
| 1490 | } | 1495 | } |
| 1491 | hdrlen = 8; | 1496 | hdrlen = 8; |
| 1492 | } else if (nexthdr == NEXTHDR_AUTH) | 1497 | } else if (nexthdr == NEXTHDR_AUTH) |
diff --git a/net/ipv6/netfilter/ip6t_ah.c b/net/ipv6/netfilter/ip6t_ah.c index ec1b1608156c..46486645eb75 100644 --- a/net/ipv6/netfilter/ip6t_ah.c +++ b/net/ipv6/netfilter/ip6t_ah.c | |||
| @@ -54,9 +54,14 @@ match(const struct sk_buff *skb, | |||
| 54 | const struct ip6t_ah *ahinfo = matchinfo; | 54 | const struct ip6t_ah *ahinfo = matchinfo; |
| 55 | unsigned int ptr; | 55 | unsigned int ptr; |
| 56 | unsigned int hdrlen = 0; | 56 | unsigned int hdrlen = 0; |
| 57 | int err; | ||
| 57 | 58 | ||
| 58 | if (ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL) < 0) | 59 | err = ipv6_find_hdr(skb, &ptr, NEXTHDR_AUTH, NULL); |
| 60 | if (err < 0) { | ||
| 61 | if (err != -ENOENT) | ||
| 62 | *hotdrop = 1; | ||
| 59 | return 0; | 63 | return 0; |
| 64 | } | ||
| 60 | 65 | ||
| 61 | ah = skb_header_pointer(skb, ptr, sizeof(_ah), &_ah); | 66 | ah = skb_header_pointer(skb, ptr, sizeof(_ah), &_ah); |
| 62 | if (ah == NULL) { | 67 | if (ah == NULL) { |
diff --git a/net/ipv6/netfilter/ip6t_frag.c b/net/ipv6/netfilter/ip6t_frag.c index 78d9c8b9e28a..cd22eaaccdca 100644 --- a/net/ipv6/netfilter/ip6t_frag.c +++ b/net/ipv6/netfilter/ip6t_frag.c | |||
| @@ -52,9 +52,14 @@ match(const struct sk_buff *skb, | |||
| 52 | struct frag_hdr _frag, *fh; | 52 | struct frag_hdr _frag, *fh; |
| 53 | const struct ip6t_frag *fraginfo = matchinfo; | 53 | const struct ip6t_frag *fraginfo = matchinfo; |
| 54 | unsigned int ptr; | 54 | unsigned int ptr; |
| 55 | int err; | ||
| 55 | 56 | ||
| 56 | if (ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL) < 0) | 57 | err = ipv6_find_hdr(skb, &ptr, NEXTHDR_FRAGMENT, NULL); |
| 58 | if (err < 0) { | ||
| 59 | if (err != -ENOENT) | ||
| 60 | *hotdrop = 1; | ||
| 57 | return 0; | 61 | return 0; |
| 62 | } | ||
| 58 | 63 | ||
| 59 | fh = skb_header_pointer(skb, ptr, sizeof(_frag), &_frag); | 64 | fh = skb_header_pointer(skb, ptr, sizeof(_frag), &_frag); |
| 60 | if (fh == NULL) { | 65 | if (fh == NULL) { |
diff --git a/net/ipv6/netfilter/ip6t_hbh.c b/net/ipv6/netfilter/ip6t_hbh.c index d32a205e3af2..3f25babe0440 100644 --- a/net/ipv6/netfilter/ip6t_hbh.c +++ b/net/ipv6/netfilter/ip6t_hbh.c | |||
| @@ -65,9 +65,14 @@ match(const struct sk_buff *skb, | |||
| 65 | u8 _opttype, *tp = NULL; | 65 | u8 _opttype, *tp = NULL; |
| 66 | u8 _optlen, *lp = NULL; | 66 | u8 _optlen, *lp = NULL; |
| 67 | unsigned int optlen; | 67 | unsigned int optlen; |
| 68 | int err; | ||
| 68 | 69 | ||
| 69 | if (ipv6_find_hdr(skb, &ptr, match->data, NULL) < 0) | 70 | err = ipv6_find_hdr(skb, &ptr, match->data, NULL); |
| 71 | if (err < 0) { | ||
| 72 | if (err != -ENOENT) | ||
| 73 | *hotdrop = 1; | ||
| 70 | return 0; | 74 | return 0; |
| 75 | } | ||
| 71 | 76 | ||
| 72 | oh = skb_header_pointer(skb, ptr, sizeof(_optsh), &_optsh); | 77 | oh = skb_header_pointer(skb, ptr, sizeof(_optsh), &_optsh); |
| 73 | if (oh == NULL) { | 78 | if (oh == NULL) { |
diff --git a/net/ipv6/netfilter/ip6t_rt.c b/net/ipv6/netfilter/ip6t_rt.c index bcb2e168a5bc..54d7d14134fd 100644 --- a/net/ipv6/netfilter/ip6t_rt.c +++ b/net/ipv6/netfilter/ip6t_rt.c | |||
| @@ -58,9 +58,14 @@ match(const struct sk_buff *skb, | |||
| 58 | unsigned int hdrlen = 0; | 58 | unsigned int hdrlen = 0; |
| 59 | unsigned int ret = 0; | 59 | unsigned int ret = 0; |
| 60 | struct in6_addr *ap, _addr; | 60 | struct in6_addr *ap, _addr; |
| 61 | int err; | ||
| 61 | 62 | ||
| 62 | if (ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL) < 0) | 63 | err = ipv6_find_hdr(skb, &ptr, NEXTHDR_ROUTING, NULL); |
| 64 | if (err < 0) { | ||
| 65 | if (err != -ENOENT) | ||
| 66 | *hotdrop = 1; | ||
| 63 | return 0; | 67 | return 0; |
| 68 | } | ||
| 64 | 69 | ||
| 65 | rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route); | 70 | rh = skb_header_pointer(skb, ptr, sizeof(_route), &_route); |
| 66 | if (rh == NULL) { | 71 | if (rh == NULL) { |
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index 84bbf8474f3e..899de9ed22a6 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
| @@ -505,6 +505,14 @@ __xfrm_state_locate(struct xfrm_state *x, int use_spi, int family) | |||
| 505 | x->id.proto, family); | 505 | x->id.proto, family); |
| 506 | } | 506 | } |
| 507 | 507 | ||
| 508 | static void xfrm_hash_grow_check(int have_hash_collision) | ||
| 509 | { | ||
| 510 | if (have_hash_collision && | ||
| 511 | (xfrm_state_hmask + 1) < xfrm_state_hashmax && | ||
| 512 | xfrm_state_num > xfrm_state_hmask) | ||
| 513 | schedule_work(&xfrm_hash_work); | ||
| 514 | } | ||
| 515 | |||
| 508 | struct xfrm_state * | 516 | struct xfrm_state * |
| 509 | xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | 517 | xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, |
| 510 | struct flowi *fl, struct xfrm_tmpl *tmpl, | 518 | struct flowi *fl, struct xfrm_tmpl *tmpl, |
| @@ -598,6 +606,8 @@ xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, | |||
| 598 | x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; | 606 | x->lft.hard_add_expires_seconds = XFRM_ACQ_EXPIRES; |
| 599 | x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; | 607 | x->timer.expires = jiffies + XFRM_ACQ_EXPIRES*HZ; |
| 600 | add_timer(&x->timer); | 608 | add_timer(&x->timer); |
| 609 | xfrm_state_num++; | ||
| 610 | xfrm_hash_grow_check(x->bydst.next != NULL); | ||
| 601 | } else { | 611 | } else { |
| 602 | x->km.state = XFRM_STATE_DEAD; | 612 | x->km.state = XFRM_STATE_DEAD; |
| 603 | xfrm_state_put(x); | 613 | xfrm_state_put(x); |
| @@ -614,14 +624,6 @@ out: | |||
| 614 | return x; | 624 | return x; |
| 615 | } | 625 | } |
| 616 | 626 | ||
| 617 | static void xfrm_hash_grow_check(int have_hash_collision) | ||
| 618 | { | ||
| 619 | if (have_hash_collision && | ||
| 620 | (xfrm_state_hmask + 1) < xfrm_state_hashmax && | ||
| 621 | xfrm_state_num > xfrm_state_hmask) | ||
| 622 | schedule_work(&xfrm_hash_work); | ||
| 623 | } | ||
| 624 | |||
| 625 | static void __xfrm_state_insert(struct xfrm_state *x) | 627 | static void __xfrm_state_insert(struct xfrm_state *x) |
| 626 | { | 628 | { |
| 627 | unsigned int h; | 629 | unsigned int h; |
