From 1944cfb469b444fc4885353100da54ebd9bcccf2 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Mon, 28 Oct 1991 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1991-10-28 --- port/devarp.c | 2 ++ port/ipdat.h | 24 ------------------------ port/stil.c | 2 ++ 3 files changed, 4 insertions(+), 24 deletions(-) diff --git a/port/devarp.c b/port/devarp.c index aaa024d757b4f7c863a5cc573570c54fdc2377f8..a893dd736fb6fa52dc7d625d47600a8841c3955f 100644 --- a/port/devarp.c +++ b/port/devarp.c @@ -310,9 +310,11 @@ arpsendpkt(uchar *unroutedip, uchar *ether, Queue *put, Block *bp) iproute(unroutedip, ip); if(arplookup(ip, ether)) { +print("hit %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]); PUTNEXT(put, bp); return; } +print("miss %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]); /* Send the request out to the user level arp daemon */ nbp = allocb(sizeof(ip)); diff --git a/port/ipdat.h b/port/ipdat.h index c04137025b1dea0b6a5e447870b658f4c9b180d2..85bd7fde380cebdd468cbc44455e5e686c67b91b 100644 --- a/port/ipdat.h +++ b/port/ipdat.h @@ -3,7 +3,6 @@ typedef struct Ipifc Ipifc; typedef struct Fragq Fragq; typedef struct Ipfrag Ipfrag; typedef ulong Ipaddr; -typedef struct Arpcache Arpcache; typedef ushort Port; typedef struct Udphdr Udphdr; typedef struct Etherhdr Etherhdr; @@ -380,29 +379,6 @@ struct Ipfrag ushort flen; }; -struct Arpcache -{ - uchar status; /* Entry status */ - uchar type; /* Entry type */ - Ipaddr ip; /* Host byte order */ - uchar eip[4]; /* Network byte order */ - uchar et[6]; /* Ethernet address for this ip */ - int age; /* Entry timeout */ - Arpcache *hash; - Arpcache **hashhd; - Arpcache *frwd; - Arpcache *prev; -}; - -#define ARP_FREE 0 -#define ARP_OK 1 -#define ARP_ASKED 2 -#define ARP_TEMP 0 -#define ARP_PERM 1 -#define Arphashsize 32 -#define ARPHASH(p) arphash[((p[2]^p[3])%Arphashsize)] -#define ARP_WAITMS 2500 /* Wait for arp replys */ - #define IP_VER 0x40 /* Using IP version 4 */ #define IP_HLEN 0x05 /* Header length in characters */ #define IP_DF 0x4000 /* Don't fragment */ diff --git a/port/stil.c b/port/stil.c index ebc5f71b47f709d0cc10fd0375d9e2603956b95e..5f47e933ab86ef86f5437138dc2020c8188d7ef4 100644 --- a/port/stil.c +++ b/port/stil.c @@ -325,6 +325,8 @@ ilprocess(Ipconv *s, Ilhdr *h, Block *bp) oh = (Ilhdr*)bp->rptr; oid = nhgetl(oh->ilid); print("recvd = %d outoforder = %d\n", ic->recvd, oid); + if(oid > ic->recvd) + break; if(oid < ic->recvd) { ic->outoforder = bp->next; freeb(bp);