NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/44838: announcement from rtadvd(8) does not reflect interface change



>Number:         44838
>Category:       bin
>Synopsis:       announcement from rtadvd(8) does not reflect interface change
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 06 15:25:00 +0000 2011
>Originator:     Takahiro HAYASHI
>Release:        NetBSD 5.99.48
>Organization:
>Environment:
System: NetBSD mistilteinn 5.99.48 NetBSD 5.99.48 (XEN3PAEDOMU) #3: Wed Mar 23 
23:48:19 JST 2011 
root@rio:/usr/build/obj.i386/sys/arch/i386/compile/XEN3PAEDOMU i386
Architecture: i386
Machine: i386
>Description:
        Router advertisement from rtadvd(8) does not reflect the
        change of interface addresses after change of 64-bit clean
        routing socket on Feb 1 2011.
        This program should use RT_ROUNDUP() macro defined in <net/route.h>.
>How-To-Repeat:
        1. start rtadvd
        2. run tcpdump -nvp -i ifname -s2000 icmp6 and 'ip6[40:1] == 134'
        3. add prefix to interface
>Fix:
        To avoid this problem, kill and restart rtadvd when route
        or interface informations are changed.
        Or please apply this patch unless you have better idea.

Index: src/usr.sbin/rtadvd/if.c
===================================================================
RCS file: /cvsroot/src/usr.sbin/rtadvd/if.c,v
retrieving revision 1.18
diff -u -p -r1.18 if.c
--- src/usr.sbin/rtadvd/if.c    5 Mar 2006 23:47:08 -0000       1.18
+++ src/usr.sbin/rtadvd/if.c    6 Apr 2011 10:38:04 -0000
@@ -50,6 +50,10 @@
 #include "rtadvd.h"
 #include "if.h"
 
+#if defined(__NetBSD__) && defined(RT_ROUNDUP)
+#define NEXT_SA(ap) (ap) = (struct sockaddr *) \
+       ((caddr_t)(ap) + RT_ROUNDUP((ap)->sa_len))
+#else
 #define ROUNDUP(a, size) \
        (((a) & ((size)-1)) ? (1 + ((a) | ((size)-1))) : (a))
 
@@ -57,6 +61,7 @@
        ((caddr_t)(ap) + ((ap)->sa_len ? ROUNDUP((ap)->sa_len,\
                                                 sizeof(u_long)) :\
                                                 sizeof(u_long)))
+#endif /* defined(__NetBSD__) && defined(RT_ROUNDUP) */
 
 struct if_msghdr **iflist;
 int iflist_init_ok;

--
Takahiro HAYASHI



Home | Main Index | Thread Index | Old Index