radvd issue on CURRENT

Kristof Provost kp at FreeBSD.org
Fri Jul 3 06:31:20 UTC 2015


> On 03 Jul 2015, at 07:10, Kubilay Kocak <koobs at FreeBSD.org> wrote:
> 
> On 3/07/2015 6:12 AM, Kristof Provost wrote:
>> Hi,
>> 
>> In the process of setting up my TPLink device (Thanks Allan!) I ran
>> into problems getting radvd to work.
>> 
> 
> Just for clarity, what TP-Link device?
It’s a TL-WDR3600.

> pciconf -lvc output would be handy (for me, possibly others and google)
# pciconf -lvc
ath1 at pci0:0:0:0:        class=0x028000 card=0xa120168c chip=0x0033168c rev=0x01 hdr=0x00
    class      = network
    cap 01[40] = powerspec 3  supports D0 D1 D3  current D0
    cap 05[50] = MSI supports 4 messages, 64 bit, vector masks
    cap 10[70] = PCI-Express 2 endpoint max data 128(128) link x1(x1)
                 speed 2.5(2.5) ASPM disabled(L0s/L1)
    ecap 0001[100] = AER 1 0 fatal 0 non-fatal 0 corrected
    ecap 0002[140] = VC 1 max VC0
    ecap 0003[300] = Serial 1 0000000000000000

It’s not a hardware issue though, it’s a bug in the ip6 stack.
This fixes it for me, but I’m not sure it’s the best approach.
I’ll look at it some more over the weekend to see if I can come up with something better:

diff --git a/sys/netinet6/ip6_output.c b/sys/netinet6/ip6_output.c
index d667903..bcca2fa 100644
--- a/sys/netinet6/ip6_output.c
+++ b/sys/netinet6/ip6_output.c
@@ -2565,10 +2565,30 @@ ip6_setpktopt(int optname, u_char *buf, int len, struct ip6_pktopts *opt,
                if (ifp != NULL &&
                    !IN6_IS_ADDR_UNSPECIFIED(&pktinfo->ipi6_addr)) {
                        struct in6_ifaddr *ia;
-
-                       ia = in6ifa_ifpwithaddr(ifp, &pktinfo->ipi6_addr);
-                       if (ia == NULL)
+                       struct in6_addr in6;
+
+                       bcopy(&pktinfo->ipi6_addr, &in6, sizeof(in6));
+                       in6_setscope(&in6, ifp, NULL);
+
+                       ia = in6ifa_ifpwithaddr(ifp, &in6);
+                       if (ia == NULL) {

— 
Kristof


More information about the freebsd-net mailing list