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 -.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 +#include #include #include #include @@ -107,11 +108,12 @@ #include #include #include +#include #include #include #include #include -#include "gmt2local.h" +#include #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 #include #include -#include "gmt2local.h" #include