diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-10-03 15:58:58 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2021-10-03 15:58:58 +0000 |
commit | 6ebb8b9e357944cc29ae3fafc0900ee3e325ed39 (patch) | |
tree | c8443a3bff1300d618cba2a8ee3015a1b4e5a20b /sys/src/9/ip/ethermedium.c | |
parent | 55c3138c640967ae82b21feb4c33acb9edcbc75b (diff) |
devip: use better hashipa() macro, use RWlock for arp cache
Diffstat (limited to 'sys/src/9/ip/ethermedium.c')
-rw-r--r-- | sys/src/9/ip/ethermedium.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/9/ip/ethermedium.c b/sys/src/9/ip/ethermedium.c index 0bcd0c165..964b71a72 100644 --- a/sys/src/9/ip/ethermedium.c +++ b/sys/src/9/ip/ethermedium.c @@ -267,7 +267,7 @@ etherbwrite(Ipifc *ifc, Block *bp, int version, uchar *ip) bp = multicastarp(er->f, a, ifc->m, mac); if(bp == nil){ /* don't do anything if it's been less than a second since the last */ - if(NOW - a->ctime < RETRANS_TIMER){ + if(a->utime - a->ctime < RETRANS_TIMER){ arprelease(er->f->arp, a); return; } @@ -285,6 +285,9 @@ etherbwrite(Ipifc *ifc, Block *bp, int version, uchar *ip) } } + /* need to have single block */ + assert(bp->list == nil); + /* make it a single block with space for the ether header */ bp = padblock(bp, ifc->m->hsize); if(BLEN(bp) < ifc->mintu) |