aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/mrouted/inet.c
diff options
context:
space:
mode:
authorBill Fenner <fenner@FreeBSD.org>1996-11-11 03:50:15 +0000
committerBill Fenner <fenner@FreeBSD.org>1996-11-11 03:50:15 +0000
commitf014b7e69bbd6737e73d43099fdb4ba32e99b5ad (patch)
tree165f9cfd99d55b06f466b5dad237613485ce8624 /usr.sbin/mrouted/inet.c
parentf29c770b37549c04aba8981e60954c3878a59bd8 (diff)
downloadsrc-f014b7e69bbd6737e73d43099fdb4ba32e99b5ad.tar.gz
src-f014b7e69bbd6737e73d43099fdb4ba32e99b5ad.zip
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 .
Notes
Notes: svn path=/head/; revision=19620
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 b60e3854da35..e0ce09e15201 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;