Add a noup directive to stop master mode bringing an interface up.

Fixes [96c6bf4e5f].
This commit is contained in:
Roy Marples 2015-07-13 17:40:54 +00:00
parent c20dab452a
commit 2862d340c7
4 changed files with 19 additions and 4 deletions

View File

@ -904,7 +904,9 @@ dhcpcd_prestartinterface(void *arg)
struct interface *ifp = arg;
pre_start(ifp);
if (if_up(ifp) == -1)
if ((!(ifp->ctx->options & DHCPCD_MASTER) ||
ifp->options->options & DHCPCD_IF_UP) &&
if_up(ifp) == -1)
logger(ifp->ctx, LOG_ERR, "%s: if_up: %m", ifp->name);
if (ifp->options->options & DHCPCD_LINK &&

View File

@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd July 9, 2015
.Dd July 13, 2015
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
@ -447,6 +447,14 @@ Disable solicitation and receipt of IPv6 Router Advertisements.
.It Ic nolink
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.
If
.Nm
cannot determine the carrier state,
.Nm
will enter a tight polling loop until the interface is marked up and running
or a valid carrier state is reported.
.It Ic option Ar option
Requests the
.Ar option

View File

@ -94,7 +94,7 @@
#define O_CONTROLGRP O_BASE + 34
#define O_SLAAC O_BASE + 35
#define O_GATEWAY O_BASE + 36
// unassigned O_BASE + 37
#define O_NOUP O_BASE + 37
#define O_IPV6RA_AUTOCONF O_BASE + 38
#define O_IPV6RA_NOAUTOCONF O_BASE + 39
#define O_REJECT O_BASE + 40
@ -196,6 +196,7 @@ const struct option cf_options[] = {
{"reject", required_argument, NULL, O_REJECT},
{"bootp", no_argument, NULL, O_BOOTP},
{"nodelay", no_argument, NULL, O_NODELAY},
{"noup", no_argument, NULL, O_NOUP},
{NULL, 0, NULL, '\0'}
};
@ -2003,6 +2004,9 @@ err_sla:
case O_GATEWAY:
ifo->options |= DHCPCD_GATEWAY;
break;
case O_NOUP:
ifo->options &= ~DHCPCD_IF_UP;
break;
case O_SLAAC:
if (strcmp(arg, "private") == 0 ||
strcmp(arg, "stableprivate") == 0 ||
@ -2117,6 +2121,7 @@ read_config(struct dhcpcd_ctx *ctx,
return NULL;
}
ifo->options |= DHCPCD_DAEMONISE | DHCPCD_LINK | DHCPCD_INITIAL_DELAY;
ifo->options |= DHCPCD_IF_UP;
#ifdef PLUGIN_DEV
ifo->options |= DHCPCD_DEV;
#endif

View File

@ -104,7 +104,7 @@
#define DHCPCD_IAID (1ULL << 48)
#define DHCPCD_DHCP (1ULL << 49)
#define DHCPCD_DHCP6 (1ULL << 50)
// unassigned (1ULL << 51)
#define DHCPCD_IF_UP (1ULL << 51)
// unassigned (1ULL << 52)
// unassinged (1ULL << 53)
#define DHCPCD_IPV6RA_AUTOCONF (1ULL << 54)