diff options
author | 2008-05-08 05:38:26 +0000 | |
---|---|---|
committer | 2008-05-08 05:38:26 +0000 | |
commit | 7eab935ea9cc9825611b23bbea5a3d8ff34709cd (patch) | |
tree | c5887da035c44ceb2f48473319e70f08d4e8aada | |
parent | make sure we always send back something on IMSG_CTL_SHOW_NEIGHBOR (diff) | |
download | wireguard-openbsd-7eab935ea9cc9825611b23bbea5a3d8ff34709cd.tar.xz wireguard-openbsd-7eab935ea9cc9825611b23bbea5a3d8ff34709cd.zip |
don't break dhcpd when not using synch mechanisms..
-rw-r--r-- | usr.sbin/dhcpd/sync.c | 5 | ||||
-rw-r--r-- | usr.sbin/dhcpd/sync.h | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/dhcpd/sync.c b/usr.sbin/dhcpd/sync.c index 58c776608c1..38155d70de4 100644 --- a/usr.sbin/dhcpd/sync.c +++ b/usr.sbin/dhcpd/sync.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sync.c,v 1.1 2008/05/07 12:19:20 beck Exp $ */ +/* $OpenBSD: sync.c,v 1.2 2008/05/08 05:38:26 beck Exp $ */ /* * Copyright (c) 2008 Bob Beck <beck@openbsd.org> @@ -375,6 +375,9 @@ sync_send(struct iovec *iov, int iovlen) { struct sync_host *shost; struct msghdr msg; + + if (syncfd == -1) + return; /* setup buffer */ bzero(&msg, sizeof(msg)); diff --git a/usr.sbin/dhcpd/sync.h b/usr.sbin/dhcpd/sync.h index af564712919..28371e8e103 100644 --- a/usr.sbin/dhcpd/sync.h +++ b/usr.sbin/dhcpd/sync.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sync.h,v 1.1 2008/05/07 12:19:20 beck Exp $ */ +/* $OpenBSD: sync.h,v 1.2 2008/05/08 05:38:26 beck Exp $ */ /* * Copyright (c) 2008, Bob Beck <beck@openbsd.org> @@ -64,6 +64,7 @@ struct dhcp_synctlv_lease { #define DHCP_SYNC_END 0x0000 #define DHCP_SYNC_LEASE 0x0001 +extern int syncfd; extern int sync_init(const char *, const char *, u_short); extern int sync_addhost(const char *, u_short); extern void sync_recv(void); |