i am writing an ipv6 enabled version of ping, and i want to dump informations 
collected from ipv6 packets returned by icmpv6 error messages.
the matter is: before i can collect informations from the tcp or udp header
i have to skip the ipv6 extension headers.

i have found some code which does exactly this in the linux kernel, with a 
different purpose. here is a note from alexei kuznetsov (linux kernel 
developer):

/*
 * Skip any extension headers. This is used by the ICMP module.
 *
 * Note that strictly speaking this conflicts with RFC1883 4.0:
 * ...The contents and semantics of each extension header determine whether 
 * or not to proceed to the next header.  Therefore, extension headers must
 * be processed strictly in the order they appear in the packet; a
 * receiver must not, for example, scan through a packet looking for a
 * particular kind of extension header and process that header prior to
 * processing all preceding ones.
 * 
 * We do exactly this. This is a protocol bug. We can't decide after a
 * seeing an unknown discard-with-error flavour TLV option if it's a 
 * ICMP error message or not (errors should never be send in reply to
 * ICMP error messages).
 * 
 * But I see no other way to do this. This might need to be reexamined
 * when Linux implements ESP (and maybe AUTH) headers.
 * --AK
 */

and this is what rfc2460 (section 4.0) says:

   ... to proceed to the next header.  Therefore, extension headers must
   be processed strictly in the order they appear in the packet; a
   receiver must not, for example, scan through a packet looking for a
   particular kind of extension header and process that header prior to
   processing all preceding ones.

it seems to me that there is at least one situation in which ipv6 
extension headers should be skipped - before a packet is sent back
within an icpmv6 error message, the kernel must be sure that it is not
an icmp error message.

i think there are many other situations in which low-level network programs 
need to access payload data without processing extension headers. the 
problems are two: 

        1) ipv6 standards do not seem to permit this    
        2) there is not a standard way to skip ext. headers

imho this wg should consider the following solutions:

        1) permit to programs the skip of the ext. headers IF AND ONLY IF
        they are only interested in collecting data for error reporting 
        purposes.
        2) provide a standard macro that returns protocol id of the upper 
        layer protocol and the offset of the payload from the beginning of 
        the packet, to be included in the next version of 
        draft-ietf-ipngwg-rfc2292bis.

-- 
Aequam memento rebus in arduis servare mentem...

Mauro Tortonesi                 [EMAIL PROTECTED]
Ferrara Linux User Group        http://www.ferrara.linux.it
Project6 - IPv6 for Linux       http://project6.ferrara.linux.it
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to