Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/if_ether.c
Show First 20 Lines • Show All 155 Lines • ▼ Show 20 Lines | |||||
static int garp_rexmit_count = 0; /* GARP retransmission setting. */ | static int garp_rexmit_count = 0; /* GARP retransmission setting. */ | ||||
SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, | SYSCTL_PROC(_net_link_ether_inet, OID_AUTO, garp_rexmit_count, | ||||
CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, | CTLTYPE_INT|CTLFLAG_RW|CTLFLAG_MPSAFE, | ||||
&garp_rexmit_count, 0, sysctl_garp_rexmit, "I", | &garp_rexmit_count, 0, sysctl_garp_rexmit, "I", | ||||
"Number of times to retransmit GARP packets;" | "Number of times to retransmit GARP packets;" | ||||
" 0 to disable, maximum of 16"); | " 0 to disable, maximum of 16"); | ||||
VNET_DEFINE_STATIC(int, arp_log_level) = LOG_INFO; /* Min. log(9) level. */ | |||||
#define V_arp_log_level VNET(arp_log_level) | |||||
SYSCTL_INT(_net_link_ether_arp, OID_AUTO, log_level, CTLFLAG_VNET | CTLFLAG_RW, | |||||
&VNET_NAME(arp_log_level), 0, | |||||
"Minimum log(9) level for recording rate limited arp log messages. " | |||||
"The higher will be log more (emerg=0, info=6 (default), debug=7)."); | |||||
#define ARP_LOG(pri, ...) do { \ | #define ARP_LOG(pri, ...) do { \ | ||||
if (ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ | if ((pri) <= V_arp_log_level && \ | ||||
ppsratecheck(&arp_lastlog, &arp_curpps, arp_maxpps)) \ | |||||
log((pri), "arp: " __VA_ARGS__); \ | log((pri), "arp: " __VA_ARGS__); \ | ||||
} while (0) | } while (0) | ||||
static void arpintr(struct mbuf *); | static void arpintr(struct mbuf *); | ||||
static void arptimer(void *); | static void arptimer(void *); | ||||
#ifdef INET | #ifdef INET | ||||
static void in_arpinput(struct mbuf *); | static void in_arpinput(struct mbuf *); | ||||
▲ Show 20 Lines • Show All 249 Lines • ▼ Show 20 Lines | #endif | ||||
ro.ro_prepend = linkhdr; | ro.ro_prepend = linkhdr; | ||||
ro.ro_plen = linkhdrsize; | ro.ro_plen = linkhdrsize; | ||||
ro.ro_flags = 0; | ro.ro_flags = 0; | ||||
m->m_flags |= M_BCAST; | m->m_flags |= M_BCAST; | ||||
m_clrprotoflags(m); /* Avoid confusing lower layers. */ | m_clrprotoflags(m); /* Avoid confusing lower layers. */ | ||||
error = (*ifp->if_output)(ifp, m, &sa, &ro); | error = (*ifp->if_output)(ifp, m, &sa, &ro); | ||||
ARPSTAT_INC(txrequests); | ARPSTAT_INC(txrequests); | ||||
if (error) | if (error) { | ||||
ARPSTAT_INC(txerrors); | |||||
ARP_LOG(LOG_DEBUG, "Failed to send ARP packet on %s: %d\n", | ARP_LOG(LOG_DEBUG, "Failed to send ARP packet on %s: %d\n", | ||||
if_name(ifp), error); | if_name(ifp), error); | ||||
} | |||||
return (error); | return (error); | ||||
} | } | ||||
void | void | ||||
arprequest(struct ifnet *ifp, const struct in_addr *sip, | arprequest(struct ifnet *ifp, const struct in_addr *sip, | ||||
const struct in_addr *tip, u_char *enaddr) | const struct in_addr *tip, u_char *enaddr) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 1,067 Lines • Show Last 20 Lines |