diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-03-19 01:11:08 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-03-19 01:11:08 +0100 |
commit | 547f60b4c507778099635f5d2ec4919e1beb6a57 (patch) | |
tree | 054f072e361b27b433515e4688eb33555bfc340f /sys/src/9/ip/ethermedium.c | |
parent | 20cbb88e32ece30dd984ab658c365f574790d6ba (diff) |
devip: pick source address for neighbor solicitations as of rfc4861 7.2.2, cleanup
rfc4861 7.2.2:
If the source address of the packet prompting the solicitation is the
same as one of the addresses assigned to the outgoing interface, that
address SHOULD be placed in the IP Source Address of the outgoing
solicitation.
this change adds ndbsendsol() which handles the source address selection
and also handles the arp table locking; avoiding access to the arp entry
after the arp table is unlocked.
cleanups:
- use ipmove() instead of memmove().
- useless extern qualifiers
Diffstat (limited to 'sys/src/9/ip/ethermedium.c')
-rw-r--r-- | sys/src/9/ip/ethermedium.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sys/src/9/ip/ethermedium.c b/sys/src/9/ip/ethermedium.c index d8691b0e7..9b1962450 100644 --- a/sys/src/9/ip/ethermedium.c +++ b/sys/src/9/ip/ethermedium.c @@ -498,7 +498,6 @@ resolveaddr6(Ipifc *ifc, Arpent *a) { Block *bp; Etherrock *er = ifc->arg; - uchar ipsrc[IPaddrlen]; /* don't do anything if it's been less than a second since the last */ if(NOW - a->ctime < ReTransTimer){ @@ -523,10 +522,7 @@ resolveaddr6(Ipifc *ifc, Arpent *a) } a->rxtsrem--; - arprelease(er->f->arp, a); - - if(ipv6local(ifc, ipsrc, a->ip)) - icmpns(er->f, ipsrc, SRC_UNI, a->ip, TARG_MULTI, ifc->mac); + ndpsendsol(er->f, ifc, a); /* unlocks arp */ } /* @@ -610,7 +606,7 @@ recvarp(Ipifc *ifc) case ARPREQUEST: /* don't answer arps till we know who we are */ - if(ifc->lifc == 0) + if(ifc->lifc == nil) break; /* check for machine using my ip or ether address */ |