These can be controlled via the nooption directives instead.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 24, 2017
+.Dd March 28, 2017
.Dt DHCPCD 8
.Os
.Sh NAME
.Nm
from touching your DNS settings you would do:-
.D1 dhcpcd -C resolv.conf eth0
-.It Fl G , Fl Fl nogateway
-Don't set any default routes.
.It Fl H , Fl Fl xidhwaddr
Use the last four bytes of the hardware address as the DHCP xid instead
of a randomly generated number.
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd March 24, 2017
+.Dd March 28, 2017
.Dt DHCPCD.CONF 5
.Os
.Sh NAME
.It Ic nodhcp6
Don't start DHCPv6 or listen to DHCPv6 messages.
Normally DHCPv6 is started by a RA instruction or configuration.
-.It Ic nogateway
-Don't install any default routes.
-.It Ic gateway
-Install a default route if available (default).
.It Ic nohook Ar script
Don't run this hook script.
Matches full name, or prefixed with 2 numbers optionally ending with
#define O_IPV6 O_BASE + 33
#define O_CONTROLGRP O_BASE + 34
#define O_SLAAC O_BASE + 35
-#define O_GATEWAY O_BASE + 36
+// unused O_BASE + 36
#define O_NOUP O_BASE + 37
#define O_IPV6RA_AUTOCONF O_BASE + 38
#define O_IPV6RA_NOAUTOCONF O_BASE + 39
{"nodhcp6", no_argument, NULL, O_NODHCP6},
{"controlgroup", required_argument, NULL, O_CONTROLGRP},
{"slaac", required_argument, NULL, O_SLAAC},
- {"gateway", no_argument, NULL, O_GATEWAY},
{"reject", required_argument, NULL, O_REJECT},
{"bootp", no_argument, NULL, O_BOOTP},
{"nodelay", no_argument, NULL, O_NODELAY},
return -1;
}
break;
- case 'G':
- ifo->options &= ~DHCPCD_GATEWAY;
- break;
case 'H':
ifo->options |= DHCPCD_XID_HWADDR;
break;
ctx->control_group = grp->gr_gid;
#endif
break;
- case O_GATEWAY:
- ifo->options |= DHCPCD_GATEWAY;
- break;
case O_NOUP:
ifo->options &= ~DHCPCD_IF_UP;
break;
ifo->options |= DHCPCD_DEV;
#endif
#ifdef INET
- ifo->options |= DHCPCD_IPV4 | DHCPCD_DHCP | DHCPCD_IPV4LL;
- ifo->options |= DHCPCD_GATEWAY | DHCPCD_ARP;
+ ifo->options |= DHCPCD_IPV4 | DHCPCD_ARP | DHCPCD_DHCP | DHCPCD_IPV4LL;
#endif
#ifdef INET6
ifo->options |= DHCPCD_IPV6 | DHCPCD_IPV6RS;
/* Don't set any optional arguments here so we retain POSIX
* compatibility with getopt */
#define IF_OPTS "146bc:de:f:gh:i:kl:m:no:pqr:s:t:u:v:wxy:z:" \
- "ABC:DEF:GHI:JKLMNO:PQ:S:TUVW:X:Z:"
+ "ABC:DEF:HI:JKLMNO:PQ:S:TUVW:X:Z:"
#define NOERR_IF_OPTS ":" IF_OPTS
#define DEFAULT_TIMEOUT 30
#define DHCPCD_ARP (1ULL << 0)
#define DHCPCD_RELEASE (1ULL << 1)
#define DHCPCD_DOMAIN (1ULL << 2)
-#define DHCPCD_GATEWAY (1ULL << 3)
+// unused (1ULL << 3)
#define DHCPCD_STATIC (1ULL << 4)
#define DHCPCD_DEBUG (1ULL << 5)
#define DHCPCD_LASTLEASE (1ULL << 7)
/* If configured, Install a gateway to the desintion
* for P2P interfaces. */
if (ifp->flags & IFF_POINTOPOINT &&
- ifp->options->options & DHCPCD_GATEWAY &&
has_option_mask(ifp->options->dstmask, DHO_ROUTER))
{
if ((rt = rt_new(ifp)) == NULL)
return false;
if (ipv4ll_subnetroute(routes, ifp) == -1)
return false;
- if (ifp->options->options & DHCPCD_GATEWAY) {
- if (inet_routerhostroute(routes, ifp) == -1)
- return false;
- }
+ if (inet_routerhostroute(routes, ifp) == -1)
+ return false;
}
/* If there is no default route, see if we can use an IPv4LL one. */
if (!have_default) {
TAILQ_FOREACH(ifp, ctx->ifaces, next) {
if (ifp->active &&
- ifp->options->options & DHCPCD_GATEWAY &&
ipv4ll_defaultroute(routes, ifp) == 1)
break;
}
{
struct dhcpcd_ctx *ctx;
bool change;
- unsigned long long options;
assert(nrt != NULL);
ctx = nrt->rt_ifp->ctx;
- /* Don't set default routes if not asked to */
- options = nrt->rt_ifp->options == NULL ?
- ctx->options : nrt->rt_ifp->options->options;
- if (!(options & DHCPCD_GATEWAY) &&
- sa_is_unspecified(&nrt->rt_dest) &&
- sa_is_unspecified(&nrt->rt_netmask))
- return false;
-
rt_desc(ort == NULL ? "adding" : "changing", nrt);
change = false;