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