}
static int
-make_sock(struct sockaddr_un *sa, const char *ifname, int unpriv)
+make_sock(struct sockaddr_un *sa, const char *ifname, bool unpriv)
{
int fd;
}
int
-control_open(const char *ifname)
+control_open(const char *ifname, bool unpriv)
{
struct sockaddr_un sa;
int fd;
- if ((fd = make_sock(&sa, ifname, 0)) != -1) {
+ if ((fd = make_sock(&sa, ifname, unpriv)) != -1) {
socklen_t len;
len = (socklen_t)SUN_LEN(&sa);
int control_start(struct dhcpcd_ctx *, const char *);
int control_stop(struct dhcpcd_ctx *);
-int control_open(const char *);
+int control_open(const char *, bool);
ssize_t control_send(struct dhcpcd_ctx *, int, char * const *);
int control_queue(struct fd_list *, void *, size_t, bool);
} else if (dp[1] == 'd' &&
isdigit((unsigned char)dp[2]))
print = true;
+ else
+ print = false;
} else
print = false;
while (dp < de && *dp != '\0') {
#endif
ctx.options |= DHCPCD_FORKED; /* avoid socket unlink */
if (!(ctx.options & DHCPCD_MASTER))
- ctx.control_fd = control_open(argv[optind]);
+ ctx.control_fd = control_open(argv[optind],
+ ctx.options & DHCPCD_DUMPLEASE);
if (ctx.control_fd == -1)
- ctx.control_fd = control_open(NULL);
+ ctx.control_fd = control_open(NULL,
+ ctx.options & DHCPCD_DUMPLEASE);
if (ctx.control_fd != -1) {
if (!(ctx.options & DHCPCD_DUMPLEASE))
loginfox("sending commands to dhcpcd process");