From: Michael Tremer Date: Tue, 28 Mar 2017 16:14:41 +0000 (+0100) Subject: setup: Allow setting netmask to 255.255.255.255 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2170bad5b99a10eff615e7e8c8b289e073985fc9;p=people%2Fms%2Fipfire-2.x.git setup: Allow setting netmask to 255.255.255.255 Some hosters require that the subnet mask of the RED network is set to 255.255.255.255. This was not possible to save before. Signed-off-by: Michael Tremer --- diff --git a/config/rootfiles/core/110/filelists/files b/config/rootfiles/core/110/filelists/files index c6d15d637c..4a7d710d76 100644 --- a/config/rootfiles/core/110/filelists/files +++ b/config/rootfiles/core/110/filelists/files @@ -17,6 +17,7 @@ usr/lib/firewall/ipsec-block usr/lib/libssp.so.0 usr/lib/libssp.so.0.0.0 usr/local/bin/xt_geoip_update +usr/sbin/setup var/ipfire/langs var/ipfire/general-functions.pl var/ipfire/graphs.pl diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index 000411c75c..66592bb94e 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -75,7 +75,8 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag, int startstatictype = 0; int startdhcptype = 0; int startpppoetype = 0; - + unsigned char buffer[sizeof(struct in_addr)]; + /* Build some key strings. */ sprintf(addressfield, "%s_ADDRESS", colour); sprintf(netmaskfield, "%s_NETMASK", colour); @@ -184,7 +185,7 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag, strcat(message, "\n"); error = 1; } - if (inet_addr(netmaskresult) == INADDR_NONE) + if (inet_pton(AF_INET, netmaskresult, &buffer) == 0) { strcat(message, _("Network mask")); strcat(message, "\n");