diff options
author | julian <julian@FreeBSD.org> | 2000-03-29 17:12:09 +0000 |
---|---|---|
committer | julian <julian@FreeBSD.org> | 2000-03-29 17:12:09 +0000 |
commit | 5f599b5670452586443602616c34d91d90198c73 (patch) | |
tree | 474e61d0aa2c6cbed9489e133ca25e014cd5a309 /sys/netatalk | |
parent | 54a7094e5d5167a75913c05a4f511539b4708145 (diff) | |
download | FreeBSD-src-5f599b5670452586443602616c34d91d90198c73.zip FreeBSD-src-5f599b5670452586443602616c34d91d90198c73.tar.gz |
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.
Diffstat (limited to 'sys/netatalk')
-rw-r--r-- | sys/netatalk/aarp.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/sys/netatalk/aarp.c b/sys/netatalk/aarp.c index e6023d6..e5aa7c6 100644 --- a/sys/netatalk/aarp.c +++ b/sys/netatalk/aarp.c @@ -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; } } } |