NetBSD Problem Report #15117

Received: (qmail 25790 invoked from network); 2 Jan 2002 21:22:44 -0000
Message-Id: <200201022122.g02LMhM02208@reactor.lugs.com>
Date: Wed, 2 Jan 2002 21:22:43 GMT
From: pds@lugs.com
Reply-To: pds@lugs.com
To: gnats-bugs@gnats.netbsd.org
Subject: igmp v2 router alert kernel bug
X-Send-Pr-Version: 3.95

>Number:         15117
>Category:       kern
>Synopsis:       router alert ip option is not set in igmp v2 packets
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jan 02 21:23:01 +0000 2002
>Closed-Date:    
>Last-Modified:  
>Originator:     Peter Schoenmaker
>Release:        NetBSD 1.5ZA
>Organization:
>Environment:

System: NetBSD reactor.lugs.com 1.5ZA NetBSD 1.5ZA (GENERIC) #1: Thu Dec 27 19:53:46 PST 2001 pds@reactor.lugs.com:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:

    igmpv2 packets do not have the router alert option set in the ip header
    per rfc2236 (ftp://ftp.isi.edu/in-notes/rfc2236.txt.)  without
    the router alert option being set some routers will not process the igmp
    packet.  router alert is rfc 2113 (ftp://ftp.isi.edu/in-notes/rfc2113.txt.)

>How-To-Repeat:

    generate any igmp v2 packet.

>Fix:

    change the igmp code to set the router alert option on all igmp packets
    sent.  The fix is taken directly from FreeBSD igmp.c, and ip.h sources.

    $ cvs diff igmp.c
    Index: igmp.c
    ===================================================================
    RCS file: /cvsroot/syssrc/sys/netinet/igmp.c,v                     
    retrieving revision 1.27                                           
    diff -r1.27 igmp.c                                                 
    72a73                                                              
    > static struct mbuf *router_alert;                                
    78a80,81                                                           
    >       struct ipoption *ra;                                       
    >       
    79a83,95
    >
    >         /*
    >          * Construct a Router Alert option to use in outgoing packets
    >        */                                                            
    >       MGET(router_alert, M_DONTWAIT, MT_DATA);                       
    >         ra = mtod(router_alert, struct ipoption *);                       
    >         ra->ipopt_dst.s_addr = 0;                       
    >         ra->ipopt_list[0] = IPOPT_RA;   /* Router Alert Option */
    >         ra->ipopt_list[1] = 0x04;       /* 4 bytes long */
    >         ra->ipopt_list[2] = 0x00;                         
    >         ra->ipopt_list[3] = 0x00;                         
    >         router_alert->m_len = sizeof(ra->ipopt_dst) + ra->ipopt_list[1];      
    >         
    559c575   
    <       ip_output(m, (struct mbuf *)0, (struct route *)0, IP_MULTICASTOPTS,
    ---                                                                        
    >       ip_output(m, router_alert, (struct route *)0, IP_MULTICASTOPTS,    
    $


    $ cvs diff ip.h
    Index: ip.h
    ===================================================================
    RCS file: /cvsroot/syssrc/sys/netinet/ip.h,v                       
    retrieving revision 1.22                                           
    diff -r1.22 ip.h                                                   
    120a121                                                            
    > #define IPOPT_RA                148             /* router alert */
    $

here is a packet decode from before and after the fix.  204.202.68.142 
netbsd current.  204.202.68.146 has the above igmp fix applied.

here is my packet decode, compared against a machine without the patch.

            204.202.68.142          204.202.68.146

	    Version     4                       4
	    IHL         5                       5
	    TOS         00                      00
	    Length      001c                    0020
	    ID          34c8                    012c
	    Flags       0                       0   
	    frag offset 000                     000   
	    TTL         01                      01    
	    protocol    02                      02    
	    checksum    289e                    c72d  
	    src addr    ccca 448e               ccca 4492
	    dst addr    e90b 6216               e90b 6216
	    optlen                              9404 0000




>Release-Note:
>Audit-Trail:
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.