1
0
mirror of https://github.com/gryf/wicd.git synced 2025-12-21 13:28:08 +01:00

Autofill common subnet masks for private networks

This commit is contained in:
David Paleino
2012-11-28 16:54:31 +01:00
parent 14fe8bba90
commit e0505c0df6

View File

@@ -184,6 +184,12 @@ class AdvancedSettingsDialog(gtk.Dialog):
# Make sure the netmask is blank # Make sure the netmask is blank
if stringToNone(netmask.get_text()) is None: if stringToNone(netmask.get_text()) is None:
# Fill in the most common one # Fill in the most common one
if ip.startswith('172'):
netmask.set_text('255.240.0.0')
elif ip.startswith('10'):
netmask.set_text('255.0.0.0')
else:
# 192.168 and all other cases
netmask.set_text('255.255.255.0') netmask.set_text('255.255.255.0')
elif ip != '': elif ip != '':
error(None, _('Invalid IP address entered.')) error(None, _('Invalid IP address entered.'))