Subject: kern/15117: igmp v2 router alert kernel bug
To: None <gnats-bugs@gnats.netbsd.org>
From: None <pds@lugs.com>
List: netbsd-bugs
Date: 01/02/2002 21:22:43
>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 13:23:01 PST 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: