if (opts & (DHCPCD_STATIC | DHCPCD_INFORM)) {
state->reason = "EXPIRE";
script_runreason(ifp, state->reason);
-#define NOT_ONLY_SELF (DHCPCD_MASTER | DHCPCD_IPV6RS | DHCPCD_DHCP6)
+#define NOT_ONLY_SELF (DHCPCD_MANAGER | DHCPCD_IPV6RS | DHCPCD_DHCP6)
if (!(ctx->options & NOT_ONLY_SELF))
eloop_exit(ifp->ctx->eloop, EXIT_FAILURE);
return deleted;
dhcp_closebpf(ifp);
openudp:
- /* If not in master mode, open an address specific socket. */
- if (ctx->options & DHCPCD_MASTER ||
+ /* If not in manager mode, open an address specific socket. */
+ if (ctx->options & DHCPCD_MANAGER ||
(state->old != NULL &&
state->old->yiaddr == state->new->yiaddr &&
old_state & STATE_ADDED && !(old_state & STATE_FAKE)))
state->udp_rfd = dhcp_openudp(&state->addr->addr);
if (state->udp_rfd == -1) {
logerr(__func__);
- /* Address sharing without master mode is not supported.
+ /* Address sharing without manager mode is not supported.
* It's also possible another DHCP client could be running,
* which is even worse.
* We still need to work, so re-open BPF. */
/* Listen on *.*.*.*:bootpc so that the kernel never sends an
* ICMP port unreachable message back to the DHCP server.
- * Only do this in master mode so we don't swallow messages
+ * Only do this in manager mode so we don't swallow messages
* for dhcpcd running on another interface. */
- if ((ctx->options & (DHCPCD_MASTER|DHCPCD_PRIVSEP)) == DHCPCD_MASTER
+ if ((ctx->options & (DHCPCD_MANAGER|DHCPCD_PRIVSEP)) == DHCPCD_MANAGER
&& ctx->udp_rfd == -1)
{
ctx->udp_rfd = dhcp_openudp(NULL);
#ifdef PRIVSEP
if (IN_PRIVSEP_SE(ifp->ctx) &&
- !(ifp->ctx->options & (DHCPCD_MASTER | DHCPCD_CONFIGURE)) &&
+ !(ifp->ctx->options & (DHCPCD_MANAGER | DHCPCD_CONFIGURE)) &&
IN_ARE_ADDR_EQUAL(&state->lease.addr, &ia->addr))
{
state->addr = ia;
break;
}
- /* In non master mode we listen and send from fixed addresses.
+ /* In non manager mode we listen and send from fixed addresses.
* We should try and match an address we have to unicast to,
* but for now this is the safest policy. */
- if (unicast != NULL && !(ifp->ctx->options & DHCPCD_MASTER)) {
- logdebugx("%s: ignoring unicast option as not master",
+ if (unicast != NULL && !(ifp->ctx->options & DHCPCD_MANAGER)) {
+ logdebugx("%s: ignoring unicast option as not manager",
ifp->name);
unicast = NULL;
}
if (ifp->ctx->options & DHCPCD_TEST ||
(ifp->options->options & DHCPCD_INFORM &&
- !(ifp->ctx->options & DHCPCD_MASTER)))
+ !(ifp->ctx->options & DHCPCD_MANAGER)))
{
eloop_exit(ifp->ctx->eloop, EXIT_SUCCESS);
}
size_t i;
const struct dhcp_compat *dhc;
- if ((ctx->options & (DHCPCD_MASTER|DHCPCD_PRIVSEP)) == DHCPCD_MASTER &&
+ if ((ctx->options & (DHCPCD_MANAGER|DHCPCD_PRIVSEP)) == DHCPCD_MANAGER &&
ctx->dhcp6_rfd == -1)
{
ctx->dhcp6_rfd = dhcp6_openudp(0, NULL);
struct dhcp6_state *state;
struct interface *ifp = ia->iface;
- /* If not running in master mode, listen to this address */
+ /* If not running in manager mode, listen to this address */
if (cmd == RTM_NEWADDR &&
!(ia->addr_flags & IN6_IFF_NOTUSEABLE) &&
ifp->active == IF_ACTIVE_USER &&
- !(ifp->ctx->options & DHCPCD_MASTER) &&
+ !(ifp->ctx->options & DHCPCD_MANAGER) &&
ifp->options->options & DHCPCD_DHCP6)
{
#ifdef PRIVSEP
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd November 25, 2020
+.Dd February 2, 2021
.Dt DHCPCD 8
.Os
.Sh NAME
When
.Nm
not limited to one interface on the command line,
-it is running in Master mode.
+it is running in Manager mode.
The
.Nm dhcpcd-ui
project expects dhcpcd to be running this way.
and
.Fl x
options, where the same interface will need to be specified, as a lack of an
-interface will imply Master mode which this is not.
-To force starting in Master mode with only one interface, the
-.Fl M , Fl Fl master
+interface will imply Manager mode which this is not.
+To force starting in Manager mode with only one interface, the
+.Fl M , Fl Fl manager
option can be used.
.Pp
Interfaces are preferred by carrier, DHCP lease/IPv4LL and then lowest metric.
option.
If no
.Ar interface
-is specified then this applies to all interfaces in Master mode.
+is specified then this applies to all interfaces in Manager mode.
If no interfaces are left running,
.Nm
will exit.
.Nm
does not request any lease time and leaves it in the hands of the
DHCP server.
-.It Fl M , Fl Fl master
+.It Fl M , Fl Fl manager
Start
.Nm
-in Master mode even if only one interface specified on the command line.
+in Manager mode even if only one interface specified on the command line.
See the Multiple Interfaces section above.
.It Fl m , Fl Fl metric Ar metric
Metrics are used to prefer an interface over another one, lowest wins.
.Ar interface .
If no
.Ar interface
-is specified then this applies to all interfaces in Master mode.
+is specified then this applies to all interfaces in Manager mode.
If
.Nm
is not running, then it starts up as normal.
.Ar interface .
If no
.Ar interface
-is specified then this applies to all interfaces in Master mode.
+is specified then this applies to all interfaces in Manager mode.
If
.Nm
is not running, then it starts up as normal.
to exit.
If no
.Ar interface
-is specified, then the above is applied to all interfaces in Master mode.
+is specified, then the above is applied to all interfaces in Manager mode.
See the
.Fl p , Fl Fl persistent
option to control configuration persistence on exit,
Don't start any interfaces other than those specified on the command line.
This allows
.Nm
-to be started in Master mode and then wait for subsequent
+to be started in Manager mode and then wait for subsequent
.Nm
commands to start each interface as required.
.It Fl Fl configure
running on the
.Ar interface .
.It Pa @RUNDIR@/sock
-Control socket to the master daemon.
+Control socket to the manager daemon.
.It Pa @RUNDIR@/unpriv.sock
-Unprivileged socket to the master daemon, only allows state retrieval.
+Unprivileged socket to the manager daemon, only allows state retrieval.
.It Pa @RUNDIR@/ Ns Ar interface Ns .sock
Control socket to per interface daemon.
+.It Pa @RUNDIR@/ Ns Ar interface Ns .unpriv.sock
+Unprivileged socket to per interface daemon, only allows state retrieval.
.El
.Sh SEE ALSO
.Xr fnmatch 3 ,
ctx = arg;
logerrx("timed out");
- if (!(ctx->options & DHCPCD_MASTER)) {
+ if (!(ctx->options & DHCPCD_MANAGER)) {
struct interface *ifp;
TAILQ_FOREACH(ifp, ctx->ifaces, next) {
/*
* Stop writing to stderr.
- * On the happy path, only the master process writes to stderr,
+ * On the happy path, only the manager process writes to stderr,
* so this just stops wasting fprintf calls to nowhere.
* All other calls - ie errors in privsep processes or script output,
* will error when printing.
* If we *really* want to fix that, then we need to suck
- * stderr/stdout in the master process and either disacrd it or pass
+ * stderr/stdout in the manager process and either disacrd it or pass
* it to the launcher process and then to stderr.
*/
logopts &= ~LOGERR_ERR;
ifp->active = IF_INACTIVE;
ifp->options->options &= ~DHCPCD_STOPPING;
- if (!(ctx->options & (DHCPCD_MASTER | DHCPCD_TEST)))
+ if (!(ctx->options & (DHCPCD_MANAGER | DHCPCD_TEST)))
eloop_exit(ctx->eloop, EXIT_FAILURE);
}
} else
randmac_down = false;
- if ((!(ctx->options & DHCPCD_MASTER) ||
+ if ((!(ctx->options & DHCPCD_MANAGER) ||
ifp->options->options & DHCPCD_IF_UP || randmac_down) &&
!(ifp->flags & IFF_UP))
{
/* We need to preserve these options. */
if (ctx->options & DHCPCD_STARTED)
ifo->options |= DHCPCD_STARTED;
- if (ctx->options & DHCPCD_MASTER)
- ifo->options |= DHCPCD_MASTER;
+ if (ctx->options & DHCPCD_MANAGER)
+ ifo->options |= DHCPCD_MANAGER;
if (ctx->options & DHCPCD_DAEMONISED)
ifo->options |= DHCPCD_DAEMONISED;
if (ctx->options & DHCPCD_PRIVSEP)
}
if (optind != argc - 1)
- ctx.options |= DHCPCD_MASTER;
+ ctx.options |= DHCPCD_MANAGER;
logsetopts(logopts);
logopen(ctx.logfile);
printpidfile:
/* If we have any other args, we should run as a single dhcpcd
* instance for that interface. */
- if (optind == argc - 1 && !(ctx.options & DHCPCD_MASTER)) {
+ if (optind == argc - 1 && !(ctx.options & DHCPCD_MANAGER)) {
const char *per;
const char *ifname;
} else {
snprintf(ctx.pidfile, sizeof(ctx.pidfile),
PIDFILE, "", "", "");
- ctx.options |= DHCPCD_MASTER;
+ ctx.options |= DHCPCD_MANAGER;
}
if (ctx.options & DHCPCD_PRINT_PIDFILE) {
printf("%s\n", ctx.pidfile);
{
ctx.options |= DHCPCD_FORKED; /* pretend child process */
#ifdef PRIVSEP
- if (IN_PRIVSEP(&ctx) && ps_mastersandbox(&ctx, NULL) == -1)
+ if (IN_PRIVSEP(&ctx) && ps_managersandbox(&ctx, NULL) == -1)
goto exit_failure;
#endif
ifp = calloc(1, sizeof(*ifp));
!(ctx.options & DHCPCD_TEST))
{
ctx.options |= DHCPCD_FORKED; /* avoid socket unlink */
- if (!(ctx.options & DHCPCD_MASTER))
+ if (!(ctx.options & DHCPCD_MANAGER))
ctx.control_fd = control_open(argv[optind], family,
ctx.options & DHCPCD_DUMPLEASE);
- if (!(ctx.options & DHCPCD_MASTER) && ctx.control_fd == -1)
+ if (!(ctx.options & DHCPCD_MANAGER) && ctx.control_fd == -1)
ctx.control_fd = control_open(argv[optind], AF_UNSPEC,
ctx.options & DHCPCD_DUMPLEASE);
if (ctx.control_fd == -1)
if (ctx.control_fd != -1) {
#ifdef PRIVSEP
if (IN_PRIVSEP(&ctx) &&
- ps_mastersandbox(&ctx, NULL) == -1)
+ ps_managersandbox(&ctx, NULL) == -1)
goto exit_failure;
#endif
if (!(ctx.options & DHCPCD_DUMPLEASE))
#if defined(USE_SIGNALS) && !defined(THERE_IS_NO_FORK)
if (!(ctx.options & DHCPCD_DAEMONISE))
- goto start_master;
+ goto start_manager;
if (xsocketpair(AF_UNIX, SOCK_DGRAM | SOCK_CXNB, 0, fork_fd) == -1 ||
(ctx.stderr_valid &&
logerr("%s: eloop_event_add", __func__);
}
#ifdef PRIVSEP
- if (IN_PRIVSEP(&ctx) && ps_mastersandbox(&ctx, NULL) == -1)
+ if (IN_PRIVSEP(&ctx) && ps_managersandbox(&ctx, NULL) == -1)
goto exit_failure;
#endif
goto run_loop;
/* We have now forked, setsid, forked once more.
* From this point on, we are the controlling daemon. */
- logdebugx("spawned master process on PID %d", getpid());
-start_master:
+ logdebugx("spawned manager process on PID %d", getpid());
+start_manager:
ctx.options |= DHCPCD_STARTED;
if ((pid = pidfile_lock(ctx.pidfile)) != 0) {
logerr("%s: pidfile_lock %d", __func__, pid);
if (!(ctx.options & DHCPCD_TEST)) {
if (control_start(&ctx,
- ctx.options & DHCPCD_MASTER ?
+ ctx.options & DHCPCD_MANAGER ?
NULL : argv[optind], family) == -1)
{
logerr("%s: control_start", __func__);
/* Start any dev listening plugin which may want to
* change the interface name provided by the kernel */
if (!IN_PRIVSEP(&ctx) &&
- (ctx.options & (DHCPCD_MASTER | DHCPCD_DEV)) ==
- (DHCPCD_MASTER | DHCPCD_DEV))
+ (ctx.options & (DHCPCD_MANAGER | DHCPCD_DEV)) ==
+ (DHCPCD_MANAGER | DHCPCD_DEV))
dev_start(&ctx, dhcpcd_handleinterface);
#endif
setproctitle("%s%s%s",
- ctx.options & DHCPCD_MASTER ? "[master]" : argv[optind],
+ ctx.options & DHCPCD_MANAGER ? "[manager]" : argv[optind],
ctx.options & DHCPCD_IPV4 ? " [ip4]" : "",
ctx.options & DHCPCD_IPV6 ? " [ip6]" : "");
logerr("%s: eloop_event_add", __func__);
#ifdef PRIVSEP
- if (IN_PRIVSEP(&ctx) && ps_mastersandbox(&ctx, "stdio route") == -1)
+ if (IN_PRIVSEP(&ctx) && ps_managersandbox(&ctx, "stdio route") == -1)
goto exit_failure;
#endif
}
if (!(ctx.options & DHCPCD_BACKGROUND)) {
- if (ctx.options & DHCPCD_MASTER)
+ if (ctx.options & DHCPCD_MANAGER)
t = ifo->timeout;
else {
t = 0;
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd December 27, 2020
+.Dd Febrary 2, 2021
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
Don't receive link messages about carrier status.
You should only set this for buggy interface drivers.
.It Ic noup
-Don't bring the interface up when in master mode.
+Don't bring the interface up when in manager mode.
.It Ic option Ar option
Requests the
.Ar option
{"broadcast", no_argument, NULL, 'J'},
{"nolink", no_argument, NULL, 'K'},
{"noipv4ll", no_argument, NULL, 'L'},
- {"master", no_argument, NULL, 'M'},
+ {"manager", no_argument, NULL, 'M'},
{"renew", no_argument, NULL, 'N'},
{"nooption", required_argument, NULL, 'O'},
{"printpidfile", no_argument, NULL, 'P'},
ifo->options &= ~DHCPCD_IPV4LL;
break;
case 'M':
- ifo->options |= DHCPCD_MASTER;
+ ifo->options |= DHCPCD_MANAGER;
break;
case 'O':
ARG_REQUIRED;
#endif
case O_IAID:
ARG_REQUIRED;
- if (ctx->options & DHCPCD_MASTER && !IN_CONFIG_BLOCK(ifo)) {
+ if (ctx->options & DHCPCD_MANAGER && !IN_CONFIG_BLOCK(ifo)) {
logerrx("IAID must belong in an interface block");
return -1;
}
logwarnx("%s: IA_PD not compiled in", ifname);
return -1;
#else
- if (ctx->options & DHCPCD_MASTER &&
+ if (ctx->options & DHCPCD_MANAGER &&
!IN_CONFIG_BLOCK(ifo))
{
logerrx("IA PD must belong in an "
i = D6_OPTION_IA_PD;
#endif
}
- if (ctx->options & DHCPCD_MASTER &&
+ if (ctx->options & DHCPCD_MANAGER &&
!IN_CONFIG_BLOCK(ifo) && arg)
{
logerrx("IA with IAID must belong in an "
#define DHCPCD_DAEMONISE (1ULL << 14)
#define DHCPCD_DAEMONISED (1ULL << 15)
#define DHCPCD_TEST (1ULL << 16)
-#define DHCPCD_MASTER (1ULL << 17)
+#define DHCPCD_MANAGER (1ULL << 17)
#define DHCPCD_HOSTNAME (1ULL << 18)
#define DHCPCD_CLIENTID (1ULL << 19)
#define DHCPCD_LINK (1ULL << 20)
#ifdef DHCP6
#ifdef PRIVSEP
- if (!(ia->iface->ctx->options & DHCPCD_MASTER))
+ if (!(ia->iface->ctx->options & DHCPCD_MANAGER))
ps_inet_closedhcp6(ia);
#elif defined(SMALL)
UNUSED(ia);
struct dhcpcd_ctx *ctx = arg;
sa_family_t af;
- if (ctx->options & DHCPCD_MASTER) {
+ if (ctx->options & DHCPCD_MANAGER) {
setproctitle("[control proxy]");
af = AF_UNSPEC;
} else {
ctx->ps_control_pid = getpid();
return control_start(ctx,
- ctx->options & DHCPCD_MASTER ? NULL : *ctx->ifv, af);
+ ctx->options & DHCPCD_MANAGER ? NULL : *ctx->ifv, af);
}
static ssize_t
{
#ifdef INET
- if ((ctx->options & (DHCPCD_IPV4 | DHCPCD_MASTER)) ==
- (DHCPCD_IPV4 | DHCPCD_MASTER))
+ if ((ctx->options & (DHCPCD_IPV4 | DHCPCD_MANAGER)) ==
+ (DHCPCD_IPV4 | DHCPCD_MANAGER))
return true;
#endif
#if defined(INET6) && !defined(__sun)
return true;
#endif
#ifdef DHCP6
- if ((ctx->options & (DHCPCD_IPV6 | DHCPCD_MASTER)) ==
- (DHCPCD_IPV6 | DHCPCD_MASTER))
+ if ((ctx->options & (DHCPCD_IPV6 | DHCPCD_MANAGER)) ==
+ (DHCPCD_IPV6 | DHCPCD_MANAGER))
return true;
#endif
struct dhcpcd_ctx *ctx = arg;
int ret = 0;
- if (ctx->options & DHCPCD_MASTER)
+ if (ctx->options & DHCPCD_MANAGER)
setproctitle("[network proxy]");
else
setproctitle("[network proxy] %s%s%s",
errno = 0;
#ifdef INET
- if ((ctx->options & (DHCPCD_IPV4 | DHCPCD_MASTER)) ==
- (DHCPCD_IPV4 | DHCPCD_MASTER))
+ if ((ctx->options & (DHCPCD_IPV4 | DHCPCD_MANAGER)) ==
+ (DHCPCD_IPV4 | DHCPCD_MANAGER))
{
ctx->udp_rfd = dhcp_openudp(NULL);
if (ctx->udp_rfd == -1)
}
#endif
#ifdef DHCP6
- if ((ctx->options & (DHCPCD_IPV6 | DHCPCD_MASTER)) ==
- (DHCPCD_IPV6 | DHCPCD_MASTER))
+ if ((ctx->options & (DHCPCD_IPV6 | DHCPCD_MANAGER)) ==
+ (DHCPCD_IPV6 | DHCPCD_MANAGER))
{
ctx->dhcp6_rfd = dhcp6_openudp(0, NULL);
if (ctx->dhcp6_rfd == -1)
{
struct dhcpcd_ctx *ctx = arg;
- if (ctx->options & DHCPCD_MASTER)
+ if (ctx->options & DHCPCD_MANAGER)
setproctitle("[privileged actioneer]");
else
setproctitle("[privileged actioneer] %s%s%s",
/* Open network sockets for sending.
* This is a small bit wasteful for non sandboxed OS's
- * but makes life very easy for unicasting DHCPv6 in non master
+ * but makes life very easy for unicasting DHCPv6 in non manager
* mode as we no longer care about address selection.
* We can't call shutdown SHUT_RD on the socket because it's
* not connectd. All we can do is try and set a zero sized
#ifdef PLUGIN_DEV
/* Start any dev listening plugin which may want to
* change the interface name provided by the kernel */
- if ((ctx->options & (DHCPCD_MASTER | DHCPCD_DEV)) ==
- (DHCPCD_MASTER | DHCPCD_DEV))
+ if ((ctx->options & (DHCPCD_MANAGER | DHCPCD_DEV)) ==
+ (DHCPCD_MANAGER | DHCPCD_DEV))
dev_start(ctx, ps_root_handleinterface);
#endif
* Spawn an unpriv process to send/receive common network data.
* Then drop all privs and start running.
* Every process aside from the privileged actioneer is chrooted.
- * All privsep processes ignore signals - only the master process accepts them.
+ * All privsep processes ignore signals - only the manager process accepts them.
*
* dhcpcd will maintain the config file in the chroot, no need to handle
* this in a script or something.
}
int
-ps_mastersandbox(struct dhcpcd_ctx *ctx, const char *_pledge)
+ps_managersandbox(struct dhcpcd_ctx *ctx, const char *_pledge)
{
const char *sandbox = NULL;
bool forked;
return -1;
} else if (ctx->options & DHCPCD_LAUNCHER ||
((!(ctx->options & DHCPCD_DAEMONISE)) &&
- ctx->options & DHCPCD_MASTER))
+ ctx->options & DHCPCD_MANAGER))
logdebugx("sandbox: %s", sandbox);
return 0;
}
int ps_start(struct dhcpcd_ctx *);
int ps_stop(struct dhcpcd_ctx *);
int ps_entersandbox(const char *, const char **);
-int ps_mastersandbox(struct dhcpcd_ctx *, const char *);
+int ps_managersandbox(struct dhcpcd_ctx *, const char *);
int ps_unrollmsg(struct msghdr *, struct ps_msghdr *, const void *, size_t);
ssize_t ps_sendpsmmsg(struct dhcpcd_ctx *, int,