From a12a7fac224b3b996235829f3ecc513dfe0fa027 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 3 Sep 2024 14:52:38 -0700 Subject: [PATCH] networks: Add more options for IPv6 configuration method - If an existing network manager connection with the missing values is ever edited, it leads an awkward interface. - So, complete the setting by allowing values supported by Network Manager. Tests: - Create new connections with the new values 'link-local' and 'disabled'. Connection creation succeeds. - Editing connection to these values works too. - When 'link-local' or 'disabled' values are selected, primary and secondary DNS fields are disabled. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/modules/networks/forms.py | 4 ++++ plinth/modules/networks/views.py | 2 ++ 2 files changed, 6 insertions(+) diff --git a/plinth/modules/networks/forms.py b/plinth/modules/networks/forms.py index 32cd089e7..f8a27f0d2 100644 --- a/plinth/modules/networks/forms.py +++ b/plinth/modules/networks/forms.py @@ -107,10 +107,14 @@ class ConnectionForm(forms.Form): ('dhcp', _('Automatic (DHCP only): Configure automatically, use Internet ' 'connection from this network')), + ('link-local', + _('Link-local: Configure automatically to use an address that is ' + 'only relevant to this network.')), ('manual', _('Manual: Use manually specified parameters, use Internet ' 'connection from this network')), ('ignore', _('Ignore: Ignore this addressing method')), + ('disabled', _('Disabled: Disable IPv6 for this connection')), ]) ipv6_address = forms.CharField( label=_('Address'), validators=[validators.validate_ipv6_address], diff --git a/plinth/modules/networks/views.py b/plinth/modules/networks/views.py index 70ad8f0a2..f90c4658d 100644 --- a/plinth/modules/networks/views.py +++ b/plinth/modules/networks/views.py @@ -30,6 +30,8 @@ CONNECTION_METHOD_STRINGS = { 'manual': gettext_lazy('manual'), 'shared': gettext_lazy('shared'), 'link-local': gettext_lazy('link-local'), + 'dhcp': gettext_lazy('dhcp'), + 'ignore': gettext_lazy('ignore'), } # i18n for device.state