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 <michael.tremer@ipfire.org>
This commit is contained in:
Michael Tremer
2017-03-28 17:14:41 +01:00
parent 4a0d69ca46
commit 2170bad5b9
2 changed files with 4 additions and 2 deletions

View File

@@ -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

View File

@@ -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");