From eb4f38517ab6b3334eae830239bce13bc11365d4 Mon Sep 17 00:00:00 2001 From: fenner Date: Mon, 11 Nov 1996 03:50:15 +0000 Subject: 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 . --- usr.sbin/mrouted/inet.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'usr.sbin/mrouted/inet.c') 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; -- cgit v1.1