Slight cleanup of aarp code

Submitted by: Ian Dowse <iedowse@maths.tcd.ie>
PR: kern/17583

This PR is still open as Ther is still ongoing investigation.
This commit is contained in:
Julian Elischer 2000-03-29 17:12:09 +00:00
parent 7e9e421193
commit bf7c9470c1

View File

@ -1,6 +1,8 @@
/*
* Copyright (c) 1990,1991 Regents of The University of Michigan.
* All Rights Reserved.
*
* $FreeBSD$
*/
#include "opt_atalk.h"
@ -393,22 +395,21 @@ at_aarpinput( struct arpcom *ac, struct mbuf *m)
sizeof( ea->aarp_sha ));
aat->aat_flags |= ATF_COM;
if ( aat->aat_hold ) {
struct mbuf *mhold = aat->aat_hold;
aat->aat_hold = NULL;
sat.sat_len = sizeof(struct sockaddr_at);
sat.sat_family = AF_APPLETALK;
sat.sat_addr = spa;
(*ac->ac_if.if_output)( &ac->ac_if, aat->aat_hold,
(*ac->ac_if.if_output)( &ac->ac_if, mhold,
(struct sockaddr *)&sat, NULL); /* XXX */
aat->aat_hold = 0;
}
}
if ( aat == 0 && tpa.s_net == ma.s_net && tpa.s_node == ma.s_node
&& op != AARPOP_PROBE ) {
if ((aat = aarptnew( &spa )) != NULL) {
bcopy(( caddr_t )ea->aarp_sha, ( caddr_t )aat->aat_enaddr,
} else if ((tpa.s_net == ma.s_net)
&& (tpa.s_node == ma.s_node)
&& (op != AARPOP_PROBE)
&& ((aat = aarptnew( &spa )) != NULL)) {
bcopy(( caddr_t )ea->aarp_sha, ( caddr_t )aat->aat_enaddr,
sizeof( ea->aarp_sha ));
aat->aat_flags |= ATF_COM;
}
aat->aat_flags |= ATF_COM;
}
/*
@ -466,7 +467,7 @@ aarptfree( struct aarptab *aat)
if ( aat->aat_hold )
m_freem( aat->aat_hold );
aat->aat_hold = 0;
aat->aat_hold = NULL;
aat->aat_timer = aat->aat_flags = 0;
aat->aat_ataddr.s_net = 0;
aat->aat_ataddr.s_node = 0;
@ -611,6 +612,7 @@ aarp_clean(void)
for ( i = 0, aat = aarptab; i < AARPTAB_SIZE; i++, aat++ ) {
if ( aat->aat_hold ) {
m_freem( aat->aat_hold );
aat->aat_hold = NULL;
}
}
}