Patch #: 72 Type: bug fix Priority: medium Affects: sites using Native EtherTalk Reported: Mats Olsson Reported: David Hornsby Archived: munnari.OZ.AU mac/cap.patches/cap60.patch072 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch072' Summary: aarp table and timer scan duplicated unnecessarily in aarpd Summary: replace bcmp with memcmp in compare, fix missing bcmp argument File: cap60/support/uab/aarp.c File: cap60/support/ethertalk/abelap.c *** support/uab/aarp.c.orig Sun Sep 1 15:38:52 1991 --- support/uab/aarp.c Mon Nov 18 02:31:31 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/09/01 05:38:41 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/aarp.c,v 2.4 1991/09/01 05:38:41 djh Rel djh $"; ! static char revision[] = "$Revision: 2.4 $"; /* * aarp.c - AppleTalk Address Resolution Protocol handler --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/11/17 15:31:12 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/support/uab/RCS/aarp.c,v 2.5 1991/11/17 15:31:12 djh Rel djh $"; ! static char revision[] = "$Revision: 2.5 $"; /* * aarp.c - AppleTalk Address Resolution Protocol handler *************** *** 76,81 **** --- 76,83 ---- #else sony_news private aarp_listener(); #endif sony_news + export int aarp_inited = 0; + private AARP_ENTRY *aarp_find_free_etalk_node(); private probe_and_request_driver(); private void aarp_probed(); *************** *** 108,114 **** AARP_ENTRY *node; { #ifdef PHASE2 ! return(bcmp(k, &node->aae_pa, ETPL)); #else PHASE2 return(k->node - node->aae_pa.node); #endif PHASE2 --- 110,116 ---- AARP_ENTRY *node; { #ifdef PHASE2 ! return(memcmp(k, &node->aae_pa, ETPL)); #else PHASE2 return(k->node - node->aae_pa.node); #endif PHASE2 *************** *** 154,163 **** export caddr_t aarptab_init() { ! return(h_new(HASH_POLICY_CHAIN, HASH_TYPE_MULTIPLICATIVE, AARP_TAB_SIZE, aarptab_compare, aarptab_new, aarptab_compress, ! NULL, NULL, NULL)); } /* see if we need to try to speed up hash lookups */ --- 156,171 ---- export caddr_t aarptab_init() { ! static caddr_t hashtab = NULL; ! ! if (aarp_inited) ! return(hashtab); ! ! hashtab = h_new(HASH_POLICY_CHAIN, HASH_TYPE_MULTIPLICATIVE, AARP_TAB_SIZE, aarptab_compare, aarptab_new, aarptab_compress, ! NULL, NULL, NULL); ! return(hashtab); } /* see if we need to try to speed up hash lookups */ *************** *** 380,385 **** --- 388,395 ---- pi_listener(aih->ai_ph, aarp_listener, (caddr_t)aih); #endif sony_news + aarp_inited = 1; + return((caddr_t)aih); giveup: if (ph >= 0) *************** *** 515,521 **** struct timeval *tv; /* check to make sure ha isn't broadcast (or multicast)! */ ! if (bcmp(ha, b_eaddr) == 0) return(FALSE); #ifdef PHASE2 if (ha[0] == 0x09 && ha[1] == 0x00 && ha[2] == 0x07 && ha[3] == 0x00) --- 525,531 ---- struct timeval *tv; /* check to make sure ha isn't broadcast (or multicast)! */ ! if (bcmp(ha, b_eaddr, EHRD) == 0) return(FALSE); #ifdef PHASE2 if (ha[0] == 0x09 && ha[1] == 0x00 && ha[2] == 0x07 && ha[3] == 0x00) *** support/ethertalk/abelap.c.orig Thu Sep 19 13:41:34 1991 --- support/ethertalk/abelap.c Mon Nov 18 02:32:55 1991 *************** *** 1,7 **** /* ! * $Author: djh $ $Date: 1991/09/19 03:41:13 $ ! * $Header: /mac/src/cap60/support/ethertalk/RCS/abelap.c,v 2.6 1991/09/19 03:41:13 djh Rel djh $ ! * $Revision: 2.6 $ */ /* --- 1,7 ---- /* ! * $Author: djh $ $Date: 1991/11/17 15:32:44 $ ! * $Header: /mac/src/cap60/support/ethertalk/RCS/abelap.c,v 2.7 1991/11/17 15:32:44 djh Rel djh $ ! * $Revision: 2.7 $ */ /* *************** *** 249,254 **** --- 249,255 ---- int disp; { int i; + extern int aarp_inited; static int here_before = 0; #ifdef ALT_RPC struct sockaddr_in sin; *************** *** 271,279 **** lap_proto = LAP_KIP; else { here_before = 1; ! tv.tv_sec = AARP_SCAN_TIME; ! tv.tv_usec = 0; ! relTimeout(aarptab_scan, 0, &tv, TRUE); } } --- 272,282 ---- lap_proto = LAP_KIP; else { here_before = 1; ! if (!aarp_inited) { ! tv.tv_sec = AARP_SCAN_TIME; ! tv.tv_usec = 0; ! relTimeout(aarptab_scan, 0, &tv, TRUE); ! } } } *** README.orig Mon Nov 18 02:33:45 1991 --- README Mon Nov 18 02:34:19 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 71, November 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 72, November 1991 Introduction ------------