summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mrouted/inet.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1996-11-11 03:50:15 +0000
committerfenner <fenner@FreeBSD.org>1996-11-11 03:50:15 +0000
commiteb4f38517ab6b3334eae830239bce13bc11365d4 (patch)
tree165f9cfd99d55b06f466b5dad237613485ce8624 /usr.sbin/mrouted/inet.c
parent1a38735f41eb97c0d485559ee3465c527c73c0d4 (diff)
downloadFreeBSD-src-eb4f38517ab6b3334eae830239bce13bc11365d4.zip
FreeBSD-src-eb4f38517ab6b3334eae830239bce13bc11365d4.tar.gz
Update to the unreleased mrouted 3.8a . This includes a minor
endian-ness fix, Router Alert options on IGMP messages, and a new keyword, "advert_metric", for fine-tuning tunnel metrics. This also includes a new mtrace, which is also unreleased but builds significantly on the experiences of users' troubles with using and understanding mtrace in release 3.8 . (unreleased does not, of course, mean untested!) This is a candidate for both 2.2 and 2.1.6 .
Diffstat (limited to 'usr.sbin/mrouted/inet.c')
-rw-r--r--usr.sbin/mrouted/inet.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/usr.sbin/mrouted/inet.c b/usr.sbin/mrouted/inet.c
index b60e385..e0ce09e 100644
--- a/usr.sbin/mrouted/inet.c
+++ b/usr.sbin/mrouted/inet.c
@@ -7,7 +7,7 @@
* Leland Stanford Junior University.
*
*
- * $Id: inet.c,v 3.8 1995/11/29 22:36:57 fenner Rel $
+ * $Id: inet.c,v 3.8.1.1 1995/12/01 22:20:26 fenner Exp $
*/
@@ -155,15 +155,17 @@ inet_fmts(addr, mask, s)
* with "255.255.255.255".)
*/
u_int32
-inet_parse(s)
+inet_parse(s,n)
char *s;
+ int n;
{
u_int32 a = 0;
- u_int a0, a1, a2, a3;
+ u_int a0 = 0, a1 = 0, a2 = 0, a3 = 0;
+ int i;
char c;
- if (sscanf(s, "%u.%u.%u.%u%c", &a0, &a1, &a2, &a3, &c) != 4 ||
- a0 > 255 || a1 > 255 || a2 > 255 || a3 > 255)
+ i = sscanf(s, "%u.%u.%u.%u%c", &a0, &a1, &a2, &a3, &c);
+ if (i < n || i > 4 || a0 > 255 || a1 > 255 || a2 > 255 || a3 > 255)
return (0xffffffff);
((u_char *)&a)[0] = a0;
OpenPOWER on IntegriCloud