[radvd-devel-l] resetting ipv6-allrouters membership on eth6

Reuben Hawkins reubenhwk at gmail.com
Sun Jun 6 12:14:07 EDT 2010


Hi Ivan,

This seems like it's a simple fscanf parsing issue.  Please try the attached
patch (I've also inlined the code below).  It seems to fix the issue for me.


int check_allrouters_membership(struct Interface *iface)
{
    #define ALL_ROUTERS_MCAST "ff020000000000000000000000000002"

    FILE *fp;
    unsigned int if_idx, allrouters_ok=0;
    char addr[32+1];
    char buffer[301] = {""}, *str;
    int ret=0;

    if ((fp = fopen(PATH_PROC_NET_IGMP6, "r")) == NULL)
    {
        flog(LOG_ERR, "can't open %s: %s", PATH_PROC_NET_IGMP6,
            strerror(errno));
        return (-1);
    }

    str = fgets(buffer, 300, fp);

    while (str && (ret = sscanf(str, "%u %*s %32[0-9A-Fa-f]", &if_idx,
addr)) ) {
        if (ret == 2) {
            if (iface->if_index == if_idx) {
                if (strncmp(addr, ALL_ROUTERS_MCAST, sizeof(addr)) == 0){
                    allrouters_ok = 1;
                    break;
                }
            }
        }
        str = fgets(buffer, 300, fp);
    }

    fclose(fp);

    if (!allrouters_ok) {
        flog(LOG_WARNING, "resetting ipv6-allrouters membership on %s",
iface->Name);
        setup_allrouters_membership(iface);
    }

    return(0);
}

I see there's a few other potential problems with similar code in the same
file that may need adjustment..

Thanks,
Reuben

On Sun, Jun 6, 2010 at 5:41 AM, Ivan Skytte Jørgensen <isj-radvddev at i1.dk>wrote:

> On Tuesday 04 May 2010 08:47:53 Pekka Savola wrote:
> > On Thu, 29 Apr 2010, Ivan Skytte Jørgensen wrote:
> ...
> > Sorry for delay in this. I couldn't reproduce this on F12
> > (2.6.32.12-114). (But I did find another bug :-()
>
> I just checked with kernel 2.6.31 (opensuse 11.2) inside VMWare. I can
> easily reproduce the error with both radvd-1.6 and the latest source from
> CVS.
>
> Configuration:
>  3 interfaces.(eth0, eth1, eth2)
>  radvd.conf contains configuration for eth1 and eth2
> Procedure:
>  start radvd
>  wait
>  ifdown eth2
>  wait
>  ifup eth2
> Then radvd continues with "resetting ipv6-allrouters membership on eth2"
> again and again.
>
> Regards,
>  Ivan
>
> --
> radvd-devel-l mailing list  :  radvd-devel-l at litech.org
> http://lists.litech.org/listinfo/radvd-devel-l
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.litech.org/pipermail/radvd-devel-l/attachments/20100606/8def7131/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: device-linux.diff
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://lists.litech.org/pipermail/radvd-devel-l/attachments/20100606/8def7131/attachment.bin>


More information about the radvd-devel-l mailing list