mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-14 10:09:48 +00:00
Recover lost support for netmask 255.255.255.255 that was lost in the merge.
Submitted by: Michael Butler <imb@scgt.oz.au>
This commit is contained in:
parent
046bc05396
commit
0e515b2999
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12062
@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char rcsid[] = "$Id: options.c,v 1.6 1995/10/31 21:21:31 peter Exp $";
|
||||
static char rcsid[] = "$Id: options.c,v 1.7 1995/10/31 21:29:25 peter Exp $";
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
@ -1391,14 +1391,14 @@ static int
|
||||
setnetmask(argv)
|
||||
char **argv;
|
||||
{
|
||||
u_int32_t mask;
|
||||
struct in_addr mask;
|
||||
|
||||
if ((mask = inet_addr(*argv)) == -1 || (netmask & ~mask) != 0) {
|
||||
if ((inet_aton(*argv, &mask)) == -1 || (netmask & ~mask.s_addr)) {
|
||||
fprintf(stderr, "Invalid netmask %s\n", *argv);
|
||||
return 0;
|
||||
return (0);
|
||||
}
|
||||
|
||||
netmask = mask;
|
||||
netmask = mask.s_addr;
|
||||
return (1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user