-/* $OpenBSD: dhcpleased.c,v 1.2 2021/02/27 10:07:41 florian Exp $ */
+/* $OpenBSD: dhcpleased.c,v 1.3 2021/02/27 10:21:08 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
int pipe_main2engine[2];
int frontend_routesock, rtfilter;
int rtable_any = RTABLE_ANY;
- char *csock = DHCPLEASED_SOCKET;
+ char *csock = _PATH_DHCPLEASED_SOCKET;
#ifndef SMALL
int control_fd;
#endif /* SMALL */
if (unveil("/dev/bpf", "rw") == -1)
fatal("unveil");
- if (unveil(LEASE_PATH, "rwc") == -1)
+ if (unveil(_PATH_LEASE, "rwc") == -1)
fatal("unveil");
if (unveil(NULL, NULL) == -1)
char *if_name;
char ntop_buf[INET_ADDRSTRLEN];
char lease_buf[LEASE_SIZE];
- char lease_file_buf[sizeof(LEASE_PATH) +
+ char lease_file_buf[sizeof(_PATH_LEASE) +
IF_NAMESIZE];
- char tmpl[] = LEASE_PATH"XXXXXXXXXX";
+ char tmpl[] = _PATH_LEASE"XXXXXXXXXX";
log_debug("%s", __func__);
}
len = snprintf(lease_file_buf, sizeof(lease_file_buf), "%s%s",
- LEASE_PATH, if_name);
+ _PATH_LEASE, if_name);
if ( len == -1 || (size_t) len >= sizeof(lease_file_buf)) {
log_warnx("%s: failed to encode lease path for %s", __func__,
if_name);
{
int len, fd;
char if_name[IF_NAMESIZE];
- char lease_file_buf[sizeof(LEASE_PATH) + IF_NAMESIZE];
+ char lease_file_buf[sizeof(_PATH_LEASE) + IF_NAMESIZE];
memset(imsg_ifinfo->lease, 0, sizeof(imsg_ifinfo->lease));
}
len = snprintf(lease_file_buf, sizeof(lease_file_buf), "%s%s",
- LEASE_PATH, if_name);
+ _PATH_LEASE, if_name);
if ( len == -1 || (size_t) len >= sizeof(lease_file_buf)) {
log_warnx("%s: failed to encode lease path for %s", __func__,
if_name);
-/* $OpenBSD: dhcpleased.h,v 1.2 2021/02/27 10:07:41 florian Exp $ */
+/* $OpenBSD: dhcpleased.h,v 1.3 2021/02/27 10:21:08 florian Exp $ */
/*
* Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#define DHCPLEASED_SOCKET "/dev/dhcpleased.sock"
+#define _PATH_DHCPLEASED_SOCKET "/dev/dhcpleased.sock"
#define DHCPLEASED_USER "_dhcp"
#define DHCPLEASED_RTA_LABEL "dhcpleased"
#define SERVER_PORT 67
#define CLIENT_PORT 68
-#define LEASE_PATH "/var/db/dhcpleased/"
+#define _PATH_LEASE "/var/db/dhcpleased/"
#define LEASE_PREFIX "version: 1\nip: "
#define LEASE_SIZE sizeof(LEASE_PREFIX"xxx.xxx.xxx.xxx\n")
/* MAXDNAME from arpa/namesr.h */
-/* $OpenBSD: dhcpleasectl.c,v 1.1 2021/02/26 16:16:37 florian Exp $ */
+/* $OpenBSD: dhcpleasectl.c,v 1.2 2021/02/27 10:21:08 florian Exp $ */
/*
* Copyright (c) 2021 Florian Obser <florian@openbsd.org>
int ch;
char *sockname;
- sockname = DHCPLEASED_SOCKET;
+ sockname = _PATH_DHCPLEASED_SOCKET;
while ((ch = getopt(argc, argv, "s:")) != -1) {
switch (ch) {
case 's':