dhcpcd-discuss

bug report about the ipv6rs DAD

jayce lee

Sat Jun 08 21:44:49 2013

Hi, Roy.

I found a bug about the ipv6rs DAD process if the RA contains two prefix
info options and one for auto-configuration and the other not. My
radvd.conf is as follows:
Only the first prefix should carry out DAD, for the second is not used to
autoconfiguration.
But now both of them will do DAD work and the program will continue to wait
for IPv6 RA DAD.

I have fixed the bug, but I seemed can't submit via git.

Thank you.

Jayce

diff --git a/ipv6rs.c b/ipv6rs.c
index 1c05f4e..3130297 100644
--- a/ipv6rs.c
+++ b/ipv6rs.c
@@ -414,7 +414,7 @@ ipv6rs_scriptrun(const struct ra *rap)

  /* If all addresses have completed DAD run the script */
  TAILQ_FOREACH(ap, &rap->addrs, next) {
- if ((ap->flags & IPV6_AF_AUTOCONF)&&(ap->flags & IPV6_AF_DADCOMPLETED) ==
0) {
+ if ((ap->flags & IPV6_AF_DADCOMPLETED) == 0) {
  syslog(LOG_DEBUG,
     "%s: waiting for Router Advertisement"
     " DAD to complete",
@@ -481,7 +481,7 @@ ipv6rs_dadcallback(void *arg)
  continue;
  wascompleted = 1;
  TAILQ_FOREACH(rapap, &rap->addrs, next) {
- if (!(rapap->flags & IPV6_AF_DADCOMPLETED)&&(rapap->flags &
IPV6_AF_AUTOCONF)){
+ if ((rapap->flags & IPV6_AF_DADCOMPLETED) == 0){
  wascompleted = 0;
  break;
  }
@@ -750,7 +750,7 @@ ipv6rs_handledata(__unused void *arg)
  break;
  }
  ap->iface = rap->iface;
- ap->flags = IPV6_AF_NEW;
+ ap->flags = IPV6_AF_NEW | IPV6_AF_AUTOCONF;
  ap->prefix_len = pi->nd_opt_pi_prefix_len;
  memcpy(ap->prefix.s6_addr,
    pi->nd_opt_pi_prefix.s6_addr,
@@ -758,7 +758,6 @@ ipv6rs_handledata(__unused void *arg)
  if (pi->nd_opt_pi_flags_reserved &
     ND_OPT_PI_FLAG_AUTO)
  {
- ap->flags |= IPV6_AF_AUTOCONF;
  ipv6_makeaddr(&ap->addr, ifp,
     &ap->prefix,
     pi->nd_opt_pi_prefix_len);

interface eth0
{
        AdvSendAdvert on;
        MinRtrAdvInterval 30;
        MaxRtrAdvInterval 100;
        AdvHomeAgentFlag off;
        AdvManagedFlag on;
        AdvOtherConfigFlag off;
        AdvLinkMTU 1500;
        prefix 2001:1234:5678::/64
        {
                AdvOnLink on;
                AdvAutonomous on;
        };
        prefix 2001:1234:5679::/64
        {
                AdvOnLink on;
                AdvAutonomous off;
        };
};

Follow-Ups:
Re: bug report about the ipv6rs DADRoy Marples
Archive administrator: postmaster@marples.name