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

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