diff --git a/sbin/routed/main.c b/sbin/routed/main.c index cf4edba8338e..5c524550e42a 100644 --- a/sbin/routed/main.c +++ b/sbin/routed/main.c @@ -82,7 +82,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; @@ -221,7 +223,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 0545c342b76e..013edd2ab70b 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -463,7 +463,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; @@ -818,7 +818,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 @@ -894,7 +894,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 abea5f6e4ceb..057dae969ef6 100644 --- a/sbin/routed/parms.c +++ b/sbin/routed/parms.c @@ -757,7 +757,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 dd99b8df212f..764463abf3ab 100644 --- a/sbin/routed/rdisc.c +++ b/sbin/routed/rdisc.c @@ -86,7 +86,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]; @@ -567,7 +567,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; @@ -649,7 +649,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 1bf9646d7173..e00a9cad6ca3 100644 --- a/sbin/routed/routed.8 +++ b/sbin/routed/routed.8 @@ -255,7 +255,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 2258e1bb0e12..650d01fb573f 100644 --- a/sbin/routed/table.c +++ b/sbin/routed/table.c @@ -60,7 +60,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; @@ -352,7 +352,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 @@ -1627,8 +1627,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}; @@ -1656,7 +1656,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 @@ -1707,7 +1707,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; @@ -1847,7 +1847,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)) {