diff options
author | pst <pst@FreeBSD.org> | 1995-09-06 16:33:40 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1995-09-06 16:33:40 +0000 |
commit | 9c89e962d4b2ec7f2039148417fff25258d80888 (patch) | |
tree | 81442c7a0ecb06e93787767b90f226642c9b326e /usr.sbin/pppd | |
parent | faac6bf48ffedcd0880b12c62a8f7ca89392a90e (diff) | |
download | FreeBSD-src-9c89e962d4b2ec7f2039148417fff25258d80888.zip FreeBSD-src-9c89e962d4b2ec7f2039148417fff25258d80888.tar.gz |
Recode mask logic to use inet_ntoa() so host routes are valid.
Diffstat (limited to 'usr.sbin/pppd')
-rw-r--r-- | usr.sbin/pppd/options.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/pppd/options.c b/usr.sbin/pppd/options.c index b0ec67c..ec0b7f5 100644 --- a/usr.sbin/pppd/options.c +++ b/usr.sbin/pppd/options.c @@ -18,7 +18,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: options.c,v 1.3 1995/05/24 01:56:52 davidg Exp $"; +static char rcsid[] = "$Id: options.c,v 1.4 1995/05/30 03:51:14 rgrimes Exp $"; #endif #include <stdio.h> @@ -1216,14 +1216,14 @@ static int setnetmask(argv) char **argv; { - u_long mask; + struct in_addr mask; - if ((mask = inet_addr(*argv)) == -1 || (netmask & ~mask) != 0) { + if ((inet_aton(*argv, &mask) < 0) || (netmask & ~mask.s_addr)) { fprintf(stderr, "Invalid netmask %s\n", *argv); - return 0; + return (0); } - netmask = mask; + netmask = mask.s_addr; return (1); } |