Page MenuHomeFreeBSD

D40445.diff
No OneTemporary

D40445.diff

diff --git a/usr.sbin/ndp/Makefile b/usr.sbin/ndp/Makefile
--- a/usr.sbin/ndp/Makefile
+++ b/usr.sbin/ndp/Makefile
@@ -15,15 +15,13 @@
.include <src.opts.mk>
-.PATH: ${SRCTOP}/contrib/tcpdump
-
PROG= ndp
MAN= ndp.8
-SRCS= ndp.c gmt2local.c
+SRCS= ndp.c
LIBADD= xo
-CFLAGS+= -I. -I${.CURDIR} -I${SRCTOP}/contrib/tcpdump
+CFLAGS+= -I. -I${.CURDIR}
CFLAGS+= -D_U_=""
.if ${MK_EXPERIMENTAL} != "no"
diff --git a/usr.sbin/ndp/ndp.c b/usr.sbin/ndp/ndp.c
--- a/usr.sbin/ndp/ndp.c
+++ b/usr.sbin/ndp/ndp.c
@@ -98,6 +98,7 @@
#include <arpa/inet.h>
+#include <assert.h>
#include <ctype.h>
#include <netdb.h>
#include <errno.h>
@@ -107,11 +108,12 @@
#include <string.h>
#include <paths.h>
#include <err.h>
+#include <stdint.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <libxo/xo.h>
-#include "gmt2local.h"
+#include <time.h>
#include "ndp.h"
@@ -181,6 +183,20 @@
return (false);
}
+static int32_t
+utc_offset(void)
+{
+ time_t t;
+ struct tm *tm;
+
+ t = time(NULL);
+ tm = localtime(&t);
+
+ assert(tm->tm_gmtoff > INT32_MIN && tm->tm_gmtoff < INT32_MAX);
+
+ return (tm->tm_gmtoff);
+}
+
int
main(int argc, char **argv)
{
@@ -188,7 +204,7 @@
char *arg = NULL;
pid = getpid();
- thiszone = gmt2local(0);
+ thiszone = utc_offset();
argc = xo_parse_args(argc, argv);
if (argc < 0)
diff --git a/usr.sbin/ndp/ndp_netlink.c b/usr.sbin/ndp/ndp_netlink.c
--- a/usr.sbin/ndp/ndp_netlink.c
+++ b/usr.sbin/ndp/ndp_netlink.c
@@ -33,7 +33,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <libxo/xo.h>
-#include "gmt2local.h"
#include <netlink/netlink.h>

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 17, 6:46 AM (22 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14672007
Default Alt Text
D40445.diff (1 KB)

Event Timeline