summaryrefslogtreecommitdiffstats
path: root/arp.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2008-09-05 13:12:35 +0000
committerRoy Marples <roy@marples.name>2008-09-05 13:12:35 +0000
commitf6de5860b6c6a47c21d09ee4203895f182c01eaa (patch)
tree92744ef6e22857713422dcf2ae731911a5e451f0 /arp.c
parent99d755f98fbd68ea54a199f5ce27516e37108cd1 (diff)
downloaddhcpcd-f6de5860b6c6a47c21d09ee4203895f182c01eaa.tar.xz
As our logger calls emulate syslog, we can use %m. However, this means we have to convert it for printf as POSIX does not require that printf supports it. This also means we drop -pedantic from our GCC flags.
Diffstat (limited to 'arp.c')
-rw-r--r--arp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arp.c b/arp.c
index 9cf6b899..849131e5 100644
--- a/arp.c
+++ b/arp.c
@@ -43,11 +43,10 @@
#define ARP_LEN \
(sizeof(struct arphdr) + (2 * sizeof(uint32_t)) + (2 * HWADDR_LEN))
-static uint8_t arp_buffer[ARP_LEN];
-
static int
send_arp(const struct interface *iface, int op, in_addr_t sip, in_addr_t tip)
{
+ uint8_t arp_buffer[ARP_LEN];
struct arphdr ar;
size_t len;
uint8_t *p;
@@ -91,6 +90,7 @@ static void
handle_arp_packet(void *arg)
{
struct interface *iface = arg;
+ uint8_t arp_buffer[ARP_LEN];
struct arphdr ar;
uint32_t reply_s;
uint32_t reply_t;
@@ -179,7 +179,7 @@ send_arp_announce(void *arg)
iface->name, state->claims, ANNOUNCE_NUM);
if (send_arp(iface, ARPOP_REQUEST,
state->new->yiaddr, state->new->yiaddr) == -1)
- logger(LOG_ERR, "send_arp: %s", strerror(errno));
+ logger(LOG_ERR, "send_arp: %m");
if (state->claims < ANNOUNCE_NUM) {
add_timeout_sec(ANNOUNCE_WAIT, send_arp_announce, iface);
return;
@@ -237,6 +237,6 @@ send_arp_probe(void *arg)
"%s: sending ARP probe (%d of %d), next in %0.2f seconds",
iface->name, state->probes, PROBE_NUM, timeval_to_double(&tv));
if (send_arp(iface, ARPOP_REQUEST, 0, state->offer->yiaddr) == -1)
- logger(LOG_ERR, "send_arp: %s", strerror(errno));
+ logger(LOG_ERR, "send_arp: %m");
}