NetBSD-Bugs archive

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

Re: bin/46580: rtadvd may send RA packet with bad ND option



The following reply was made to PR bin/46580; it has been noted by GNATS.

From: Takahiro HAYASHI <t-hash%abox3.so-net.ne.jp@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/46580: rtadvd may send RA packet with bad ND option
Date: Sun, 17 Jun 2012 18:42:55 +0900

 Does this patch look good?
 
 - start num of prefixes(tmp->pfxs) with 0, not 1.
   tmp->prefix is TAILQ of the prefixes that are
   described in config so that pfxs should start with 0.
 - inclease num of prefixes(rai->pfxs) in get_prefix()
   if valid prefixes are found.
   (get_prefix() is called when tmp->prefix is empty)
 
 Index: src/usr.sbin/rtadvd/config.c
 ===================================================================
 RCS file: /cvsroot/src/usr.sbin/rtadvd/config.c,v
 retrieving revision 1.27
 diff -u -p -r1.27 config.c
 --- src/usr.sbin/rtadvd/config.c       11 Dec 2011 20:44:44 -0000      1.27
 +++ src/usr.sbin/rtadvd/config.c       15 Jun 2012 09:38:57 -0000
 @@ -290,7 +290,7 @@ getconfig(const char *intface)
        MAYHAVE(val, "clockskew", 0);
        tmp->clockskew = val;
  
 -      tmp->pfxs++;
 +      tmp->pfxs = 0;
        TAILQ_INIT(&tmp->prefix);
        for (i = -1; i < MAXPREFIX; i++) {
                struct prefix *pfx;
 @@ -763,6 +763,7 @@ get_prefix(struct rainfo *rai)
  
                /* link into chain */
                TAILQ_INSERT_TAIL(&rai->prefix, pp, next);
 +              rai->pfxs++;
        }
  
        freeifaddrs(ifap);
 


Home | Main Index | Thread Index | Old Index