summaryrefslogtreecommitdiffstats
path: root/usr.sbin/IPXrouted/af.c
diff options
context:
space:
mode:
authorjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
committerjhay <jhay@FreeBSD.org>1997-07-06 07:38:36 +0000
commit18fa8ff2b470b736a50fb803e1e891bc2f4d247b (patch)
tree99ed7bad5d7b247fd7423644806e43dc4dc3a8dc /usr.sbin/IPXrouted/af.c
parent60f787e21f64c5425b302b242c9a638f55ebb6ad (diff)
downloadFreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.zip
FreeBSD-src-18fa8ff2b470b736a50fb803e1e891bc2f4d247b.tar.gz
Major IPXrouted rework.
In rt_change() remember to update the interface pointer otherwise we will send the RIP packets to the wrong interface(s) in future. Update the hash generator and increase the size of the hash tables. Only use the network and host parts when comparing IPX interface addresses. Immediately broadscast RIP and SAP changes. Change the alarm code to use the setitimer() call and only set a flag in the alarm signal handler. This gets rid of possible race conditions. Remove the host routing table. IPX RIP cannot do host routes, only net routes. Make the delay between broadcast packets 50ms. It seems that some Netware 4.x servers is very slow and don't have much input buffering. Handle received messages about networks and services that go down, better. Add tracing of RIP and SAP changes. It gets sysloged with a level of LOG_DEBUG.
Diffstat (limited to 'usr.sbin/IPXrouted/af.c')
-rw-r--r--usr.sbin/IPXrouted/af.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/usr.sbin/IPXrouted/af.c b/usr.sbin/IPXrouted/af.c
index 0936b43..05034ab 100644
--- a/usr.sbin/IPXrouted/af.c
+++ b/usr.sbin/IPXrouted/af.c
@@ -35,7 +35,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id$
+ * $Id: af.c,v 1.4 1997/02/22 16:00:54 peter Exp $
*/
#ifndef lint
@@ -93,14 +93,32 @@ ipxnet_hash(sipx, hp)
register struct sockaddr_ipx *sipx;
struct afhash *hp;
{
- register long hash = 0;
- register u_short *s = sipx->sipx_addr.x_host.s_host;
- union ipx_net_u net;
+ long hash;
+#if 0
+ u_short *s = sipx->sipx_addr.x_host.s_host;
+#endif
+ u_char *c;
+
+ c = sipx->sipx_addr.x_net.c_net;
- net.net_e = sipx->sipx_addr.x_net;
- hp->afh_nethash = net.long_e;
+#define IMVAL 33
+ hash = 0;
+ hash = hash * IMVAL + *c++;
+ hash = hash * IMVAL + *c++;
+ hash = hash * IMVAL + *c++;
+ hash = hash * IMVAL + *c++;
+#undef IMVAL
+
+ hp->afh_nethash = hash;
+ hp->afh_nethash ^= (hash >> 8);
+ hp->afh_nethash ^= (hash >> 16);
+ hp->afh_nethash ^= (hash >> 24);
+
+#if 0
+ hash = 0;
hash = *s++; hash <<= 8; hash += *s++; hash <<= 8; hash += *s;
hp->afh_hosthash = hash;
+#endif
}
int
OpenPOWER on IntegriCloud