summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/ip.h
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2021-09-26 18:43:29 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2021-09-26 18:43:29 +0000
commitd43d79bda454212f92fcec1ad4d049ecdc66e043 (patch)
tree983e8499b34d465e1e0ec6b12ce5a5a3d84b39ef /sys/src/9/ip/ip.h
parent1cff923af4dbcaaab515cc04ea40c559eab7830f (diff)
devip: implement ipv4 arp timeout with icmp host unreachable notification
The IPv4 ARP cache used to indefinitely buffer packets in the Arpent hold list. This is bad in case of a router, because it opens a 1 second (retransmit time) window to leak all the to be forwarded packets. This change makes the ipv4 arp code path similar to the IPv6 neighbour solicitation path, using the retransmit process to time out old entries (after 3 arp retransmits => 3 seconds). A new function arpcontinue() has been added that unifies the point when we schedule the (ipv6 sol retransmit) / (ipv4 arp timeout) and reduce the hold queue to the last packet and unlock the cache. As a bonus, we also now send a icmp host unreachable notification for the dropped packets.
Diffstat (limited to 'sys/src/9/ip/ip.h')
-rw-r--r--sys/src/9/ip/ip.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/9/ip/ip.h b/sys/src/9/ip/ip.h
index 01b294d67..c3be02f6b 100644
--- a/sys/src/9/ip/ip.h
+++ b/sys/src/9/ip/ip.h
@@ -613,6 +613,7 @@ extern int arpread(Arp*, char*, ulong, int);
extern int arpwrite(Fs*, char*, int);
extern Arpent* arpget(Arp*, Block *bp, int version, Ipifc *ifc, uchar *ip, uchar *h);
extern void arprelease(Arp*, Arpent *a);
+extern void arpcontinue(Arp*, Arpent *a);
extern Block* arpresolve(Arp*, Arpent *a, Medium *type, uchar *mac);
extern int arpenter(Fs*, int version, uchar *ip, uchar *mac, int n, uchar *ia, Ipifc *ifc, int refresh);
extern void ndpsendsol(Fs*, Ipifc*, Arpent*);
@@ -682,6 +683,7 @@ extern char* ipifcremove6(Ipifc *ifc, char**argv, int argc);
* ip.c
*/
extern void iprouting(Fs*, int);
+extern void icmpnohost(Fs*, Ipifc*, Block*);
extern void icmpnoconv(Fs*, Block*);
extern void icmpcantfrag(Fs*, Block*, int);
extern void icmpttlexceeded(Fs*, Ipifc*, Block*);