Am 11/03/12 17:12, schrieb Florian Riehm:
> Hi,
> 
> recently I noticed that ifconfig doesn't handle cloning routes
> correctly, if I add/delete ipv6 addresses to interfaces.
> 
> After removing an ipv6 address on an interface, the cloning route still
> exists. After removing the cloning route by hand, everything seems to be
> ok, but after adding the same address again, no cloning route gets
> created anymore.
> 
> On OpenBSD 5.1 cloning routes get created and deleted correctly with the
> ipv6 addresses.
> On OpenBSD 5.2 and Current (2012-10-31) the problem occure.
> 
> How to reproduce:
> 
> [root@ospf2 ~]# ifconfig em3
> em3: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
>         lladdr 08:00:27:7c:76:1b
>         priority: 0
>         media: Ethernet autoselect (1000baseT full-duplex)
>         status: active
>         inet6 fe80::a00:27ff:fe7c:761b%em3 prefixlen 64 scopeid 0x4
>         inet 192.168.58.101 netmask 0xffffff00 broadcast 192.168.58.255
> 
> // Add ipv6 address to an interface and check routing information:
> [root@ospf2 ~]# ifconfig em3 inet6 fd55::5/64
> [root@ospf2 ~]# netstat -rn | grep fd55
> fd55::/64                          link#4                         UC
> 0        0     -     4 em3
> fd55::5                            08:00:27:7c:76:1b              UHL
> 0        0     -     4 lo0
> // It's ok
> 
> // delete ipv6 address again
> [root@ospf2 ~]# ifconfig em3 inet6 delete fd55::5
> [root@ospf2 ~]# netstat -rn | grep fd55
> fd55::/64                          link#4                         UC
> 0        0     -     4 em3
> // XXX: cloning route still exists.
> 
> // delete cloning route by hand
> [root@ospf2 ~]# route delete -inet6 fd55::/64
> delete net fd55::/64
> [root@ospf2 ~]# netstat -rn | grep fd55
> // It seems to be ok
> 
> // Add THE SAME ipv6 address again and check routing information:
> [root@ospf2 ~]# ifconfig em3 inet6 fd55::5/64
> [root@ospf2 ~]# netstat -rn | grep fd55
> fd55::5                            08:00:27:7c:76:1b              UHL
> 0        0     -     4 lo0
> // XXX: Now the cloning route is missing
> 
> // Add missing cloning route by hand
> [root@ospf2 ~]# route add -inet6 fd55::/64 -cloning -nostatic -iface
> fd55::5
> add net fd55::/64: gateway fd55::5
> [root@ospf2 ~]# netstat -rn | grep fd55
> fd55::/64                          link#4                         UC
> 0        0     -    56 em3
> fd55::5                            08:00:27:7c:76:1b              UHL
> 0        0     -     4 lo0
> // It seems to be ok
> // Add a different address
> [root@ospf2 ~]# ifconfig em3 inet6 fd66::6/64
> [root@ospf2 ~]# netstat -rn | grep fd66
> fd66::/64                          link#4                         UC
> 0        0     -     4 em3
> fd66::6                            08:00:27:7c:76:1b              UHL
> 0        0     -     4 lo0
> // cloning route has been created.
> 
> 
> Does anybody know what's the reason for the changed behavior?
> A bug in ifconfig or somewhere in the routing table?
> 
> Please let me know if further information are required.
> 
> Thanks.
> 
> friehm
> 

Today I have figured out some more details:

The problem has occured since the following change:
src/sys/netinet6/in6.c 1.98
src/sys/netinet6/nd6_rtr.c 1.60

After removing the ipv6 address (it's the last one for a specific
prefix) the ndp prefix entry doesn't get removed.

After flushing the ndp prefix entry table by hand the cloning route goes
away but the ndp prefix entry still exists with a ref value of 1.

I'm thinking about how to fix this...

My first idea was to call prelist_remove() if the last address within a
specific prefix gets removed. But exactly this behavior was removed by
the change above. So I'm sure there is a good reason for removing this.

Any suggestions how to fix this? Why not call prelist_remove() if the
last address within a specific prefix gets removed?

Thanks.

friehm

Reply via email to