| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_arp.c,v 1.285 2019/08/30 18:48:34 roy Exp $ */ | | 1 | /* $NetBSD: if_arp.c,v 1.286 2019/08/30 18:52:00 roy Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 1998, 2000, 2008 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Public Access Networks Corporation ("Panix"). It was developed under | | 8 | * by Public Access Networks Corporation ("Panix"). It was developed under |
9 | * contract to Panix by Eric Haszlakiewicz and Thor Lancelot Simon. | | 9 | * contract to Panix by Eric Haszlakiewicz and Thor Lancelot Simon. |
10 | * | | 10 | * |
11 | * Redistribution and use in source and binary forms, with or without | | 11 | * Redistribution and use in source and binary forms, with or without |
12 | * modification, are permitted provided that the following conditions | | 12 | * modification, are permitted provided that the following conditions |
13 | * are met: | | 13 | * are met: |
14 | * 1. Redistributions of source code must retain the above copyright | | 14 | * 1. Redistributions of source code must retain the above copyright |
| @@ -58,27 +58,27 @@ | | | @@ -58,27 +58,27 @@ |
58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | | 58 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
59 | * SUCH DAMAGE. | | 59 | * SUCH DAMAGE. |
60 | * | | 60 | * |
61 | * @(#)if_ether.c 8.2 (Berkeley) 9/26/94 | | 61 | * @(#)if_ether.c 8.2 (Berkeley) 9/26/94 |
62 | */ | | 62 | */ |
63 | | | 63 | |
64 | /* | | 64 | /* |
65 | * Ethernet address resolution protocol. | | 65 | * Ethernet address resolution protocol. |
66 | * TODO: | | 66 | * TODO: |
67 | * add "inuse/lock" bit (or ref. count) along with valid bit | | 67 | * add "inuse/lock" bit (or ref. count) along with valid bit |
68 | */ | | 68 | */ |
69 | | | 69 | |
70 | #include <sys/cdefs.h> | | 70 | #include <sys/cdefs.h> |
71 | __KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.285 2019/08/30 18:48:34 roy Exp $"); | | 71 | __KERNEL_RCSID(0, "$NetBSD: if_arp.c,v 1.286 2019/08/30 18:52:00 roy Exp $"); |
72 | | | 72 | |
73 | #ifdef _KERNEL_OPT | | 73 | #ifdef _KERNEL_OPT |
74 | #include "opt_ddb.h" | | 74 | #include "opt_ddb.h" |
75 | #include "opt_inet.h" | | 75 | #include "opt_inet.h" |
76 | #include "opt_net_mpsafe.h" | | 76 | #include "opt_net_mpsafe.h" |
77 | #endif | | 77 | #endif |
78 | | | 78 | |
79 | #ifdef INET | | 79 | #ifdef INET |
80 | | | 80 | |
81 | #include "arp.h" | | 81 | #include "arp.h" |
82 | #include "bridge.h" | | 82 | #include "bridge.h" |
83 | | | 83 | |
84 | #include <sys/param.h> | | 84 | #include <sys/param.h> |
| @@ -199,27 +199,27 @@ static percpu_t *arpstat_percpu; | | | @@ -199,27 +199,27 @@ static percpu_t *arpstat_percpu; |
199 | #define ARP_STAT_PUTREF() _NET_STAT_PUTREF(arpstat_percpu) | | 199 | #define ARP_STAT_PUTREF() _NET_STAT_PUTREF(arpstat_percpu) |
200 | | | 200 | |
201 | #define ARP_STATINC(x) _NET_STATINC(arpstat_percpu, x) | | 201 | #define ARP_STATINC(x) _NET_STATINC(arpstat_percpu, x) |
202 | #define ARP_STATADD(x, v) _NET_STATADD(arpstat_percpu, x, v) | | 202 | #define ARP_STATADD(x, v) _NET_STATADD(arpstat_percpu, x, v) |
203 | | | 203 | |
204 | /* revarp state */ | | 204 | /* revarp state */ |
205 | static struct in_addr myip, srv_ip; | | 205 | static struct in_addr myip, srv_ip; |
206 | static int myip_initialized = 0; | | 206 | static int myip_initialized = 0; |
207 | static int revarp_in_progress = 0; | | 207 | static int revarp_in_progress = 0; |
208 | static struct ifnet *myip_ifp = NULL; | | 208 | static struct ifnet *myip_ifp = NULL; |
209 | | | 209 | |
210 | static int arp_drainwanted; | | 210 | static int arp_drainwanted; |
211 | | | 211 | |
212 | static int log_movements = 1; | | 212 | static int log_movements = 0; |
213 | static int log_permanent_modify = 1; | | 213 | static int log_permanent_modify = 1; |
214 | static int log_wrong_iface = 1; | | 214 | static int log_wrong_iface = 1; |
215 | | | 215 | |
216 | DOMAIN_DEFINE(arpdomain); /* forward declare and add to link set */ | | 216 | DOMAIN_DEFINE(arpdomain); /* forward declare and add to link set */ |
217 | | | 217 | |
218 | static void | | 218 | static void |
219 | arp_fasttimo(void) | | 219 | arp_fasttimo(void) |
220 | { | | 220 | { |
221 | if (arp_drainwanted) { | | 221 | if (arp_drainwanted) { |
222 | arp_drain(); | | 222 | arp_drain(); |
223 | arp_drainwanted = 0; | | 223 | arp_drainwanted = 0; |
224 | } | | 224 | } |
225 | } | | 225 | } |