From bb8051bfc0f5bed384b83ac0b39dbbde1fc03e53 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 10 Oct 2013 09:22:44 +0000 Subject: [PATCH] Add noipv4 and noipv6 options. --- dhcpcd.conf.5.in | 6 +++++- if-options.c | 10 ++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/dhcpcd.conf.5.in b/dhcpcd.conf.5.in index 84e7c03f..99d797ba 100644 --- a/dhcpcd.conf.5.in +++ b/dhcpcd.conf.5.in @@ -22,7 +22,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 12, 2013 +.Dd October 10, 2013 .Dt DHCPCD.CONF 5 SMM .Os .Sh NAME @@ -285,12 +285,16 @@ So to stop .Nm dhcpcd from touching your DNS or MTU settings you would do:- .D1 nohook resolv.conf, mtu +.It Ic noipv4 +Don't attempt to configure an IPv4 address. .It Ic noipv4ll Don't attempt to obtain an IPv4LL address if we failed to get one via DHCP. See .Rs .%T "RFC 3927" .Re +.It Ic noipv6 +Don't attmept to configure an IPv6 address. .It Ic noipv6rs Disable solicitation and receipt of IPv6 Router Advertisements. .It Ic nolink diff --git a/if-options.c b/if-options.c index 97d1e12e..e7841c4b 100644 --- a/if-options.c +++ b/if-options.c @@ -70,6 +70,8 @@ unsigned long long options = 0; #define O_HOSTNAME_SHORT O_BASE + 13 #define O_DEV O_BASE + 14 #define O_NODEV O_BASE + 15 +#define O_NOIPV4 O_BASE + 16 +#define O_NOIPV6 O_BASE + 17 char *dev_load; @@ -129,6 +131,8 @@ const struct option cf_options[] = { {"ipv6ra_own_default", no_argument, NULL, O_IPV6RA_OWN_D}, {"ipv4only", no_argument, NULL, '4'}, {"ipv6only", no_argument, NULL, '6'}, + {"noipv4", no_argument, NULL, O_NOIPV4}, + {"noipv6", no_argument, NULL, O_NOIPV6}, {"noalias", no_argument, NULL, O_NOALIAS}, {"ia_na", no_argument, NULL, O_IA_NA}, {"ia_ta", no_argument, NULL, O_IA_TA}, @@ -909,6 +913,12 @@ parse_option(struct if_options *ifo, int opt, const char *arg) ifo->options &= ~DHCPCD_IPV4; ifo->options |= DHCPCD_IPV6; break; + case O_NOIPV4: + ifo->options &= ~DHCPCD_IPV4; + break; + case O_NOIPV6: + ifo->options &= ~DHCPCD_IPV6; + break; #ifdef INET case O_ARPING: if (parse_addr(&addr, NULL, arg) != 0) -- 2.47.3