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.h b/usr.sbin/ndp/ndp.h --- a/usr.sbin/ndp/ndp.h +++ b/usr.sbin/ndp/ndp.h @@ -15,6 +15,7 @@ extern struct ndp_opts opts; bool valid_type(int if_type); +int32_t utc_offset(void); void ts_print(const struct timeval *tvp); char *ether_str(struct sockaddr_dl *sdl); char *sec2str(time_t total); 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 @@ -111,7 +111,7 @@ #include #include #include -#include "gmt2local.h" +#include #include "ndp.h" @@ -181,6 +181,18 @@ return (false); } +int32_t +utc_offset(void) +{ + time_t now = 0; + struct tm *tm; + + now = time(NULL); + tm = localtime(&now); + + return(tm->tm_gmtoff); +} + int main(int argc, char **argv) { @@ -188,7 +200,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