View | Details | Raw Unified | Return to bug 256309
Collapse All | Expand All

(-)b/net/cloud-init/Makefile (-2 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	cloud-init
1
PORTNAME=	cloud-init
2
DISTVERSION=	20.4.1
2
DISTVERSION=	21.2
3
PORTREVISION=	2
4
CATEGORIES=	net python
3
CATEGORIES=	net python
5
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
4
PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
6
5
(-)b/net/cloud-init/distinfo (-3 / +3 lines)
Lines 1-3 Link Here
1
TIMESTAMP = 1611086699
1
TIMESTAMP = 1625456512
2
SHA256 (canonical-cloud-init-20.4.1_GH0.tar.gz) = 76187a5b1cdda31fe46e993b70e9a3ef5759f5d3cf84eb08520ea19ea80ebcad
2
SHA256 (canonical-cloud-init-21.2_GH0.tar.gz) = f9ee63692a68102c396daf6e9fff5c1dfdec44cba478b4659484f68e58d1b3ca
3
SIZE (canonical-cloud-init-20.4.1_GH0.tar.gz) = 1240251
3
SIZE (canonical-cloud-init-21.2_GH0.tar.gz) = 1289949
(-)b/net/cloud-init/files/patch-cloudinit_net_bsd.py (+60 lines)
Added Link Here
1
--- cloudinit/net/bsd.py.orig	2021-07-05 03:47:58 UTC
2
+++ cloudinit/net/bsd.py
3
@@ -33,7 +33,7 @@ class BSDRenderer(renderer.Renderer):
4
         self.interface_configurations = {}
5
         self._postcmds = config.get('postcmds', True)
6
 
7
-    def _ifconfig_entries(self, settings, target=None):
8
+    def _ifconfig_entries(self, settings):
9
         ifname_by_mac = net.get_interfaces_by_mac()
10
         for interface in settings.iter_interfaces():
11
             device_name = interface.get("name")
12
@@ -76,9 +76,10 @@ class BSDRenderer(renderer.Renderer):
13
                     self.interface_configurations[device_name] = {
14
                         'address': subnet.get('address'),
15
                         'netmask': subnet.get('netmask'),
16
+                        'mtu': subnet.get('mtu') or interface.get('mtu'),
17
                     }
18
 
19
-    def _route_entries(self, settings, target=None):
20
+    def _route_entries(self, settings):
21
         routes = list(settings.iter_routes())
22
         for interface in settings.iter_interfaces():
23
             subnets = interface.get("subnets", [])
24
@@ -101,7 +102,7 @@ class BSDRenderer(renderer.Renderer):
25
             gateway = route.get('gateway')
26
             self.set_route(network, netmask, gateway)
27
 
28
-    def _resolve_conf(self, settings, target=None):
29
+    def _resolve_conf(self, settings):
30
         nameservers = settings.dns_nameservers
31
         searchdomains = settings.dns_searchdomains
32
         for interface in settings.iter_interfaces():
33
@@ -114,11 +115,11 @@ class BSDRenderer(renderer.Renderer):
34
         # fails.
35
         try:
36
             resolvconf = ResolvConf(util.load_file(subp.target_path(
37
-                target, self.resolv_conf_fn)))
38
+                self.target, self.resolv_conf_fn)))
39
             resolvconf.parse()
40
         except IOError:
41
             util.logexc(LOG, "Failed to parse %s, use new empty file",
42
-                        subp.target_path(target, self.resolv_conf_fn))
43
+                        subp.target_path(self.target, self.resolv_conf_fn))
44
             resolvconf = ResolvConf('')
45
             resolvconf.parse()
46
 
47
@@ -136,10 +137,12 @@ class BSDRenderer(renderer.Renderer):
48
             except ValueError:
49
                 util.logexc(LOG, "Failed to add search domain %s", domain)
50
         util.write_file(
51
-            subp.target_path(target, self.resolv_conf_fn),
52
+            subp.target_path(self.target, self.resolv_conf_fn),
53
             str(resolvconf), 0o644)
54
 
55
     def render_network_state(self, network_state, templates=None, target=None):
56
+        if target:
57
+            self.target = target
58
         self._ifconfig_entries(settings=network_state)
59
         self._route_entries(settings=network_state)
60
         self._resolve_conf(settings=network_state)
(-)b/net/cloud-init/files/patch-cloudinit_net_freebsd.py (+21 lines)
Added Link Here
1
--- cloudinit/net/freebsd.py.orig	2021-07-05 03:46:41 UTC
2
+++ cloudinit/net/freebsd.py
3
@@ -19,12 +19,13 @@ class Renderer(cloudinit.net.bsd.BSDRenderer):
4
 
5
     def write_config(self):
6
         for device_name, v in self.interface_configurations.items():
7
+            net_config = 'DHCP'
8
             if isinstance(v, dict):
9
-                self.set_rc_config_value(
10
-                    'ifconfig_' + device_name,
11
-                    v.get('address') + ' netmask ' + v.get('netmask'))
12
-            else:
13
-                self.set_rc_config_value('ifconfig_' + device_name, 'DHCP')
14
+                net_config = v.get('address') + ' netmask ' + v.get('netmask')
15
+                mtu = v.get('mtu')
16
+                if mtu:
17
+                    net_config += (' mtu %d' % mtu)
18
+            self.set_rc_config_value('ifconfig_' + device_name, net_config)
19
 
20
     def start_services(self, run=False):
21
         if not run:

Return to bug 256309