|
@@ -1894,11 +1894,25 @@ func TestParseWanStatusIPv6Deprecada(t *testing.T) {
|
|
|
// El hijo que netifd crea para un modem lleva las direcciones que el padre no
|
|
// El hijo que netifd crea para un modem lleva las direcciones que el padre no
|
|
|
// tiene: si no se copian, el uplink reporta v4 sin v6.
|
|
// tiene: si no se copian, el uplink reporta v4 sin v6.
|
|
|
func TestWithChildFactsCopiaIPv6(t *testing.T) {
|
|
func TestWithChildFactsCopiaIPv6(t *testing.T) {
|
|
|
- parent := ifaceStatus{Interface: "wwan", Dynamic: true, L3Device: "wwan0"}
|
|
|
|
|
|
|
+ parent := ifaceStatus{Interface: "wwan", L3Device: "wwan0"}
|
|
|
child := ifaceStatus{Interface: "wwan_6", Dynamic: true, L3Device: "wwan0",
|
|
child := ifaceStatus{Interface: "wwan_6", Dynamic: true, L3Device: "wwan0",
|
|
|
IPV6: []ubusIPv6{{Address: "2a0c:5a80:1234::9", Preferred: []byte("7200")}}}
|
|
IPV6: []ubusIPv6{{Address: "2a0c:5a80:1234::9", Preferred: []byte("7200")}}}
|
|
|
- got := withChildFacts(child, []ifaceStatus{parent})
|
|
|
|
|
- if len(got.IPV6) != 1 || got.IPV6[0].Address != "2a0c:5a80:1234::9" {
|
|
|
|
|
- t.Fatalf("ipv6 no copiada del padre: %+v", got.IPV6)
|
|
|
|
|
|
|
+ got := withChildFacts(parent, []ifaceStatus{child})
|
|
|
|
|
+ if globalIPv6(got.IPV6) != "2a0c:5a80:1234::9" {
|
|
|
|
|
+ t.Fatalf("ipv6 no copiada del hijo: %+v", got.IPV6)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+// #2288: en PPPoE el padre lleva la link-local y el hijo dhcpv6 la global.
|
|
|
|
|
+// La puerta antigua ("sin entradas IPv6") no se abria y la WAN se quedaba sin
|
|
|
|
|
+// v6 aunque `ip -6 addr` mostrara la direccion global en el mismo enlace.
|
|
|
|
|
+func TestWithChildFactsPPPoEAdoptaGlobalIPv6(t *testing.T) {
|
|
|
|
|
+ parent := ifaceStatus{Interface: "wan", Proto: "pppoe", L3Device: "pppoe-wan",
|
|
|
|
|
+ IPV6: []ubusIPv6{{Address: "fe80::1/64"}}}
|
|
|
|
|
+ child := ifaceStatus{Interface: "wan_6", Dynamic: true, Proto: "dhcpv6", L3Device: "pppoe-wan",
|
|
|
|
|
+ IPV6: []ubusIPv6{{Address: "2a0c:5a80:1234::9/64", Preferred: []byte("7200")}}}
|
|
|
|
|
+ got := withChildFacts(parent, []ifaceStatus{child})
|
|
|
|
|
+ if wan := wanInfoFrom(got); wan.IPv6 != "2a0c:5a80:1234::9" {
|
|
|
|
|
+ t.Fatalf("wan.ipv6=%q, esperaba la global del hijo dhcpv6", wan.IPv6)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|