aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSheldon Hearn <sheldonh@FreeBSD.org>2000-08-02 11:12:54 +0000
committerSheldon Hearn <sheldonh@FreeBSD.org>2000-08-02 11:12:54 +0000
commitf7434bbd426c21f1c43d81bdb6323110b29955b9 (patch)
tree339d22d2815e63e8ed019f66fc4bf4818b06e907
parent2c7a97817b8e83a80ed67bbeb294334140b7d26d (diff)
downloadsrc-f7434bbd426c21f1c43d81bdb6323110b29955b9.tar.gz
src-f7434bbd426c21f1c43d81bdb6323110b29955b9.zip
Import routed-2.21.vendor/SGI/vjs_20000721
Notes
Notes: svn path=/vendor/SGI/dist_v_2_21/; revision=64127 svn path=/vendor/SGI/vjs_20000721/; revision=64128; tag=vendor/SGI/vjs_20000721
-rw-r--r--sbin/routed/main.c8
-rw-r--r--sbin/routed/output.c8
-rw-r--r--sbin/routed/parms.c4
-rw-r--r--sbin/routed/rdisc.c8
-rw-r--r--sbin/routed/routed.84
-rw-r--r--sbin/routed/table.c17
6 files changed, 26 insertions, 23 deletions
diff --git a/sbin/routed/main.c b/sbin/routed/main.c
index 3d88c83f7c39..ae4aaeeb09c5 100644
--- a/sbin/routed/main.c
+++ b/sbin/routed/main.c
@@ -50,7 +50,7 @@ __RCSID("$NetBSD$");
__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n\
The Regents of the University of California. All rights reserved.\n");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 2.21 $"
pid_t mypid;
@@ -80,7 +80,9 @@ time_t now_expire;
time_t now_garbage;
struct timeval next_bcast; /* next general broadcast */
-struct timeval no_flash = {EPOCH+SUPPLY_INTERVAL}; /* inhibit flash update */
+struct timeval no_flash = { /* inhibit flash update */
+ EPOCH+SUPPLY_INTERVAL, 0
+};
struct timeval flush_kern_timer;
@@ -219,7 +221,7 @@ main(int argc,
case 'v':
/* display version */
verbose++;
- msglog("version 2.17");
+ msglog("version 2.21");
break;
default:
diff --git a/sbin/routed/output.c b/sbin/routed/output.c
index fc832bf0f031..5b601fba01e8 100644
--- a/sbin/routed/output.c
+++ b/sbin/routed/output.c
@@ -38,7 +38,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)output.c 8.1 (Berkeley) 6/5/
#elif defined(__NetBSD__)
__RCSID("$NetBSD$");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 2.21 $"
u_int update_seqno;
@@ -461,7 +461,7 @@ walk_supply(struct radix_node *rn,
*/
if ((RT->rt_state & RS_IF)
&& RT->rt_ifp != 0
- && (RT->rt_ifp->int_if_flags & IS_PASSIVE)
+ && (RT->rt_ifp->int_state & IS_PASSIVE)
&& !(RT->rt_state & RS_MHOME))
return 0;
@@ -816,7 +816,7 @@ void
rip_bcast(int flash)
{
#ifdef _HAVE_SIN_LEN
- static struct sockaddr_in dst = {sizeof(dst), AF_INET};
+ static struct sockaddr_in dst = {sizeof(dst), AF_INET, 0, {0}, {0}};
#else
static struct sockaddr_in dst = {AF_INET};
#endif
@@ -892,7 +892,7 @@ void
rip_query(void)
{
#ifdef _HAVE_SIN_LEN
- static struct sockaddr_in dst = {sizeof(dst), AF_INET};
+ static struct sockaddr_in dst = {sizeof(dst), AF_INET, 0, {0}, {0}};
#else
static struct sockaddr_in dst = {AF_INET};
#endif
diff --git a/sbin/routed/parms.c b/sbin/routed/parms.c
index da301fa3dc10..b4a362837750 100644
--- a/sbin/routed/parms.c
+++ b/sbin/routed/parms.c
@@ -40,7 +40,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)if.c 8.1 (Berkeley) 6/5/93";
#elif defined(__NetBSD__)
__RCSID("$NetBSD$");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 2.21 $"
struct parm *parms;
@@ -755,7 +755,7 @@ parse_parms(char *line,
} else if (PARS("passive")) {
CKF((GROUP_IS_SOL_OUT|GROUP_IS_ADV_OUT), IS_NO_RDISC);
- parm.parm_int_state |= IS_NO_RIP;
+ parm.parm_int_state |= IS_NO_RIP| IS_PASSIVE;
} else if (PARSEQ("rdisc_pref")) {
if (parm.parm_rdisc_pref != 0
diff --git a/sbin/routed/rdisc.c b/sbin/routed/rdisc.c
index 5123442be844..7d992227130b 100644
--- a/sbin/routed/rdisc.c
+++ b/sbin/routed/rdisc.c
@@ -41,7 +41,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)rdisc.c 8.1 (Berkeley) x/y/9
#elif defined(__NetBSD__)
__RCSID"$NetBSD$");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 2.20 $"
/* router advertisement ICMP packet */
struct icmp_ad {
@@ -84,7 +84,7 @@ struct dr { /* accumulated advertisements */
struct interface *dr_ifp;
naddr dr_gate; /* gateway */
time_t dr_ts; /* when received */
- time_t dr_life; /* lifetime */
+ time_t dr_life; /* lifetime in host byte order */
n_long dr_recv_pref; /* received but biased preference */
n_long dr_pref; /* preference adjusted by metric */
} *cur_drp, drs[MAX_ADS];
@@ -565,7 +565,7 @@ static void
parse_ad(naddr from,
naddr gate,
n_long pref, /* signed and in network order */
- u_short life,
+ u_short life, /* in host byte order */
struct interface *ifp)
{
static struct msg_limit bad_gate;
@@ -647,7 +647,7 @@ parse_ad(naddr from,
new_drp->dr_ifp = ifp;
new_drp->dr_gate = gate;
new_drp->dr_ts = now.tv_sec;
- new_drp->dr_life = ntohs(life);
+ new_drp->dr_life = life;
new_drp->dr_recv_pref = pref;
/* bias functional preference by metric of the interface */
new_drp->dr_pref = PREF(pref,ifp);
diff --git a/sbin/routed/routed.8 b/sbin/routed/routed.8
index d521e4519bd0..6f591420f06c 100644
--- a/sbin/routed/routed.8
+++ b/sbin/routed/routed.8
@@ -1,4 +1,4 @@
-.\" $Revision: 2.17 $
+.\" $Revision: 2.19 $
.\"
.\" Copyright (c) 1983, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -253,7 +253,7 @@ is the opposite of the
.Fl s
option.
This is the default when only one interface is present.
-With this explicit option, the daemon is always in "quite-mode" for RIP
+With this explicit option, the daemon is always in "quiet-mode" for RIP
and does not supply routing information to other computers.
.It Fl d
do not run in the background.
diff --git a/sbin/routed/table.c b/sbin/routed/table.c
index 0c41248adbb1..1ec0153c4b75 100644
--- a/sbin/routed/table.c
+++ b/sbin/routed/table.c
@@ -38,7 +38,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)tables.c 8.1 (Berkeley) 6/5/
#elif defined(__NetBSD__)
__RCSID("$NetBSD$");
#endif
-#ident "$Revision: 2.17 $"
+#ident "$Revision: 2.20 $"
static struct rt_spare *rts_better(struct rt_entry *);
static struct rt_spare rts_empty = {0,0,0,HOPCNT_INFINITY,0,0,0};
@@ -58,7 +58,7 @@ int need_flash = 1; /* flash update needed
struct timeval age_timer; /* next check of old routes */
struct timeval need_kern = { /* need to update kernel table */
- EPOCH+MIN_WAITTIME-1
+ EPOCH+MIN_WAITTIME-1, 0
};
int stopint;
@@ -350,7 +350,7 @@ ag_check(naddr dst,
* then mark the suppressor redundant.
*/
if (AG_IS_REDUN(ag->ag_state)
- && ag_cors->ag_mask==ag->ag_mask<<1) {
+ && ag_cors->ag_mask == ag->ag_mask<<1) {
if (ag_cors->ag_dst_h == dst)
ag_cors->ag_state |= AGS_REDUN0;
else
@@ -1622,8 +1622,8 @@ rtinit(void)
#ifdef _HAVE_SIN_LEN
-static struct sockaddr_in dst_sock = {sizeof(dst_sock), AF_INET};
-static struct sockaddr_in mask_sock = {sizeof(mask_sock), AF_INET};
+static struct sockaddr_in dst_sock = {sizeof(dst_sock), AF_INET, 0, {0}, {0}};
+static struct sockaddr_in mask_sock = {sizeof(mask_sock), AF_INET, 0, {0}, {0}};
#else
static struct sockaddr_in_new dst_sock = {_SIN_ADDR_SIZE, AF_INET};
static struct sockaddr_in_new mask_sock = {_SIN_ADDR_SIZE, AF_INET};
@@ -1651,7 +1651,7 @@ rtget(naddr dst, naddr mask)
struct rt_entry *rt;
dst_sock.sin_addr.s_addr = dst;
- mask_sock.sin_addr.s_addr = mask;
+ mask_sock.sin_addr.s_addr = htonl(mask);
masktrim(&mask_sock);
rt = (struct rt_entry *)rhead->rnh_lookup(&dst_sock,&mask_sock,rhead);
if (!rt
@@ -1702,7 +1702,7 @@ rtadd(naddr dst,
if ((smask & ~mask) == 0 && mask > smask)
state |= RS_SUBNET;
}
- mask_sock.sin_addr.s_addr = mask;
+ mask_sock.sin_addr.s_addr = htonl(mask);
masktrim(&mask_sock);
rt->rt_mask = mask;
rt->rt_state = state;
@@ -1723,6 +1723,7 @@ rtadd(naddr dst,
rhead, rt->rt_nodes)) {
msglog("rnh_addaddr() failed for %s mask=%#lx",
naddr_ntoa(dst), (u_long)mask);
+ free(rt);
}
}
@@ -1841,7 +1842,7 @@ rtdelete(struct rt_entry *rt)
}
dst_sock.sin_addr.s_addr = rt->rt_dst;
- mask_sock.sin_addr.s_addr = rt->rt_mask;
+ mask_sock.sin_addr.s_addr = htonl(rt->rt_mask);
masktrim(&mask_sock);
if (rt != (struct rt_entry *)rhead->rnh_deladdr(&dst_sock, &mask_sock,
rhead)) {