From nobody Mon May 31 19:40:17 2021 X-Original-To: ports-bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id F0BDABFED6F for ; Mon, 31 May 2021 19:40:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Fv5H567Qwz4n00 for ; Mon, 31 May 2021 19:40:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BC23716221 for ; Mon, 31 May 2021 19:40:17 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 14VJeHTG049217 for ; Mon, 31 May 2021 19:40:17 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 14VJeH8U049215 for ports-bugs@FreeBSD.org; Mon, 31 May 2021 19:40:17 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 256309] net/cloud-init: fix set mtu (work in progress) Date: Mon, 31 May 2021 19:40:17 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: andrey@bsdnir.info X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: ports-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Ports bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-ports-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-ports-bugs@freebsd.org X-BeenThere: freebsd-ports-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256309 Bug ID: 256309 Summary: net/cloud-init: fix set mtu (work in progress) Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: ports-bugs@FreeBSD.org Reporter: andrey@bsdnir.info Upstream have patch https://github.com/canonical/cloud-init/pull/894/files but, this add set mtu only "subnets:" section, docs and may by some dadasou= rce (SmartOS) support only set mtu in "config:" section, linux's have any with subnets priority `netplan.py[WARNING]: Network config: ignoring enp0s5 device-level mtu:1500 because ipv4 subnet-level mtu:1501 provided.` proof of concept get data in config section, but linux have logic https://github.com/canonical/cloud-init/blob/master/cloudinit/net/netplan.p= y#L116 (line 134) https://github.com/canonical/cloud-init/blob/master/cloudinit/net/eni.py#L1= 07 ``` --- /usr/local/lib/python3.8/site-packages/cloudinit/net/bsd.py.orig=20=20= =20 2021-01-15 17:33:05.000000000 +0000 +++ /usr/local/lib/python3.8/site-packages/cloudinit/net/bsd.py 2021-05-31 19:30:55.808268000 +0000 @@ -37,7 +37,9 @@ class BSDRenderer(renderer.Renderer): ifname_by_mac =3D net.get_interfaces_by_mac() for interface in settings.iter_interfaces(): device_name =3D interface.get("name") + device_mtu =3D interface.get("mtu") device_mac =3D interface.get("mac_address") + LOG.info('Debug interface mtu %s', device_mtu) if device_name and re.match(r'^lo\d+$', device_name): continue if device_mac not in ifname_by_mac: @@ -64,18 +66,21 @@ class BSDRenderer(renderer.Renderer): for subnet in interface.get("subnets", []): if subnet.get('type') =3D=3D 'static': + LOG.debug('Debug mtu %s', subnet.get('mtu')) + LOG.debug('Debug address %s', subnet.get('address')) if not subnet.get('netmask'): LOG.debug( 'Skipping IP %s, because there is no netmask', subnet.get('address') ) continue - LOG.debug('Configuring dev %s with %s / %s', device_na= me, - subnet.get('address'), subnet.get('netmask')) + LOG.debug('Configuring dev %s with %s / %s mtu %s, dev= ice mtu %s', device_name, + subnet.get('address'), subnet.get('netmask'), subnet.get('mtu'), device_mtu) self.interface_configurations[device_name] =3D { 'address': subnet.get('address'), 'netmask': subnet.get('netmask'), + 'mtu': device_mtu, } def _route_entries(self, settings, target=3DNone): --- /usr/local/lib/python3.8/site-packages/cloudinit/net/freebsd.py.orig=20= =20=20=20=20=20=20 2021-01-15 17:33:05.000000000 +0000 +++ /usr/local/lib/python3.8/site-packages/cloudinit/net/freebsd.py=20=20= =20=20 2021-05-31 19:31:29.486255000 +0000 @@ -19,12 +19,13 @@ class Renderer(cloudinit.net.bsd.BSDRenderer): def write_config(self): for device_name, v in self.interface_configurations.items(): + net_config =3D 'DHCP' if isinstance(v, dict): - self.set_rc_config_value( - 'ifconfig_' + device_name, - v.get('address') + ' netmask ' + v.get('netmask')) - else: - self.set_rc_config_value('ifconfig_' + device_name, 'DHCP') + net_config =3D v.get('address') + ' netmask ' + v.get('net= mask') + mtu =3D v.get('mtu') + if mtu: + net_config +=3D (' mtu %d' % mtu) + self.set_rc_config_value('ifconfig_' + device_name, net_config) def start_services(self, run=3DFalse): if not run: ``` DataSourceSmartOS declare only physical section contain mtu https://github.com/canonical/cloud-init/blob/master/cloudinit/sources/DataS= ourceSmartOS.py#L815 --=20 You are receiving this mail because: You are the assignee for the bug.=