summaryrefslogtreecommitdiff
path: root/usr.sbin/slaacctl
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/slaacctl')
-rw-r--r--usr.sbin/slaacctl/slaacctl.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/usr.sbin/slaacctl/slaacctl.c b/usr.sbin/slaacctl/slaacctl.c
index 46e3d3d98dd..4b17fa3b02f 100644
--- a/usr.sbin/slaacctl/slaacctl.c
+++ b/usr.sbin/slaacctl/slaacctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: slaacctl.c,v 1.19 2020/04/16 05:28:30 florian Exp $ */
+/* $OpenBSD: slaacctl.c,v 1.20 2020/09/14 09:07:05 florian Exp $ */
/*
* Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -71,13 +71,13 @@ main(int argc, char *argv[])
int done = 0;
int n, verbose = 0;
int ch;
- char *sockname = NULL;
+ char *sockname;
+ sockname = SLAACD_SOCKET;
while ((ch = getopt(argc, argv, "s:")) != -1) {
switch (ch) {
case 's':
- if ((sockname = strdup(optarg)) == NULL)
- err(1, NULL);
+ sockname = optarg;
break;
default:
usage();
@@ -86,12 +86,6 @@ main(int argc, char *argv[])
argc -= optind;
argv += optind;
- if (sockname == NULL) {
- if (asprintf(&sockname, "%s.%d", SLAACD_SOCKET, getrtable()) ==
- -1)
- err(1, NULL);
- }
-
if (pledge("stdio unix", NULL) == -1)
err(1, "pledge");
@@ -106,7 +100,6 @@ main(int argc, char *argv[])
memset(&sun, 0, sizeof(sun));
sun.sun_family = AF_UNIX;
strlcpy(sun.sun_path, sockname, sizeof(sun.sun_path));
- free(sockname);
if (connect(ctl_sock, (struct sockaddr *)&sun, sizeof(sun)) == -1)
err(1, "connect: %s", sockname);