예제 #1
0
파일: aarp.c 프로젝트: MarginC/kame
static void
aarptimer(void *ignored)
{
    struct aarptab	*aat;
    int			i, s;

    aarptimer_ch = timeout( aarptimer, (caddr_t)0, AARPT_AGE * hz );
    aat = aarptab;
    for ( i = 0; i < AARPTAB_SIZE; i++, aat++ ) {
	if ( aat->aat_flags == 0 || ( aat->aat_flags & ATF_PERM ))
	    continue;
	if ( ++aat->aat_timer < (( aat->aat_flags & ATF_COM ) ?
		AARPT_KILLC : AARPT_KILLI ))
	    continue;
	s = splimp();
	aarptfree( aat );
	splx( s );
    }
}
예제 #2
0
/*ARGSUSED*/
static void
aarptimer(void *ignored)
{
	struct aarptab *aat;
	int             i, s;

	mutex_enter(softnet_lock);
	callout_reset(&aarptimer_callout, AARPT_AGE * hz, aarptimer, NULL);
	aat = aarptab;
	for (i = 0; i < AARPTAB_SIZE; i++, aat++) {
		int killtime = (aat->aat_flags & ATF_COM) ? AARPT_KILLC :
		    AARPT_KILLI;
		if (aat->aat_flags == 0 || (aat->aat_flags & ATF_PERM))
			continue;
		if (++aat->aat_timer < killtime)
			continue;
		s = splnet();
		aarptfree(aat);
		splx(s);
	}
	mutex_exit(softnet_lock);
}