From owner-svn-src-stable@FreeBSD.ORG Mon Oct 6 00:31:33 2014 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 18FD364C; Mon, 6 Oct 2014 00:31:33 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE754BE; Mon, 6 Oct 2014 00:31:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s960VWbO013662; Mon, 6 Oct 2014 00:31:32 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s960VWjc013625; Mon, 6 Oct 2014 00:31:32 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201410060031.s960VWjc013625@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Mon, 6 Oct 2014 00:31:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r272581 - in stable/9: etc etc/defaults share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Oct 2014 00:31:33 -0000 Author: bdrewery Date: Mon Oct 6 00:31:31 2014 New Revision: 272581 URL: https://svnweb.freebsd.org/changeset/base/272581 Log: MFC r271424,r272579: - Add $netif_ipexpand_max to specify the upper limit for the number of addresses generated by an address range specification. The default value is 2048. This can be increased by setting $netif_ipexpand_max in rc.conf. - Bump .Dd missed in r271424 Modified: stable/9/etc/defaults/rc.conf stable/9/etc/network.subr stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/etc/defaults/rc.conf ============================================================================== --- stable/9/etc/defaults/rc.conf Mon Oct 6 00:27:08 2014 (r272580) +++ stable/9/etc/defaults/rc.conf Mon Oct 6 00:31:31 2014 (r272581) @@ -114,6 +114,7 @@ synchronous_dhclient="NO" # Start dhclie # interfaces during startup. defaultroute_delay="30" # Time to wait for a default route on a DHCP interface. defaultroute_carrier_delay="5" # Time to wait for carrier while waiting for a default route. +netif_ipexpand_max="2048" # Maximum number of IP addrs in a range spec. wpa_supplicant_program="/usr/sbin/wpa_supplicant" wpa_supplicant_flags="-s" # Extra flags to pass to wpa_supplicant wpa_supplicant_conf_file="/etc/wpa_supplicant.conf" Modified: stable/9/etc/network.subr ============================================================================== --- stable/9/etc/network.subr Mon Oct 6 00:27:08 2014 (r272580) +++ stable/9/etc/network.subr Mon Oct 6 00:31:31 2014 (r272581) @@ -25,9 +25,7 @@ # $FreeBSD$ # IFCONFIG_CMD="/sbin/ifconfig" - -# Maximum number of addresses expanded from a address range specification. -_IPEXPANDMAX=31 +: ${netif_ipexpand_max:=2048} # # Subroutines commonly used from network startup scripts. @@ -820,8 +818,8 @@ ifalias_expand_addr_inet() _ipcount=$_iplow while [ "$_ipcount" -le "$_iphigh" ]; do _retstr="${_retstr} ${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail}${_plen:+/}${_plen}" - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ]; then - warn "Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed." + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ]; then + warn "Range specification is too large (${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_iphigh}${_iptail:+.}${_iptail}). ${_iphead}${_iphead:+.}${_iplow}${_iptail:+.}${_iptail}-${_iphead}${_iphead:+.}${_ipcount}${_iptail:+.}${_iptail} was processed. Increase \$netif_ipexpand_max in rc.conf." break else _ipcount=$(($_ipcount + 1)) @@ -910,9 +908,9 @@ ifalias_expand_addr_inet6() $_ipleft $_ipcount $_ipright \ ${_plen:+/}$_plen` _retstr="$_retstr $_r" - if [ $_ipcount -gt $(($_iplow + $_IPEXPANDMAX)) ] + if [ $_ipcount -gt $(($_iplow + $netif_ipexpand_max)) ] then - warn "Range specification is too large $(printf '(%s:%04x%s-%s:%04x%s)' $_ipleft $_iplow $_ipright $_ipleft $_iphigh $_ipright). $(printf '%s:%04x%s-%s:%04x%s' $_ipleft $_iplow $_ipright $_ipleft $_ipcount $_ipright) was processed." + warn "Range specification is too large $(printf '(%s:%x%s-%s:%x%s)' "$_ipleft" "$_iplow" "$_ipright" "$_ipleft" "$_iphigh" "$_ipright"). $(printf '%s:%x%s-%s:%x%s' "$_ipleft" "$_iplow" "$_ipright" "$_ipleft" "$_ipcount" "$_ipright") was processed. Increase \$netif_ipexpand_max in rc.conf." break else _ipcount=$(($_ipcount + 1)) Modified: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Mon Oct 6 00:27:08 2014 (r272580) +++ stable/9/share/man/man5/rc.conf.5 Mon Oct 6 00:31:31 2014 (r272581) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 13, 2014 +.Dd September 11, 2014 .Dt RC.CONF 5 .Os .Sh NAME @@ -1137,6 +1137,19 @@ or .Li inet6 2001:db8:1-f::1/64 . This notation allows address and prefix length part only, not the other address modifiers. +Note that the maximum number of the generated addresses from a range +specification is limited to an integer value specified in +.Va netif_ipexpand_max +in +.Xr rc.conf 5 +because a small typo can unexpectedly generate a large number of addresses. +The default value is +.Li 2048 . +It can be increased by adding the following line into +.Xr rc.conf 5 : +.Bd -literal +netif_ipexpand_max="4096" +.Ed .Pp In the case of .Li 192.0.2.5-23/24 ,