Changeset 6703
- Timestamp:
- 07/18/12 14:03:51 (10 months ago)
- Files:
-
- 1 modified
-
protlib/trunk/src/tp_queryencap.cpp (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
protlib/trunk/src/tp_queryencap.cpp
r6595 r6703 533 533 534 534 // We have to look for RAO option in Hop-by-Hop extension header, if it is NOT set to a value we look for, don't intercept 535 // Hbh-Extension and Destination Option headers have this format: 536 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - 537 // | Option Type | Opt Data Len | Option Data 538 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- - - - - - - - - 539 535 540 if (intercept) 536 541 { … … 594 599 } 595 600 else 596 { 601 { // either intercept or no interception yet but maybe rao matching not necessary 597 602 if (intercept) 598 603 { … … 607 612 } 608 613 609 int offset = ip6_headerlen; // will point to IP payload , initially size of IPv6 header614 int offset = ip6_headerlen; // will point to IP payload or next extension header, initially size of IPv6 header 610 615 611 616 // one RAO value matched (or we do not require strict RAO checking), now check for magic number … … 617 622 // Now to do: iterate over extension headers to find the start of the UDP header 618 623 // the first extension header is the hop-by-hop options header and it is present 619 // if RAO was used 624 // if RAO was used. 620 625 struct ip6_ext *extheader = (struct ip6_ext *) (m->payload + offset); 621 626 … … 627 632 else 628 633 { 629 // assume that some extension header is present 634 // assume that some extension header is present (at least the RAO) 630 635 next_header= extheader->ip6e_nxt; 631 636 // iterate if next header is not UDP … … 633 638 { 634 639 // advance to next extension header 640 // Note that the Length of the Hop-by-Hop Options header is given in 8-octet units, 641 // not including the first 8 octets. 642 635 643 offset = offset + 8 + (extheader->ip6e_len * 8); 636 644 if (offset > 20000) // sanity check … … 645 653 } // end while 646 654 } 655 // now next_header points to UDP content 656 647 657 // set offset to next header following the last extension header that we saw 648 658 offset = offset + 8 + (extheader->ip6e_len * 8); … … 737 747 tpmsg = new (nothrow) TPMsg (netmsg, peer_addr->copy(), own_addr->copy()); 738 748 739 Log (DEBUG_LOG, LOG_NORMAL,tpparam.name,749 DLog(tpparam.name, 740 750 "[IPv6catcher] - receipt of PDU now complete, sending msg#" << tpmsg->get_id() << " to signaling module"); 741 751 … … 750 760 } // endif 751 761 } // endif intercept 762 else 763 { // this module should not intercept the packet -> pass it on to the normal IP stack processing 764 DLog(tpparam.name, 765 "[IPv6catcher] - no interception here, will pass it on to IP stack for further processing"); 766 767 status = ipq_set_verdict (h, m->packet_id, NF_ACCEPT, 0, NULL); 768 if (status < 0) 769 die (h); 770 771 } 752 772 } // end case IQM_PACKET 753 773 break;