summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/finger/util.c3
-rw-r--r--usr.bin/gencat/gencat.c5
-rw-r--r--usr.bin/openssl/s_client.c3
-rw-r--r--usr.bin/rpcgen/rpc_main.c3
-rw-r--r--usr.bin/ssh/ssh-agent.c3
-rw-r--r--usr.bin/ssh/ssh.c3
-rw-r--r--usr.bin/ul/ul.c3
-rw-r--r--usr.sbin/dvmrpd/dvmrpe.c3
-rw-r--r--usr.sbin/dvmrpd/group.c3
-rw-r--r--usr.sbin/dvmrpd/igmp.c3
-rw-r--r--usr.sbin/dvmrpd/probe.c3
-rw-r--r--usr.sbin/eeprom/eehandlers.c3
-rw-r--r--usr.sbin/eeprom/ophandlers.c3
-rw-r--r--usr.sbin/ldpd/ldpe.c3
-rw-r--r--usr.sbin/lpr/pac/pac.c3
-rw-r--r--usr.sbin/npppd/common/ipsec_util.c3
-rw-r--r--usr.sbin/npppd/npppd/fsm.c3
-rw-r--r--usr.sbin/npppd/pppoe/pppoe_session.c5
-rw-r--r--usr.sbin/nsd/remote.c74
-rw-r--r--usr.sbin/nsd/server.c1
-rw-r--r--usr.sbin/ospf6d/hello.c3
-rw-r--r--usr.sbin/ospf6d/ospfe.c3
-rw-r--r--usr.sbin/ospfd/hello.c3
-rw-r--r--usr.sbin/ospfd/ospfe.c3
-rw-r--r--usr.sbin/ripd/ripe.c3
-rw-r--r--usr.sbin/rtadvd/rtadvd.c3
-rw-r--r--usr.sbin/rtsold/if.c3
-rw-r--r--usr.sbin/snmpctl/snmpclient.c3
-rw-r--r--usr.sbin/snmpd/mib.c3
-rw-r--r--usr.sbin/ypserv/common/yplib_host.c3
30 files changed, 89 insertions, 74 deletions
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index d4cccd64049..e8b858730d2 100644
--- a/usr.bin/finger/util.c
+++ b/usr.bin/finger/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.27 2014/10/17 20:19:15 millert Exp $ */
+/* $OpenBSD: util.c,v 1.28 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -47,7 +47,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <vis.h>
-#include <err.h>
#include "finger.h"
#include "extern.h"
diff --git a/usr.bin/gencat/gencat.c b/usr.bin/gencat/gencat.c
index 9cb08fc6262..0a0dfd6a93a 100644
--- a/usr.bin/gencat/gencat.c
+++ b/usr.bin/gencat/gencat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gencat.c,v 1.16 2012/12/05 23:20:25 deraadt Exp $ */
+/* $OpenBSD: gencat.c,v 1.17 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: gencat.c,v 1.9 1998/10/09 17:00:56 itohy Exp $ */
/*-
@@ -78,9 +78,6 @@ up-to-date. Many thanks.
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <nl_types.h>
-#include <err.h>
struct _msgT {
long msgId;
diff --git a/usr.bin/openssl/s_client.c b/usr.bin/openssl/s_client.c
index 37a8280d15c..988d799b97c 100644
--- a/usr.bin/openssl/s_client.c
+++ b/usr.bin/openssl/s_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: s_client.c,v 1.7 2014/11/07 14:16:48 jsing Exp $ */
+/* $OpenBSD: s_client.c,v 1.8 2014/11/18 20:54:28 krw Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -148,7 +148,6 @@
#include <netdb.h>
#include <stdio.h>
#include <stdlib.h>
-#include <limits.h>
#include <string.h>
#include <unistd.h>
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
index ac76a8fab6e..92c9e5f938a 100644
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rpc_main.c,v 1.27 2013/11/28 18:24:54 deraadt Exp $ */
+/* $OpenBSD: rpc_main.c,v 1.28 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: rpc_main.c,v 1.9 1996/02/19 11:12:43 pk Exp $ */
/*
@@ -45,7 +45,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
#include "rpc_parse.h"
diff --git a/usr.bin/ssh/ssh-agent.c b/usr.bin/ssh/ssh-agent.c
index 37841752bc0..0fb6ba6ce07 100644
--- a/usr.bin/ssh/ssh-agent.c
+++ b/usr.bin/ssh/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.190 2014/07/25 21:22:03 dtucker Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.191 2014/11/18 20:54:28 krw Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -38,7 +38,6 @@
#include <sys/time.h>
#include <sys/queue.h>
#include <sys/resource.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/un.h>
diff --git a/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c
index 5d8ca91e298..346b94a2e36 100644
--- a/usr.bin/ssh/ssh.c
+++ b/usr.bin/ssh/ssh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh.c,v 1.409 2014/10/09 06:21:31 jmc Exp $ */
+/* $OpenBSD: ssh.c,v 1.410 2014/11/18 20:54:28 krw Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -47,7 +47,6 @@
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
diff --git a/usr.bin/ul/ul.c b/usr.bin/ul/ul.c
index a03ca2f60fc..f91ec80b883 100644
--- a/usr.bin/ul/ul.c
+++ b/usr.bin/ul/ul.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ul.c,v 1.15 2009/10/27 23:59:46 deraadt Exp $ */
+/* $OpenBSD: ul.c,v 1.16 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: ul.c,v 1.3 1994/12/07 00:28:24 jtc Exp $ */
/*
@@ -34,7 +34,6 @@
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdlib.h>
#include <string.h>
#include <term.h>
#include <unistd.h>
diff --git a/usr.sbin/dvmrpd/dvmrpe.c b/usr.sbin/dvmrpd/dvmrpe.c
index 79c656cc593..d391396ca1e 100644
--- a/usr.sbin/dvmrpd/dvmrpe.c
+++ b/usr.sbin/dvmrpd/dvmrpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dvmrpe.c,v 1.12 2014/07/12 19:22:32 krw Exp $ */
+/* $OpenBSD: dvmrpe.c,v 1.13 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -34,7 +34,6 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include "igmp.h"
#include "dvmrp.h"
diff --git a/usr.sbin/dvmrpd/group.c b/usr.sbin/dvmrpd/group.c
index c8c51fd0e79..4ed92abc877 100644
--- a/usr.sbin/dvmrpd/group.c
+++ b/usr.sbin/dvmrpd/group.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: group.c,v 1.3 2009/06/06 07:52:04 pyr Exp $ */
+/* $OpenBSD: group.c,v 1.4 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2006 Esben Norby <norby@openbsd.org>
@@ -21,7 +21,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <event.h>
diff --git a/usr.sbin/dvmrpd/igmp.c b/usr.sbin/dvmrpd/igmp.c
index b9594ee8400..8b0a4d8fbda 100644
--- a/usr.sbin/dvmrpd/igmp.c
+++ b/usr.sbin/dvmrpd/igmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: igmp.c,v 1.2 2010/05/26 13:56:07 nicm Exp $ */
+/* $OpenBSD: igmp.c,v 1.3 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -21,7 +21,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <event.h>
diff --git a/usr.sbin/dvmrpd/probe.c b/usr.sbin/dvmrpd/probe.c
index 17347df9532..2f0d07417ad 100644
--- a/usr.sbin/dvmrpd/probe.c
+++ b/usr.sbin/dvmrpd/probe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: probe.c,v 1.2 2010/05/26 13:56:07 nicm Exp $ */
+/* $OpenBSD: probe.c,v 1.3 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -21,7 +21,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <event.h>
diff --git a/usr.sbin/eeprom/eehandlers.c b/usr.sbin/eeprom/eehandlers.c
index 1257027ee51..1ebb8d1ca5b 100644
--- a/usr.sbin/eeprom/eehandlers.c
+++ b/usr.sbin/eeprom/eehandlers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eehandlers.c,v 1.18 2014/07/24 19:19:26 miod Exp $ */
+/* $OpenBSD: eehandlers.c,v 1.19 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: eehandlers.c,v 1.2 1996/02/28 01:13:22 thorpej Exp $ */
/*-
@@ -38,7 +38,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <time.h>
#include <unistd.h>
diff --git a/usr.sbin/eeprom/ophandlers.c b/usr.sbin/eeprom/ophandlers.c
index b44a052b972..b66c5138b3e 100644
--- a/usr.sbin/eeprom/ophandlers.c
+++ b/usr.sbin/eeprom/ophandlers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ophandlers.c,v 1.12 2008/06/26 05:42:21 ray Exp $ */
+/* $OpenBSD: ophandlers.c,v 1.13 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: ophandlers.c,v 1.2 1996/02/28 01:13:30 thorpej Exp $ */
/*-
@@ -38,7 +38,6 @@
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <vis.h>
diff --git a/usr.sbin/ldpd/ldpe.c b/usr.sbin/ldpd/ldpe.c
index 565da95d759..e3323d9d4d9 100644
--- a/usr.sbin/ldpd/ldpe.c
+++ b/usr.sbin/ldpd/ldpe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ldpe.c,v 1.24 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ldpe.c,v 1.25 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -34,7 +34,6 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include "ldp.h"
#include "ldpd.h"
diff --git a/usr.sbin/lpr/pac/pac.c b/usr.sbin/lpr/pac/pac.c
index 08b1f36a146..27b6aa40cc4 100644
--- a/usr.sbin/lpr/pac/pac.c
+++ b/usr.sbin/lpr/pac/pac.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pac.c,v 1.21 2014/01/22 09:50:51 jsg Exp $ */
+/* $OpenBSD: pac.c,v 1.22 2014/11/18 20:54:28 krw Exp $ */
/* $NetBSD: pac.c,v 1.14 2000/04/27 13:40:18 msaitoh Exp $ */
/*
@@ -47,7 +47,6 @@
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "lp.h"
diff --git a/usr.sbin/npppd/common/ipsec_util.c b/usr.sbin/npppd/common/ipsec_util.c
index 943201dda56..23e43420e01 100644
--- a/usr.sbin/npppd/common/ipsec_util.c
+++ b/usr.sbin/npppd/common/ipsec_util.c
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $Id: ipsec_util.c,v 1.5 2012/05/08 13:18:37 yasuoka Exp $ */
+/* $Id: ipsec_util.c,v 1.6 2014/11/18 20:54:28 krw Exp $ */
/*@file IPsec related utility functions */
/*
* RFC 2367 PF_KEY Key Management API, Version 2
@@ -31,7 +31,6 @@
#include <sys/param.h>
#include <sys/socket.h>
-#include <sys/socket.h>
#include <sys/errno.h>
#include <net/pfkeyv2.h>
#include <netinet/in.h>
diff --git a/usr.sbin/npppd/npppd/fsm.c b/usr.sbin/npppd/npppd/fsm.c
index d555213c70d..1a26be4ec3d 100644
--- a/usr.sbin/npppd/npppd/fsm.c
+++ b/usr.sbin/npppd/npppd/fsm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsm.c,v 1.5 2012/12/05 23:20:26 deraadt Exp $ */
+/* $OpenBSD: fsm.c,v 1.6 2014/11/18 20:54:28 krw Exp $ */
/**@file
* This file was adapted from NetBSD:/usr/src/usr.sbin/pppd/pppd/fsm.c
@@ -50,7 +50,6 @@
#include <netinet/in.h>
#include <net/if_dl.h>
#include <time.h>
-#include <sys/time.h>
#include <event.h>
#include "debugutil.h"
#include "slist.h"
diff --git a/usr.sbin/npppd/pppoe/pppoe_session.c b/usr.sbin/npppd/pppoe/pppoe_session.c
index 982bcf7d556..e81348878a3 100644
--- a/usr.sbin/npppd/pppoe/pppoe_session.c
+++ b/usr.sbin/npppd/pppoe/pppoe_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pppoe_session.c,v 1.7 2012/09/18 13:14:08 yasuoka Exp $ */
+/* $OpenBSD: pppoe_session.c,v 1.8 2014/11/18 20:54:28 krw Exp $ */
/*-
* Copyright (c) 2009 Internet Initiative Japan Inc.
@@ -28,7 +28,7 @@
/**@file
* Session management of PPPoE protocol
- * $Id: pppoe_session.c,v 1.7 2012/09/18 13:14:08 yasuoka Exp $
+ * $Id: pppoe_session.c,v 1.8 2014/11/18 20:54:28 krw Exp $
*/
#include <sys/types.h>
@@ -49,7 +49,6 @@
#include <stdio.h>
#include <event.h>
#include <syslog.h>
-#include <stdlib.h>
#include <stdarg.h>
#include "hash.h"
diff --git a/usr.sbin/nsd/remote.c b/usr.sbin/nsd/remote.c
index d4858d2202a..759136c9645 100644
--- a/usr.sbin/nsd/remote.c
+++ b/usr.sbin/nsd/remote.c
@@ -21,16 +21,16 @@
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
- * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/**
@@ -51,14 +51,23 @@
#ifdef HAVE_OPENSSL_ERR_H
#include <openssl/err.h>
#endif
+#ifdef HAVE_OPENSSL_RAND_H
+#include <openssl/rand.h>
+#endif
#include <ctype.h>
#include <unistd.h>
#include <assert.h>
#include <fcntl.h>
#ifndef USE_MINI_EVENT
-#include <event.h>
+# ifdef HAVE_EVENT_H
+# include <event.h>
+# else
+# include <event2/event.h>
+# include "event2/event_struct.h"
+# include "event2/event_compat.h"
+# endif
#else
-#include "mini_event.h"
+# include "mini_event.h"
#endif
#include "remote.h"
#include "util.h"
@@ -68,7 +77,6 @@
#include "nsd.h"
#include "options.h"
#include "difffile.h"
-#include "xfrd.h"
#include "ipc.h"
#ifdef HAVE_SYS_TYPES_H
@@ -234,6 +242,20 @@ daemon_remote_create(nsd_options_t* cfg)
OpenSSL_add_all_algorithms();
(void)SSL_library_init();
+ if(!RAND_status()) {
+ /* try to seed it */
+ unsigned char buf[256];
+ unsigned int v, seed=(unsigned)time(NULL) ^ (unsigned)getpid();
+ size_t i;
+ v = seed;
+ for(i=0; i<256/sizeof(v); i++) {
+ memmove(buf+i*sizeof(v), &v, sizeof(v));
+ v = v*seed + (unsigned int)i;
+ }
+ RAND_seed(buf, 256);
+ log_msg(LOG_WARNING, "warning: no entropy, seeding openssl PRNG with time");
+ }
+
rc->ctx = SSL_CTX_new(SSLv23_server_method());
if(!rc->ctx) {
log_crypto_err("could not SSL_CTX_new");
@@ -489,7 +511,11 @@ static void
remote_accept_callback(int fd, short event, void* arg)
{
struct daemon_remote *rc = (struct daemon_remote*)arg;
+#ifdef INET6
struct sockaddr_storage addr;
+#else
+ struct sockaddr_in addr;
+#endif
socklen_t addrlen;
int newfd;
struct rc_state* n;
@@ -846,6 +872,7 @@ force_transfer_zone(xfrd_zone_t* zone)
/* pretend we not longer have it and force any
* zone to be downloaded (even same serial, w AXFR) */
zone->soa_disk_acquired = 0;
+ zone->soa_nsd_acquired = 0;
xfrd_handle_notify_and_start_xfr(zone, NULL);
}
@@ -1057,6 +1084,7 @@ do_stats(struct daemon_remote* rc, int peek, struct rc_state* rs)
static void
do_addzone(SSL* ssl, xfrd_state_t* xfrd, char* arg)
{
+ const dname_type* dname;
zone_options_t* zopt;
char* arg2 = NULL;
if(!find_arg2(ssl, arg, &arg2))
@@ -1072,9 +1100,27 @@ do_addzone(SSL* ssl, xfrd_state_t* xfrd, char* arg)
/* check that the pattern exists */
if(!rbtree_search(xfrd->nsd->options->patterns, arg2)) {
- (void)ssl_printf(ssl, "error pattern does not exist\n");
+ (void)ssl_printf(ssl, "error pattern %s does not exist\n",
+ arg2);
+ return;
+ }
+
+ dname = dname_parse(xfrd->region, arg);
+ if(!dname) {
+ (void)ssl_printf(ssl, "error cannot parse zone name\n");
+ return;
+ }
+
+ /* see if zone is a duplicate */
+ if( (zopt=zone_options_find(xfrd->nsd->options, dname)) ) {
+ region_recycle(xfrd->region, (void*)dname,
+ dname_total_size(dname));
+ (void)ssl_printf(ssl, "zone %s already exists\n", arg);
+ send_ok(ssl); /* a nop operation */
return;
}
+ region_recycle(xfrd->region, (void*)dname, dname_total_size(dname));
+ dname = NULL;
/* add to zonelist and adds to config in memory */
zopt = zone_list_add(xfrd->nsd->options, arg, arg2);
diff --git a/usr.sbin/nsd/server.c b/usr.sbin/nsd/server.c
index 4fda07ada92..22cfff7897c 100644
--- a/usr.sbin/nsd/server.c
+++ b/usr.sbin/nsd/server.c
@@ -29,7 +29,6 @@
#include <time.h>
#include <unistd.h>
#include <signal.h>
-#include <fcntl.h>
#include <netdb.h>
#ifndef SHUT_WR
#define SHUT_WR 1
diff --git a/usr.sbin/ospf6d/hello.c b/usr.sbin/ospf6d/hello.c
index 0b961719125..fc31d96f0e5 100644
--- a/usr.sbin/ospf6d/hello.c
+++ b/usr.sbin/ospf6d/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.16 2010/05/26 13:56:08 nicm Exp $ */
+/* $OpenBSD: hello.c,v 1.17 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -22,7 +22,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <event.h>
diff --git a/usr.sbin/ospf6d/ospfe.c b/usr.sbin/ospf6d/ospfe.c
index 38c705a0212..15329abe570 100644
--- a/usr.sbin/ospf6d/ospfe.c
+++ b/usr.sbin/ospf6d/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.43 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ospfe.c,v 1.44 2014/11/18 20:54:28 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -34,7 +34,6 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include "ospf6.h"
#include "ospf6d.h"
diff --git a/usr.sbin/ospfd/hello.c b/usr.sbin/ospfd/hello.c
index 6a323ef5e58..afb64a3f267 100644
--- a/usr.sbin/ospfd/hello.c
+++ b/usr.sbin/ospfd/hello.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hello.c,v 1.20 2011/03/08 10:56:02 claudio Exp $ */
+/* $OpenBSD: hello.c,v 1.21 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -22,7 +22,6 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
-#include <sys/socket.h>
#include <stdlib.h>
#include <string.h>
#include <event.h>
diff --git a/usr.sbin/ospfd/ospfe.c b/usr.sbin/ospfd/ospfe.c
index c4e5e1fe2dd..cb80c8ab249 100644
--- a/usr.sbin/ospfd/ospfe.c
+++ b/usr.sbin/ospfd/ospfe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ospfe.c,v 1.88 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ospfe.c,v 1.89 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -34,7 +34,6 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include "ospf.h"
#include "ospfd.h"
diff --git a/usr.sbin/ripd/ripe.c b/usr.sbin/ripd/ripe.c
index 6d9a8ad07a7..140eaa9b4e4 100644
--- a/usr.sbin/ripd/ripe.c
+++ b/usr.sbin/ripd/ripe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ripe.c,v 1.16 2014/07/12 20:16:38 krw Exp $ */
+/* $OpenBSD: ripe.c,v 1.17 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 2006 Michele Marchetto <mydecay@openbeer.it>
@@ -35,7 +35,6 @@
#include <err.h>
#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include "ripd.h"
#include "rip.h"
diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index 017aad2ba05..6da308e36c5 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtadvd.c,v 1.49 2014/11/02 02:33:33 deraadt Exp $ */
+/* $OpenBSD: rtadvd.c,v 1.50 2014/11/18 20:54:29 krw Exp $ */
/* $KAME: rtadvd.c,v 1.66 2002/05/29 14:18:36 itojun Exp $ */
/*
@@ -54,7 +54,6 @@
#include <err.h>
#include <errno.h>
#include <string.h>
-#include <stdlib.h>
#include <util.h>
#include <pwd.h>
diff --git a/usr.sbin/rtsold/if.c b/usr.sbin/rtsold/if.c
index 4d3189dbfc3..048f999762c 100644
--- a/usr.sbin/rtsold/if.c
+++ b/usr.sbin/rtsold/if.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if.c,v 1.27 2014/07/11 16:44:13 henning Exp $ */
+/* $OpenBSD: if.c,v 1.28 2014/11/18 20:54:29 krw Exp $ */
/* $KAME: if.c,v 1.18 2002/05/31 10:10:03 itojun Exp $ */
/*
@@ -43,7 +43,6 @@
#include <net/if_media.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <netinet/in.h>
#include <netinet/icmp6.h>
#include <netinet6/in6_var.h>
diff --git a/usr.sbin/snmpctl/snmpclient.c b/usr.sbin/snmpctl/snmpclient.c
index 959af16755a..6254e24260c 100644
--- a/usr.sbin/snmpctl/snmpclient.c
+++ b/usr.sbin/snmpctl/snmpclient.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpclient.c,v 1.11 2014/05/08 14:48:31 mikeb Exp $ */
+/* $OpenBSD: snmpclient.c,v 1.12 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
@@ -35,7 +35,6 @@
#include <event.h>
#include <fcntl.h>
#include <string.h>
-#include <unistd.h>
#include <ctype.h>
#include <poll.h>
#include <err.h>
diff --git a/usr.sbin/snmpd/mib.c b/usr.sbin/snmpd/mib.c
index c2c499a069e..73e823e3f14 100644
--- a/usr.sbin/snmpd/mib.c
+++ b/usr.sbin/snmpd/mib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mib.c,v 1.72 2014/10/25 03:23:49 lteo Exp $ */
+/* $OpenBSD: mib.c,v 1.73 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
@@ -30,7 +30,6 @@
#include <sys/sysctl.h>
#include <sys/sensors.h>
#include <sys/sched.h>
-#include <sys/socket.h>
#include <sys/mount.h>
#include <sys/ioctl.h>
#include <sys/disk.h>
diff --git a/usr.sbin/ypserv/common/yplib_host.c b/usr.sbin/ypserv/common/yplib_host.c
index 2cca2a0ff38..1d1ed503c5e 100644
--- a/usr.sbin/ypserv/common/yplib_host.c
+++ b/usr.sbin/ypserv/common/yplib_host.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yplib_host.c,v 1.16 2009/10/27 23:59:57 deraadt Exp $ */
+/* $OpenBSD: yplib_host.c,v 1.17 2014/11/18 20:54:29 krw Exp $ */
/*
* Copyright (c) 1992, 1993 Theo de Raadt <deraadt@theos.com>
@@ -37,7 +37,6 @@
#include <string.h>
#include <netinet/in.h>
#include <arpa/inet.h>
-#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <rpc/rpc.h>