networks: Ability to configure generic interfaces

After batman-adv kernel driver takes over the Wi-Fi network interface
and provides a bat0 interface, this interface shows up as device type
'batadv'.  This type is not recognized by network manager is dealt with
as a generic device.  Configuring this device for IPv4/IPv6 in
auto/shared mode etc. works fine.  So, add the ability to configure
generic interfaces.
This commit is contained in:
Sunil Mohan Adapa authored and James Valleroy committed 2016-07-21 19:23:20 -04:00
1 parent 561c7c1e6b
commit 04babacafa
4 files changed
+47 -6

No files matched your search

+15
View File
@@ -124,6 +124,21 @@ available over this interfaces. Select Internal only for trusted networks.'),
return ipv4
class GenericForm(ConnectionForm):
"""Form to create/edit a generic connection."""
def __init__(self, *args, **kwargs):
"""Initialize the form, populate interface choices."""
super(GenericForm, self).__init__(*args, **kwargs)
choices = self._get_interface_choices(nm.DeviceType.GENERIC)
self.fields['interface'].choices = choices
def get_settings(self):
"""Return settings dict from cleaned data."""
settings = super().get_settings()
settings['common']['type'] = 'generic'
return settings
class EthernetForm(ConnectionForm):
"""Form to create/edit a ethernet connection."""
def __init__(self, *args, **kwargs):