public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: Michael Tremer <git@ipfire.org>
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, next, updated. b67f02d512335f235710934bafe15db87067316d
Date: Wed, 07 Oct 2020 11:48:47 +0000	[thread overview]
Message-ID: <4C5t000nRXz2xSR@people01.haj.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 17866 bytes --]

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "IPFire 2.x development tree".

The branch, next has been updated
       via  b67f02d512335f235710934bafe15db87067316d (commit)
      from  391540d9d82b42042756c67b2f5676d799d92f59 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit b67f02d512335f235710934bafe15db87067316d
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Wed Oct 7 11:46:46 2020 +0000

    /var/ipfire/ethernet/settings: Drop BROADCAST variable
    
    This variable is no longer being used and was only used to
    assign IP addresses to the individual interfaces.
    
    However, the kernel knows best which IP address to select
    as broadcast address for each network. Therefore we depend
    on the kernel which allows us to support RFC3021.
    
    Fixes: #12486 - no /31 transfer net available on red
    Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>

-----------------------------------------------------------------------

Summary of changes:
 config/rootfiles/core/152/filelists/files                  |  8 ++++++++
 config/rootfiles/{oldcore/119 => core/152}/filelists/setup |  0
 lfs/wio                                                    |  2 +-
 src/initscripts/helper/aws-setup                           |  5 -----
 src/initscripts/helper/azure-setup                         |  7 +------
 src/initscripts/helper/exoscale-setup                      |  4 ----
 src/initscripts/helper/gcp-setup                           |  4 ----
 src/initscripts/helper/oci-setup                           |  5 -----
 src/initscripts/networking/any                             | 11 +----------
 src/initscripts/networking/red                             |  9 +--------
 src/misc-progs/setaliases.c                                | 13 +++----------
 src/setup/netstuff.c                                       | 13 +------------
 src/wio/wio.cgi                                            |  4 +++-
 13 files changed, 19 insertions(+), 66 deletions(-)
 copy config/rootfiles/{oldcore/119 => core/152}/filelists/setup (100%)

Difference in files:
diff --git a/config/rootfiles/core/152/filelists/files b/config/rootfiles/core/152/filelists/files
index 0894d828f..b80348eb0 100644
--- a/config/rootfiles/core/152/filelists/files
+++ b/config/rootfiles/core/152/filelists/files
@@ -1,3 +1,11 @@
 etc/system-release
 etc/issue
+etc/rc.d/helpers/aws-setup
+etc/rc.d/helpers/azure-setup
+etc/rc.d/helpers/exoscale-setup
+etc/rc.d/helpers/gcp-setup
+etc/rc.d/helpers/oci-setup
+etc/rc.d/init.d/networking/any
+etc/rc.d/init.d/networking/red
 srv/web/ipfire/cgi-bin/credits.cgi
+usr/local/bin/setaliases
diff --git a/config/rootfiles/core/152/filelists/setup b/config/rootfiles/core/152/filelists/setup
new file mode 120000
index 000000000..209374bbc
--- /dev/null
+++ b/config/rootfiles/core/152/filelists/setup
@@ -0,0 +1 @@
+../../../common/setup
\ No newline at end of file
diff --git a/lfs/wio b/lfs/wio
index e0dd53689..b4222f1b5 100644
--- a/lfs/wio
+++ b/lfs/wio
@@ -15,7 +15,7 @@ THISAPP    = wio-$(VER)
 DIR_APP    = $(DIR_SRC)/$(THISAPP)
 TARGET     = $(DIR_INFO)/$(THISAPP)
 PROG       = wio
-PAK_VER    = 10
+PAK_VER    = 11
 
 ###############################################################################
 # Top-level Rules
diff --git a/src/initscripts/helper/aws-setup b/src/initscripts/helper/aws-setup
index 9b67019d6..4867540bd 100644
--- a/src/initscripts/helper/aws-setup
+++ b/src/initscripts/helper/aws-setup
@@ -146,12 +146,10 @@ import_aws_configuration() {
 
 		local prefix="${subnet#*/}"
 		local netmask="$(prefix2netmask "${prefix}")"
-		local netmask_num="$(to_integer "${netmask}")"
 
 		# Calculate the network and broadcast addresses
 		local netaddress="${subnet%/*}"
 		local netaddress_num="$(to_integer "${netaddress}")"
-		local broadcast="$(to_address $(( ipv4_address_num | (0xffffffff ^ netmask_num) )))"
 
 		case "${device_number}" in
 			# RED
@@ -169,7 +167,6 @@ import_aws_configuration() {
 					echo "RED_ADDRESS=${ipv4_address}"
 					echo "RED_NETMASK=${netmask}"
 					echo "RED_NETADDRESS=${netaddress}"
-					echo "RED_BROADCAST=${broadcast}"
 					echo "RED_MTU=1500"
 					echo "DEFAULT_GATEWAY=${gateway}"
 				) >> /var/ipfire/ethernet/settings
@@ -191,7 +188,6 @@ import_aws_configuration() {
 					echo "GREEN_ADDRESS=${ipv4_address}"
 					echo "GREEN_NETMASK=${netmask}"
 					echo "GREEN_NETADDRESS=${netaddress}"
-					echo "GREEN_BROADCAST=${broadcast}"
 					echo "GREEN_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
@@ -208,7 +204,6 @@ import_aws_configuration() {
 					echo "ORANGE_ADDRESS=${ipv4_address}"
 					echo "ORANGE_NETMASK=${netmask}"
 					echo "ORANGE_NETADDRESS=${netaddress}"
-					echo "ORANGE_BROADCAST=${broadcast}"
 					echo "ORANGE_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
diff --git a/src/initscripts/helper/azure-setup b/src/initscripts/helper/azure-setup
index 291b8e0a4..5157712fc 100644
--- a/src/initscripts/helper/azure-setup
+++ b/src/initscripts/helper/azure-setup
@@ -160,12 +160,10 @@ import_azure_configuration() {
 		local ipv4_address_num="$(to_integer "${ipv4_address}")"
 		local prefix="$(get "network/interface/${device_number}/ipv4/subnet/0/prefix")"
 		local netmask="$(prefix2netmask "${prefix}")"
-		local netmask_num="$(to_integer "${netmask}")"
 
-		# Calculate the network and broadcast addresses
+		# Get the network address
 		local netaddress="$(get "network/interface/${device_number}/ipv4/subnet/0/address")"
 		local netaddress_num="$(to_integer "${netaddress}")"
-		local broadcast="$(to_address $(( ipv4_address_num | (0xffffffff ^ netmask_num) )))"
 
 		case "${device_number}" in
 			# RED
@@ -183,7 +181,6 @@ import_azure_configuration() {
 					echo "RED_ADDRESS=${ipv4_address}"
 					echo "RED_NETMASK=${netmask}"
 					echo "RED_NETADDRESS=${netaddress}"
-					echo "RED_BROADCAST=${broadcast}"
 					echo "DEFAULT_GATEWAY=${gateway}"
 				) >> /var/ipfire/ethernet/settings
 
@@ -213,7 +210,6 @@ import_azure_configuration() {
 					echo "GREEN_ADDRESS=${ipv4_address}"
 					echo "GREEN_NETMASK=${netmask}"
 					echo "GREEN_NETADDRESS=${netaddress}"
-					echo "GREEN_BROADCAST=${broadcast}"
 				) >> /var/ipfire/ethernet/settings
 				;;
 
@@ -229,7 +225,6 @@ import_azure_configuration() {
 					echo "ORANGE_ADDRESS=${ipv4_address}"
 					echo "ORANGE_NETMASK=${netmask}"
 					echo "ORANGE_NETADDRESS=${netaddress}"
-					echo "ORANGE_BROADCAST=${broadcast}"
 				) >> /var/ipfire/ethernet/settings
 				;;
 		esac
diff --git a/src/initscripts/helper/exoscale-setup b/src/initscripts/helper/exoscale-setup
index 24e98d38b..2ff8a18a2 100644
--- a/src/initscripts/helper/exoscale-setup
+++ b/src/initscripts/helper/exoscale-setup
@@ -122,7 +122,6 @@ import_exoscale_configuration() {
 					GREEN_ADDRESS="10.0.0.1"
 					GREEN_NETMASK="255.255.255.0"
 					GREEN_NETADDRESS="10.0.0.0"
-					GREEN_BROADCAST="10.0.0.255"
 				fi
 
 				(
@@ -132,7 +131,6 @@ import_exoscale_configuration() {
 					echo "GREEN_ADDRESS=${GREEN_ADDRESS}"
 					echo "GREEN_NETMASK=${GREEN_NETMASK}"
 					echo "GREEN_NETADDRESS=${GREEN_NETADDRESS}"
-					echo "GREEN_BROADCAST=${GREEN_BROADCAST}"
 					echo "GREEN_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
@@ -146,7 +144,6 @@ import_exoscale_configuration() {
 					ORANGE_ADDRESS="10.0.1.1"
 					ORANGE_NETMASK="255.255.255.0"
 					ORANGE_NETADDRESS="10.0.1.0"
-					ORANGE_BROADCAST="10.0.1.255"
 				fi
 
 				(
@@ -156,7 +153,6 @@ import_exoscale_configuration() {
 					echo "ORANGE_ADDRESS=${ORANGE_ADDRESS}"
 					echo "ORANGE_NETMASK=${ORANGE_NETMASK}"
 					echo "ORANGE_NETADDRESS=${ORANGE_NETADDRESS}"
-					echo "ORANGE_BROADCAST=${ORANGE_BROADCAST}"
 					echo "ORANGE_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
diff --git a/src/initscripts/helper/gcp-setup b/src/initscripts/helper/gcp-setup
index eab09eb2c..8868750db 100644
--- a/src/initscripts/helper/gcp-setup
+++ b/src/initscripts/helper/gcp-setup
@@ -142,7 +142,6 @@ import_gcp_configuration() {
 
 		# Calculate the network and broadcast addresses
 		local netaddress="$(to_address $(( ipv4_address_num & netmask_num )))"
-		local broadcast="$(to_address $(( ipv4_address_num | (0xffffffff ^ netmask_num) )))"
 
 		case "${device_number}" in
 			# RED
@@ -158,7 +157,6 @@ import_gcp_configuration() {
 					echo "RED_ADDRESS=${ipv4_address}"
 					echo "RED_NETMASK=${netmask}"
 					echo "RED_NETADDRESS=${netaddress}"
-					echo "RED_BROADCAST=${broadcast}"
 					echo "RED_MTU=${DEFAULT_MTU}"
 					echo "DEFAULT_GATEWAY=${gateway}"
 				) >> /var/ipfire/ethernet/settings
@@ -180,7 +178,6 @@ import_gcp_configuration() {
 					echo "GREEN_ADDRESS=${ipv4_address}"
 					echo "GREEN_NETMASK=${netmask}"
 					echo "GREEN_NETADDRESS=${netaddress}"
-					echo "GREEN_BROADCAST=${broadcast}"
 					echo "GREEN_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
@@ -197,7 +194,6 @@ import_gcp_configuration() {
 					echo "ORANGE_ADDRESS=${ipv4_address}"
 					echo "ORANGE_NETMASK=${netmask}"
 					echo "ORANGE_NETADDRESS=${netaddress}"
-					echo "ORANGE_BROADCAST=${broadcast}"
 					echo "ORANGE_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
diff --git a/src/initscripts/helper/oci-setup b/src/initscripts/helper/oci-setup
index aca09e673..0763a96e7 100644
--- a/src/initscripts/helper/oci-setup
+++ b/src/initscripts/helper/oci-setup
@@ -147,11 +147,9 @@ import_oci_configuration() {
 		local prefix="${subnet#*/}"
 
 		local netmask="$(prefix2netmask "${prefix}")"
-		local netmask_num="$(to_integer "${netmask}")"
 
 		# Calculate the network and broadcast addresses
 		local netaddress="${subnet%/*}"
-		local broadcast="$(to_address $(( ipv4_address_num | (0xffffffff ^ netmask_num) )))"
 
 		local index="$(oci_get_interface_param "${id}" "nicIndex")"
 
@@ -174,7 +172,6 @@ import_oci_configuration() {
 					echo "RED_ADDRESS=${ipv4_address}"
 					echo "RED_NETMASK=${netmask}"
 					echo "RED_NETADDRESS=${netaddress}"
-					echo "RED_BROADCAST=${broadcast}"
 					echo "RED_MTU=1500"
 					echo "DEFAULT_GATEWAY=${gateway}"
 				) >> /var/ipfire/ethernet/settings
@@ -196,7 +193,6 @@ import_oci_configuration() {
 					echo "GREEN_ADDRESS=${ipv4_address}"
 					echo "GREEN_NETMASK=${netmask}"
 					echo "GREEN_NETADDRESS=${netaddress}"
-					echo "GREEN_BROADCAST=${broadcast}"
 					echo "GREEN_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
@@ -213,7 +209,6 @@ import_oci_configuration() {
 					echo "ORANGE_ADDRESS=${ipv4_address}"
 					echo "ORANGE_NETMASK=${netmask}"
 					echo "ORANGE_NETADDRESS=${netaddress}"
-					echo "ORANGE_BROADCAST=${broadcast}"
 					echo "ORANGE_MTU=${DEFAULT_MTU}"
 				) >> /var/ipfire/ethernet/settings
 				;;
diff --git a/src/initscripts/networking/any b/src/initscripts/networking/any
index 0cf107f48..7ca1ab2c3 100644
--- a/src/initscripts/networking/any
+++ b/src/initscripts/networking/any
@@ -22,7 +22,6 @@ eval $(/usr/local/bin/readhash /var/ipfire/ethernet/settings)
 if [ "$(basename $0)" == "green" ]; then
 	DEVICE="${GREEN_DEV}"
 	ADDRESS="${GREEN_ADDRESS}"
-	BROADCAST="${GREEN_BROADCAST}"
 	NETADDRESS="${GREEN_NETADDRESS}"
 	NETMASK="${GREEN_NETMASK}"
 	DEVICE="${GREEN_DEV}"
@@ -30,7 +29,6 @@ if [ "$(basename $0)" == "green" ]; then
 elif [ "$(basename $0)" == "blue" ]; then
 	DEVICE="${BLUE_DEV}"
 	ADDRESS="${BLUE_ADDRESS}"
-	BROADCAST="${BLUE_BROADCAST}"
 	NETADDRESS="${BLUE_NETADDRESS}"
 	NETMASK="${BLUE_NETMASK}"
 	DEVICE="${BLUE_DEV}"
@@ -38,22 +36,15 @@ elif [ "$(basename $0)" == "blue" ]; then
 elif [ "$(basename $0)" == "orange" ]; then
 	DEVICE="${ORANGE_DEV}"
 	ADDRESS="${ORANGE_ADDRESS}"
-	BROADCAST="${ORANGE_BROADCAST}"
 	NETADDRESS="${ORANGE_NETADDRESS}"
 	NETMASK="${ORANGE_NETMASK}"
 	DEVICE="${ORANGE_DEV}"
 	MTU="${ORANGE_MTU}"
 fi
 
-if [ -z "${BROADCAST}" ]; then
-	boot_mesg "BROADCAST variable missing from input, cannot continue." ${FAILURE}
-	echo_failure
-	exit 1
-fi
-		
 if [ -n "${ADDRESS}" -a -n "${NETMASK}" ]; then
 	PREFIX=`whatmask ${NETMASK} | grep -e ^CIDR | awk -F': ' '{ print $2 }' | cut -c 2-`
-	args="${args} ${ADDRESS}/${PREFIX} broadcast ${BROADCAST}"
+	args="${args} ${ADDRESS}/${PREFIX}"
 else
 	boot_mesg "ADDRESS and/or NETMASK variable missing from input, cannot continue." ${FAILURE}
 	echo_failure
diff --git a/src/initscripts/networking/red b/src/initscripts/networking/red
index 44e0daa68..ca0a8ae58 100644
--- a/src/initscripts/networking/red
+++ b/src/initscripts/networking/red
@@ -51,13 +51,11 @@ fi
 if [ "${TYPE}" == "STATIC" ]; then
 	if [ "${DEVICE}" != "${GREEN_DEV}" ]; then
 		ADDRESS="${RED_ADDRESS}"
-		BROADCAST="${RED_BROADCAST}"
 		NETADDRESS="${RED_NETADDRESS}"
 		NETMASK="${RED_NETMASK}"
 		MTU="${RED_MTU}"
 	else
 		ADDRESS="${GREEN_ADDRESS}"
-		BROADCAST="${GREEN_BROADCAST}"
 		NETADDRESS="${GREEN_NETADDRESS}"
 		NETMASK="${GREEN_NETMASK}"
 		MTU="${GREEN_MTU}"
@@ -66,14 +64,9 @@ if [ "${TYPE}" == "STATIC" ]; then
 	# DNS1
 	# DNS2
 
-	if [ -z "${BROADCAST}" ]; then
-		boot_mesg "BROADCAST variable missing, cannot continue." ${FAILURE}
-		echo_failure
-		exit 1
-	fi
 	if [ -n "${ADDRESS}" -a -n "${NETMASK}" ]; then
 		PREFIX=`whatmask ${NETMASK} | grep -e ^CIDR | awk -F': ' '{ print $2 }' | cut -c 2-`
-		args="${args} ${ADDRESS}/${PREFIX} broadcast ${BROADCAST}"
+		args="${args} ${ADDRESS}/${PREFIX}"
 	else
 		boot_mesg "ADDRESS and/or NETMASK variable missing from input, cannot continue." ${FAILURE}
 		echo_failure
diff --git a/src/misc-progs/setaliases.c b/src/misc-progs/setaliases.c
index 93af1cb0a..10ffd438d 100644
--- a/src/misc-progs/setaliases.c
+++ b/src/misc-progs/setaliases.c
@@ -39,7 +39,6 @@ int main(void)
 	char s[STRING_SIZE];
 	char command[STRING_SIZE];
 	char red_netmask[STRING_SIZE];
-	char red_broadcast[STRING_SIZE];
 	char red_dev[STRING_SIZE];
 	char default_gateway[STRING_SIZE];
 	char *aliasip;
@@ -94,7 +93,7 @@ int main(void)
 		exit(0);
 
 	/* Get the RED interface details */
-	if((!findkey(kv, "RED_NETMASK", red_netmask)) || (!findkey(kv, "RED_BROADCAST", red_broadcast)) || 
+	if((!findkey(kv, "RED_NETMASK", red_netmask)) ||
 		(!findkey(kv, "RED_DEV", red_dev)) || (!findkey(kv, "DEFAULT_GATEWAY", default_gateway)))
 	{
 		fprintf(stderr, "Cannot read RED settings\n");
@@ -113,12 +112,6 @@ int main(void)
 		exit(1);
 	}
 
-	if (!VALID_IP(red_broadcast))
-	{
-		fprintf(stderr, "Bad red_broadcast : %s\n", red_broadcast);
-		exit(1);
-	}
-
 	if (!VALID_IP(default_gateway))
 	{
 		fprintf(stderr, "Bad default_gateway : %s\n", default_gateway);
@@ -184,8 +177,8 @@ int main(void)
 
 		memset(command, 0, STRING_SIZE);
 		snprintf(command, STRING_SIZE-1,
-				"/sbin/ifconfig %s:%d %s netmask %s broadcast %s up",
-			     red_dev, alias, aliasip, red_netmask, red_broadcast);
+				"/sbin/ifconfig %s:%d %s netmask %s up",
+			     red_dev, alias, aliasip, red_netmask);
 		safe_system(command);
 		memset(command, 0, STRING_SIZE);
 		snprintf(command, STRING_SIZE-1,
diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c
index 66592bb94..91604de14 100644
--- a/src/setup/netstuff.c
+++ b/src/setup/netstuff.c
@@ -265,28 +265,23 @@ int gettype(char *type)
 	return 0;
 }
 
-/* 0.9.9: calculates broadcast too. */
 int setnetaddress(struct keyvalue *kv, char *colour)
 {
 	char addressfield[STRING_SIZE];
 	char netaddressfield[STRING_SIZE];		
 	char netmaskfield[STRING_SIZE];
-	char broadcastfield[STRING_SIZE];
 	char address[STRING_SIZE];
 	char netmask[STRING_SIZE];
 	unsigned long int intaddress;
 	unsigned long int intnetaddress;
 	unsigned long int intnetmask;
-	unsigned long int intbroadcast;
 	struct in_addr temp;
 	char *netaddress;
-	char *broadcast;
-		
+
 	/* Build some key strings. */
 	sprintf(addressfield, "%s_ADDRESS", colour);
 	sprintf(netaddressfield, "%s_NETADDRESS", colour);
 	sprintf(netmaskfield, "%s_NETMASK", colour);
-	sprintf(broadcastfield, "%s_BROADCAST", colour);
 
 	strcpy(address, ""); findkey(kv, addressfield, address);	
 	strcpy(netmask, ""); findkey(kv, netmaskfield, netmask);		
@@ -301,12 +296,6 @@ int setnetaddress(struct keyvalue *kv, char *colour)
 	
 	replacekeyvalue(kv, netaddressfield, netaddress);
 	
-	intbroadcast = intnetaddress | ~intnetmask;
-	temp.s_addr = intbroadcast;
-	broadcast = inet_ntoa(temp);	
-	
-	replacekeyvalue(kv, broadcastfield, broadcast);
-	
 	return 1;
 }	
 
diff --git a/src/wio/wio.cgi b/src/wio/wio.cgi
index a5d3d149e..d07332e5e 100644
--- a/src/wio/wio.cgi
+++ b/src/wio/wio.cgi
@@ -179,7 +179,9 @@ if ( -e $wiofile ) { goto WIOSCAN; }
 foreach (@devs_color) {
 	if ( $netsettings{"${_}_DEV"} ne '' ) {
 		$wiosettings{"${_}_IPLOW"} = &Network::find_next_ip_address($netsettings{"${_}_NETADDRESS"}, 1);
-		$wiosettings{"${_}_IPHIGH"} = &Network::find_next_ip_address($netsettings{"${_}_BROADCAST"}, -1);
+
+		my $broadcast = &Network::get_broadcast($netsettings{"${_}_NETADDRESS"} . "/" . $netsettings{"${_}_NETMASK"});
+		$wiosettings{"${_}_IPHIGH"} = &Network::find_next_ip_address($broadcast, -1);
 	}
 }
 


hooks/post-receive
--
IPFire 2.x development tree

                 reply	other threads:[~2020-10-07 11:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C5t000nRXz2xSR@people01.haj.ipfire.org \
    --to=git@ipfire.org \
    --cc=ipfire-scm@lists.ipfire.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox