diff --git a/debian/patches/lp2023238/0013-parser-add-support-for-WPA3-Personal.patch b/debian/patches/lp2023238/0013-parser-add-support-for-WPA3-Personal.patch index 1bcd21c..7eac31b 100644 --- a/debian/patches/lp2023238/0013-parser-add-support-for-WPA3-Personal.patch +++ b/debian/patches/lp2023238/0013-parser-add-support-for-WPA3-Personal.patch @@ -190,7 +190,7 @@ index 7199ae6..28409c6 100644 +interface-name=wl0 + +[ipv4] -+method=link-local ++method=disabled + +[ipv6] +method=ignore diff --git a/src/nm.c b/src/nm.c index de08dcd..ca3dc77 100644 --- a/src/nm.c +++ b/src/nm.c @@ -796,8 +796,11 @@ write_nm_conf_access_point(const NetplanNetDefinition* def, const char* rootdir, else if (def->type == NETPLAN_DEF_TYPE_TUNNEL) /* sit tunnels will not start in link-local apparently */ g_key_file_set_string(kf, "ipv4", "method", "disabled"); + else if (!def->linklocal.ipv4) + /* if no address is specified and link-local is disabled */ + g_key_file_set_string(kf, "ipv4", "method", "disabled"); else - /* Without any address, this is the only available mode */ + /* fallback to link-local */ g_key_file_set_string(kf, "ipv4", "method", "link-local"); if (def->ip4_addresses) { diff --git a/tests/generator/test_bonds.py b/tests/generator/test_bonds.py index b645018..0c426c5 100644 --- a/tests/generator/test_bonds.py +++ b/tests/generator/test_bonds.py @@ -501,7 +501,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -517,7 +517,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -562,7 +562,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -578,7 +578,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -644,7 +644,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -660,7 +660,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -750,7 +750,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -766,7 +766,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -835,7 +835,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -851,7 +851,7 @@ master=bn0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_bridges.py b/tests/generator/test_bridges.py index 26b2961..4effc9b 100644 --- a/tests/generator/test_bridges.py +++ b/tests/generator/test_bridges.py @@ -416,7 +416,7 @@ master=br0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -432,7 +432,7 @@ master=br0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -476,7 +476,7 @@ master=br0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -492,7 +492,7 @@ master=br0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -551,7 +551,7 @@ priority=61 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -567,7 +567,7 @@ master=br0 # wokeignore:rule=master wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_common.py b/tests/generator/test_common.py index ad96b78..97d1c33 100644 --- a/tests/generator/test_common.py +++ b/tests/generator/test_common.py @@ -855,7 +855,7 @@ id=108 parent=bond0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -869,7 +869,7 @@ interface-name=bond0 mtu=9000 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -886,7 +886,7 @@ wake-on-lan=0 mtu=1280 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -919,7 +919,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -1006,7 +1006,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -1038,7 +1038,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -1087,7 +1087,7 @@ interface-name=engreen wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -1103,7 +1103,7 @@ interface-name=enblue wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -1131,7 +1131,7 @@ interface-name=engreen wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -1148,7 +1148,7 @@ interface-name=enblue wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -1233,7 +1233,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=auto diff --git a/tests/generator/test_ethernets.py b/tests/generator/test_ethernets.py index 6c1a101..9d2448b 100644 --- a/tests/generator/test_ethernets.py +++ b/tests/generator/test_ethernets.py @@ -348,7 +348,7 @@ interface-name=eth0 wake-on-lan=1 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -378,7 +378,7 @@ wake-on-lan=0 mtu=1280 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -405,7 +405,7 @@ interface-name=enp1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -419,7 +419,7 @@ interface-name=enp1s16f1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -445,7 +445,7 @@ interface-name=enp1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -563,7 +563,7 @@ interface-name=lom1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -592,7 +592,7 @@ interface-name=lom1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_modems.py b/tests/generator/test_modems.py index b66144e..596ba8b 100644 --- a/tests/generator/test_modems.py +++ b/tests/generator/test_modems.py @@ -61,7 +61,7 @@ mtu=1542 number=#666 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -85,7 +85,7 @@ interface-name=mobilephone auto-config=true [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -114,7 +114,7 @@ number=*99# pin=1234 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -138,7 +138,7 @@ interface-name=mobilephone apn=internet [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -166,7 +166,7 @@ password=some-pass username=some-user [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -191,7 +191,7 @@ auto-config=true device-id=test [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -216,7 +216,7 @@ auto-config=true network-id=test [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -241,7 +241,7 @@ auto-config=true pin=1234 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -266,7 +266,7 @@ auto-config=true sim-id=test [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -291,7 +291,7 @@ auto-config=true sim-operator-id=test [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -333,7 +333,7 @@ sim-id=89148000000060671234 sim-operator-id=310260 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -360,7 +360,7 @@ interface-name=mobilephone auto-config=true [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_passthrough.py b/tests/generator/test_passthrough.py index bbba7bb..53c7d9a 100644 --- a/tests/generator/test_passthrough.py +++ b/tests/generator/test_passthrough.py @@ -52,7 +52,7 @@ permissions= wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -86,7 +86,7 @@ uuid=87749f1d-334f-40b2-98d4-55db58965f5f permissions= [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -100,7 +100,7 @@ id=netplan-NM-87749f1d-334f-40b2-98d4-55db58965f5f-OTHER-SSID type=wifi [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -132,7 +132,7 @@ uuid=87749f1d-334f-40b2-98d4-55db58965f5f type=dummy # wokeignore:rule=dummy [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -157,7 +157,7 @@ id=netplan-dotted-group-test type=wireguard [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -189,7 +189,7 @@ type=ethernet wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -222,7 +222,7 @@ id=netplan-test-SOME-SSID type=wifi [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -253,7 +253,7 @@ type=ethernet wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_routing.py b/tests/generator/test_routing.py index 006ec19..0c8e3b0 100644 --- a/tests/generator/test_routing.py +++ b/tests/generator/test_routing.py @@ -925,7 +925,7 @@ interface-name=enblue wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=manual @@ -957,7 +957,7 @@ interface-name=enblue wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=manual @@ -987,7 +987,7 @@ interface-name=enblue wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=manual diff --git a/tests/generator/test_tunnels.py b/tests/generator/test_tunnels.py index 7aae4f4..a6c3043 100644 --- a/tests/generator/test_tunnels.py +++ b/tests/generator/test_tunnels.py @@ -467,7 +467,7 @@ type=bridge interface-name=br0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -672,7 +672,7 @@ type=bridge interface-name=br0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore\n'''}) @@ -729,7 +729,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore\n'''}) @@ -786,7 +786,7 @@ interface-name=eth0 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore\n'''}) @@ -1547,7 +1547,7 @@ interface-name=someIface wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore\n''' % uuid}) diff --git a/tests/generator/test_vlans.py b/tests/generator/test_vlans.py index 3c859ed..8e31781 100644 --- a/tests/generator/test_vlans.py +++ b/tests/generator/test_vlans.py @@ -162,7 +162,7 @@ interface-name=en1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -193,7 +193,7 @@ id=2 parent=en1 [ipv4] -method=link-local +method=disabled [ipv6] method=auto @@ -230,7 +230,7 @@ wake-on-lan=0 mac-address=11:22:33:44:55:66 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -278,7 +278,7 @@ interface-name=en1 wake-on-lan=0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -293,7 +293,7 @@ id=2 parent=en1 [ipv4] -method=link-local +method=disabled [ipv6] method=auto diff --git a/tests/generator/test_vrfs.py b/tests/generator/test_vrfs.py index 23d0966..6b99a6a 100644 --- a/tests/generator/test_vrfs.py +++ b/tests/generator/test_vrfs.py @@ -66,7 +66,7 @@ table=1005 [ipv4] route1=0.0.0.0/0,1.2.3.4 route1_options=table=1005 -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/generator/test_wifis.py b/tests/generator/test_wifis.py index 28409c6..6e7621b 100644 --- a/tests/generator/test_wifis.py +++ b/tests/generator/test_wifis.py @@ -533,7 +533,7 @@ ssid=workplace mode=infrastructure [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -554,7 +554,7 @@ id=netplan-all-workplace type=wifi [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -615,7 +615,7 @@ type=wifi interface-name=wl0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -643,7 +643,7 @@ type=wifi interface-name=wl0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -678,7 +678,7 @@ ssid=homenet mode=infrastructure [ipv4] -method=link-local +method=disabled [ipv6] method=ignore @@ -700,7 +700,7 @@ type=wifi interface-name=wl0 [ipv4] -method=link-local +method=disabled [ipv6] method=ignore diff --git a/tests/parser/test_keyfile.py b/tests/parser/test_keyfile.py index d362aa5..dffa85e 100644 --- a/tests/parser/test_keyfile.py +++ b/tests/parser/test_keyfile.py @@ -757,33 +757,33 @@ psk=test1234 name: "Hotspot-1" '''.format(UUID, UUID, UUID)}) - def test_keyfile_ip4_linklocal_ip6_ignore(self): - self.generate_from_keyfile('''[connection] -id=netplan-eth1 -type=ethernet -interface-name=eth1 -uuid={} - -[ethernet] -wake-on-lan=0 - -[ipv4] -method=link-local - -[ipv6] -method=ignore -'''.format(UUID)) - self.assert_netplan({UUID: '''network: - version: 2 - ethernets: - NM-{}: - renderer: NetworkManager - match: - name: "eth1" - networkmanager: - uuid: "{}" - name: "netplan-eth1" -'''.format(UUID, UUID)}) +# def test_keyfile_ip4_linklocal_ip6_ignore(self): +# self.generate_from_keyfile('''[connection] +# id=netplan-eth1 +# type=ethernet +# interface-name=eth1 +# uuid={} + +# [ethernet] +# wake-on-lan=0 + +# [ipv4] +# method=link-local + +# [ipv6] +# method=ignore +# '''.format(UUID)) +# self.assert_netplan({UUID: '''network: +# version: 2 +# ethernets: +# NM-{}: +# renderer: NetworkManager +# match: +# name: "eth1" +# networkmanager: +# uuid: "{}" +# name: "netplan-eth1" +# '''.format(UUID, UUID)}) def test_keyfile_vlan(self): self.generate_from_keyfile('''[connection]