From 06ec862be4efbd67c725c4ec5177f7c92fb274f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Thu, 16 May 2019 17:23:47 +0200 Subject: [PATCH 1/3] qubesdb: add qubes-mac path entry --- qubes/vm/qubesvm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qubes/vm/qubesvm.py b/qubes/vm/qubesvm.py index 5e65cff0..bc4fe66b 100644 --- a/qubes/vm/qubesvm.py +++ b/qubes/vm/qubesvm.py @@ -2077,6 +2077,7 @@ class QubesVM(qubes.vm.mix.net.NetVMMixin, qubes.vm.BaseVM): self.untrusted_qdb.write('/qubes-netvm-{}-dns'.format(i), addr) if self.netvm is not None: + self.untrusted_qdb.write('/qubes-mac', str(self.mac)) self.untrusted_qdb.write('/qubes-ip', str(self.visible_ip)) self.untrusted_qdb.write('/qubes-netmask', str(self.visible_netmask)) From 9472e7346563b0eb2a9f156cf4e4ffbd6f4b2428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sat, 18 May 2019 12:09:11 +0200 Subject: [PATCH 2/3] mac address: lowercase of default value as in _setter_mac --- qubes/vm/mix/net.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes/vm/mix/net.py b/qubes/vm/mix/net.py index 4d08274e..129bc107 100644 --- a/qubes/vm/mix/net.py +++ b/qubes/vm/mix/net.py @@ -94,7 +94,7 @@ def _setter_provides_network(self, prop, value): class NetVMMixin(qubes.events.Emitter): ''' Mixin containing network functionality ''' mac = qubes.property('mac', type=str, - default='00:16:3E:5E:6C:00', + default='00:16:3e:5e:6c:00', setter=_setter_mac, doc='MAC address of the NIC emulated inside VM') From 1e3e579938e3250bcbf46dcb5553dc4bfbe42e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Pierret=20=28fepitre=29?= Date: Sat, 18 May 2019 13:54:52 +0200 Subject: [PATCH 3/3] tests: handle /qubes-mac --- qubes/tests/vm/qubesvm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/qubes/tests/vm/qubesvm.py b/qubes/tests/vm/qubesvm.py index fda84f1c..201de99e 100644 --- a/qubes/tests/vm/qubesvm.py +++ b/qubes/tests/vm/qubesvm.py @@ -1219,7 +1219,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): destroy - + {extra_ip} @@ -1369,6 +1369,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): '/qubes-iptables-header': iptables_header, '/qubes-service/qubes-update-check': '0', '/qubes-service/meminfo-writer': '1', + '/qubes-mac': '00:16:3e:5e:6c:00', '/qubes-ip': '10.137.0.3', '/qubes-netmask': '255.255.255.255', '/qubes-gateway': '10.137.0.2', @@ -1412,6 +1413,7 @@ class TC_90_QubesVM(QubesVMTestsMixin, qubes.tests.QubesTestCase): del expected['/qubes-ip6'] del expected['/qubes-primary-dns'] del expected['/qubes-secondary-dns'] + del expected['/qubes-mac'] expected['/qubes-netvm-primary-dns'] = '10.139.1.1' expected['/qubes-netvm-secondary-dns'] = '10.139.1.2' expected['/qubes-netvm-network'] = '10.137.0.2'