Import routed-2.21.
This commit is contained in:
parent
2c7a97817b
commit
f7434bbd42
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/vendor/SGI/dist_v_2_21/; revision=64127 svn path=/vendor/SGI/vjs_20000721/; revision=64128; tag=vendor/SGI/vjs_20000721
@ -50,7 +50,7 @@ __RCSID("$NetBSD$");
|
|||||||
__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n\
|
__COPYRIGHT("@(#) Copyright (c) 1983, 1988, 1993\n\
|
||||||
The Regents of the University of California. All rights reserved.\n");
|
The Regents of the University of California. All rights reserved.\n");
|
||||||
#endif
|
#endif
|
||||||
#ident "$Revision: 2.17 $"
|
#ident "$Revision: 2.21 $"
|
||||||
|
|
||||||
|
|
||||||
pid_t mypid;
|
pid_t mypid;
|
||||||
@ -80,7 +80,9 @@ time_t now_expire;
|
|||||||
time_t now_garbage;
|
time_t now_garbage;
|
||||||
|
|
||||||
struct timeval next_bcast; /* next general broadcast */
|
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;
|
struct timeval flush_kern_timer;
|
||||||
|
|
||||||
@ -219,7 +221,7 @@ main(int argc,
|
|||||||
case 'v':
|
case 'v':
|
||||||
/* display version */
|
/* display version */
|
||||||
verbose++;
|
verbose++;
|
||||||
msglog("version 2.17");
|
msglog("version 2.21");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -38,7 +38,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)output.c 8.1 (Berkeley) 6/5/
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
__RCSID("$NetBSD$");
|
__RCSID("$NetBSD$");
|
||||||
#endif
|
#endif
|
||||||
#ident "$Revision: 2.17 $"
|
#ident "$Revision: 2.21 $"
|
||||||
|
|
||||||
|
|
||||||
u_int update_seqno;
|
u_int update_seqno;
|
||||||
@ -461,7 +461,7 @@ walk_supply(struct radix_node *rn,
|
|||||||
*/
|
*/
|
||||||
if ((RT->rt_state & RS_IF)
|
if ((RT->rt_state & RS_IF)
|
||||||
&& RT->rt_ifp != 0
|
&& RT->rt_ifp != 0
|
||||||
&& (RT->rt_ifp->int_if_flags & IS_PASSIVE)
|
&& (RT->rt_ifp->int_state & IS_PASSIVE)
|
||||||
&& !(RT->rt_state & RS_MHOME))
|
&& !(RT->rt_state & RS_MHOME))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
@ -816,7 +816,7 @@ void
|
|||||||
rip_bcast(int flash)
|
rip_bcast(int flash)
|
||||||
{
|
{
|
||||||
#ifdef _HAVE_SIN_LEN
|
#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
|
#else
|
||||||
static struct sockaddr_in dst = {AF_INET};
|
static struct sockaddr_in dst = {AF_INET};
|
||||||
#endif
|
#endif
|
||||||
@ -892,7 +892,7 @@ void
|
|||||||
rip_query(void)
|
rip_query(void)
|
||||||
{
|
{
|
||||||
#ifdef _HAVE_SIN_LEN
|
#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
|
#else
|
||||||
static struct sockaddr_in dst = {AF_INET};
|
static struct sockaddr_in dst = {AF_INET};
|
||||||
#endif
|
#endif
|
||||||
|
@ -40,7 +40,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)if.c 8.1 (Berkeley) 6/5/93";
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
__RCSID("$NetBSD$");
|
__RCSID("$NetBSD$");
|
||||||
#endif
|
#endif
|
||||||
#ident "$Revision: 2.17 $"
|
#ident "$Revision: 2.21 $"
|
||||||
|
|
||||||
|
|
||||||
struct parm *parms;
|
struct parm *parms;
|
||||||
@ -755,7 +755,7 @@ parse_parms(char *line,
|
|||||||
|
|
||||||
} else if (PARS("passive")) {
|
} else if (PARS("passive")) {
|
||||||
CKF((GROUP_IS_SOL_OUT|GROUP_IS_ADV_OUT), IS_NO_RDISC);
|
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")) {
|
} else if (PARSEQ("rdisc_pref")) {
|
||||||
if (parm.parm_rdisc_pref != 0
|
if (parm.parm_rdisc_pref != 0
|
||||||
|
@ -41,7 +41,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)rdisc.c 8.1 (Berkeley) x/y/9
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
__RCSID"$NetBSD$");
|
__RCSID"$NetBSD$");
|
||||||
#endif
|
#endif
|
||||||
#ident "$Revision: 2.17 $"
|
#ident "$Revision: 2.20 $"
|
||||||
|
|
||||||
/* router advertisement ICMP packet */
|
/* router advertisement ICMP packet */
|
||||||
struct icmp_ad {
|
struct icmp_ad {
|
||||||
@ -84,7 +84,7 @@ struct dr { /* accumulated advertisements */
|
|||||||
struct interface *dr_ifp;
|
struct interface *dr_ifp;
|
||||||
naddr dr_gate; /* gateway */
|
naddr dr_gate; /* gateway */
|
||||||
time_t dr_ts; /* when received */
|
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_recv_pref; /* received but biased preference */
|
||||||
n_long dr_pref; /* preference adjusted by metric */
|
n_long dr_pref; /* preference adjusted by metric */
|
||||||
} *cur_drp, drs[MAX_ADS];
|
} *cur_drp, drs[MAX_ADS];
|
||||||
@ -565,7 +565,7 @@ static void
|
|||||||
parse_ad(naddr from,
|
parse_ad(naddr from,
|
||||||
naddr gate,
|
naddr gate,
|
||||||
n_long pref, /* signed and in network order */
|
n_long pref, /* signed and in network order */
|
||||||
u_short life,
|
u_short life, /* in host byte order */
|
||||||
struct interface *ifp)
|
struct interface *ifp)
|
||||||
{
|
{
|
||||||
static struct msg_limit bad_gate;
|
static struct msg_limit bad_gate;
|
||||||
@ -647,7 +647,7 @@ parse_ad(naddr from,
|
|||||||
new_drp->dr_ifp = ifp;
|
new_drp->dr_ifp = ifp;
|
||||||
new_drp->dr_gate = gate;
|
new_drp->dr_gate = gate;
|
||||||
new_drp->dr_ts = now.tv_sec;
|
new_drp->dr_ts = now.tv_sec;
|
||||||
new_drp->dr_life = ntohs(life);
|
new_drp->dr_life = life;
|
||||||
new_drp->dr_recv_pref = pref;
|
new_drp->dr_recv_pref = pref;
|
||||||
/* bias functional preference by metric of the interface */
|
/* bias functional preference by metric of the interface */
|
||||||
new_drp->dr_pref = PREF(pref,ifp);
|
new_drp->dr_pref = PREF(pref,ifp);
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
.\" $Revision: 2.17 $
|
.\" $Revision: 2.19 $
|
||||||
.\"
|
.\"
|
||||||
.\" Copyright (c) 1983, 1991, 1993
|
.\" Copyright (c) 1983, 1991, 1993
|
||||||
.\" The Regents of the University of California. All rights reserved.
|
.\" The Regents of the University of California. All rights reserved.
|
||||||
@ -253,7 +253,7 @@ is the opposite of the
|
|||||||
.Fl s
|
.Fl s
|
||||||
option.
|
option.
|
||||||
This is the default when only one interface is present.
|
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.
|
and does not supply routing information to other computers.
|
||||||
.It Fl d
|
.It Fl d
|
||||||
do not run in the background.
|
do not run in the background.
|
||||||
|
@ -38,7 +38,7 @@ static char sccsid[] __attribute__((unused)) = "@(#)tables.c 8.1 (Berkeley) 6/5/
|
|||||||
#elif defined(__NetBSD__)
|
#elif defined(__NetBSD__)
|
||||||
__RCSID("$NetBSD$");
|
__RCSID("$NetBSD$");
|
||||||
#endif
|
#endif
|
||||||
#ident "$Revision: 2.17 $"
|
#ident "$Revision: 2.20 $"
|
||||||
|
|
||||||
static struct rt_spare *rts_better(struct rt_entry *);
|
static struct rt_spare *rts_better(struct rt_entry *);
|
||||||
static struct rt_spare rts_empty = {0,0,0,HOPCNT_INFINITY,0,0,0};
|
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 age_timer; /* next check of old routes */
|
||||||
struct timeval need_kern = { /* need to update kernel table */
|
struct timeval need_kern = { /* need to update kernel table */
|
||||||
EPOCH+MIN_WAITTIME-1
|
EPOCH+MIN_WAITTIME-1, 0
|
||||||
};
|
};
|
||||||
|
|
||||||
int stopint;
|
int stopint;
|
||||||
@ -350,7 +350,7 @@ ag_check(naddr dst,
|
|||||||
* then mark the suppressor redundant.
|
* then mark the suppressor redundant.
|
||||||
*/
|
*/
|
||||||
if (AG_IS_REDUN(ag->ag_state)
|
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)
|
if (ag_cors->ag_dst_h == dst)
|
||||||
ag_cors->ag_state |= AGS_REDUN0;
|
ag_cors->ag_state |= AGS_REDUN0;
|
||||||
else
|
else
|
||||||
@ -1622,8 +1622,8 @@ rtinit(void)
|
|||||||
|
|
||||||
|
|
||||||
#ifdef _HAVE_SIN_LEN
|
#ifdef _HAVE_SIN_LEN
|
||||||
static struct sockaddr_in dst_sock = {sizeof(dst_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};
|
static struct sockaddr_in mask_sock = {sizeof(mask_sock), AF_INET, 0, {0}, {0}};
|
||||||
#else
|
#else
|
||||||
static struct sockaddr_in_new dst_sock = {_SIN_ADDR_SIZE, AF_INET};
|
static struct sockaddr_in_new dst_sock = {_SIN_ADDR_SIZE, AF_INET};
|
||||||
static struct sockaddr_in_new mask_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;
|
struct rt_entry *rt;
|
||||||
|
|
||||||
dst_sock.sin_addr.s_addr = dst;
|
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);
|
masktrim(&mask_sock);
|
||||||
rt = (struct rt_entry *)rhead->rnh_lookup(&dst_sock,&mask_sock,rhead);
|
rt = (struct rt_entry *)rhead->rnh_lookup(&dst_sock,&mask_sock,rhead);
|
||||||
if (!rt
|
if (!rt
|
||||||
@ -1702,7 +1702,7 @@ rtadd(naddr dst,
|
|||||||
if ((smask & ~mask) == 0 && mask > smask)
|
if ((smask & ~mask) == 0 && mask > smask)
|
||||||
state |= RS_SUBNET;
|
state |= RS_SUBNET;
|
||||||
}
|
}
|
||||||
mask_sock.sin_addr.s_addr = mask;
|
mask_sock.sin_addr.s_addr = htonl(mask);
|
||||||
masktrim(&mask_sock);
|
masktrim(&mask_sock);
|
||||||
rt->rt_mask = mask;
|
rt->rt_mask = mask;
|
||||||
rt->rt_state = state;
|
rt->rt_state = state;
|
||||||
@ -1723,6 +1723,7 @@ rtadd(naddr dst,
|
|||||||
rhead, rt->rt_nodes)) {
|
rhead, rt->rt_nodes)) {
|
||||||
msglog("rnh_addaddr() failed for %s mask=%#lx",
|
msglog("rnh_addaddr() failed for %s mask=%#lx",
|
||||||
naddr_ntoa(dst), (u_long)mask);
|
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;
|
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);
|
masktrim(&mask_sock);
|
||||||
if (rt != (struct rt_entry *)rhead->rnh_deladdr(&dst_sock, &mask_sock,
|
if (rt != (struct rt_entry *)rhead->rnh_deladdr(&dst_sock, &mask_sock,
|
||||||
rhead)) {
|
rhead)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user