From 8e84282c05a4104b93dfe1b5c72a8e04ce788770 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 19 Aug 2014 08:37:14 -0600 Subject: [PATCH] ARP: Fix bid conversion from msec to nsec --- net/arp/arp_notify.c | 4 ++++ net/arp/arp_send.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/net/arp/arp_notify.c b/net/arp/arp_notify.c index 97eb9e8047..cc3dc6fd20 100644 --- a/net/arp/arp_notify.c +++ b/net/arp/arp_notify.c @@ -196,6 +196,10 @@ int arp_wait(FAR struct arp_notify_s *notify, FAR struct timespec *timeout) abstime.tv_nsec -= 1000000000; } + /* REVISIT: If sem_timedwait() is awakened with signal, we will return + * the wrong error code. + */ + (void)sem_timedwait(¬ify->nt_sem, &abstime); ret = notify->nt_result; diff --git a/net/arp/arp_send.c b/net/arp/arp_send.c index a94415c07d..b0feb45e90 100644 --- a/net/arp/arp_send.c +++ b/net/arp/arp_send.c @@ -65,7 +65,7 @@ #define CONFIG_ARP_SEND_DELAYSEC \ (CONFIG_ARP_SEND_DELAYMSEC / 1000) #define CONFIG_ARP_SEND_DELAYNSEC \ - ((CONFIG_ARP_SEND_DELAYMSEC - 1000*CONFIG_ARP_SEND_DELAYSEC) / 1000000) + ((CONFIG_ARP_SEND_DELAYMSEC - 1000*CONFIG_ARP_SEND_DELAYSEC) * 1000000) /**************************************************************************** * Private Types