]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
setup: Allow setting netmask to 255.255.255.255
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Mar 2017 16:14:41 +0000 (17:14 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 28 Mar 2017 16:17:03 +0000 (17:17 +0100)
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>
config/rootfiles/core/110/filelists/files
src/setup/netstuff.c

index c6d15d637c2cb8d2a0a8b2fd1606ae50afb54b7f..4a7d710d76f0e4bd68ffd487262c55fd10f896e9 100644 (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
index 000411c75c1ce98033ad761c0910f0359c76ad10..66592bb94efb5bef84ee9e3cff7ed93d7554b570 100644 (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");