public inbox for ipfire-scm@lists.ipfire.org
 help / color / mirror / Atom feed
From: git@ipfire.org
To: ipfire-scm@lists.ipfire.org
Subject: [git.ipfire.org] IPFire 2.x development tree branch, master, updated. cea4fc3aaf3fb9b776a2209ccdaff6452e099f8e
Date: Tue, 29 Jul 2014 12:15:33 +0200	[thread overview]
Message-ID: <20140729101533.3BA7721264@argus.ipfire.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 5324 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, master has been updated
       via  cea4fc3aaf3fb9b776a2209ccdaff6452e099f8e (commit)
       via  8df091d9680ca0230723fc62b56c9e1d29acb481 (commit)
       via  bc70c8273792c3cbe41edca1a90f62b4ff0666a1 (commit)
      from  5b861b054576b43e5564289ca08875ee28859cbf (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 cea4fc3aaf3fb9b776a2209ccdaff6452e099f8e
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Tue Jul 29 12:14:23 2014 +0200

    Revert "General-functions.pl: rewrite IpInSubnet replace inet_ntoa"
    
    This reverts commit ab92dc0c84cc6c11f90e753439567d80bac23e2b.
    
    See comment in last commit

commit 8df091d9680ca0230723fc62b56c9e1d29acb481
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Tue Jul 29 12:12:38 2014 +0200

    Revert "General-functions.pl: rewrite getnetworkip without inet_aton"
    
    This reverts commit 1be398ae381d4d0cdbd50272bff4434121d36f65.
    
    Some users reported some issues with the generated firewall ruleset
    with the new function:
      http://forum.ipfire.org/index.php?topic=11124.0

commit bc70c8273792c3cbe41edca1a90f62b4ff0666a1
Author: Michael Tremer <michael.tremer(a)ipfire.org>
Date:   Tue Jul 29 12:07:02 2014 +0200

    rngd: Silence initscript when rngd is already started.
    
    When a hardware random number generator is found by udev
    it will start rngd automatically which is what we also do
    by default in the initialisation sequence of the system
    (e.g. for RDRAND).
    The user will then see an error message that rngd has
    already been started which was confusing.

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

Summary of changes:
 config/cfgroot/general-functions.pl      | 27 +++++++++------------------
 config/rootfiles/core/80/filelists/files |  1 +
 src/initscripts/init.d/rngd              | 10 ++++++++--
 3 files changed, 18 insertions(+), 20 deletions(-)

Difference in files:
diff --git a/config/cfgroot/general-functions.pl b/config/cfgroot/general-functions.pl
index 6994f33..dbac0d7 100644
--- a/config/cfgroot/general-functions.pl
+++ b/config/cfgroot/general-functions.pl
@@ -413,9 +413,9 @@ sub getnetworkip
 	#Gets:  IP, CIDR    (10.10.10.0-255, 24)
 	#Gives:  10.10.10.0
 	my ($ccdip,$ccdsubnet) = @_;
-	my $ip_address_binary = &Socket::inet_pton( AF_INET,$ccdip );
-	my $netmask_binary = &Socket::inet_pton(AF_INET,&iporsubtodec($ccdsubnet));
-	my $network_address    = &Socket::inet_ntop( AF_INET,$ip_address_binary & $netmask_binary );
+	my $ip_address_binary = inet_aton( $ccdip );
+	my $netmask_binary    = ~pack("N", (2**(32-$ccdsubnet))-1);
+	my $network_address    = inet_ntoa( $ip_address_binary & $netmask_binary );
 	return $network_address;
 }
 
@@ -773,21 +773,12 @@ sub validportrange # used to check a port range
 # Return: TRUE/FALSE
 sub IpInSubnet
 {
-	my $addr = shift;
-	my $network = shift;
-	my $netmask = shift;
-
-	my $addr_num = &Socket::inet_pton(AF_INET,$addr);
-	my $network_num = &Socket::inet_pton(AF_INET,$network);
-	my $netmask_num = &Socket::inet_pton(AF_INET,$netmask);
-
-	# Find start address
-	my $network_start = $network_num & $netmask_num;
-
-	# Find end address
-	my $network_end = $network_start ^ ~$netmask_num;
-
-	return (($addr_num ge $network_start) && ($addr_num le $network_end));
+    my $ip = unpack('N', &Socket::inet_aton(shift));
+    my $start = unpack('N', &Socket::inet_aton(shift));
+    my $mask  = unpack('N', &Socket::inet_aton(shift));
+       $start &= $mask;  # base of subnet...
+    my $end   = $start + ~$mask;
+    return (($ip >= $start) && ($ip <= $end));
 }
 
 #
diff --git a/config/rootfiles/core/80/filelists/files b/config/rootfiles/core/80/filelists/files
index 5f4c42c..a12048d 100644
--- a/config/rootfiles/core/80/filelists/files
+++ b/config/rootfiles/core/80/filelists/files
@@ -6,6 +6,7 @@ etc/rc.d/init.d/dhcrelay
 etc/rc.d/init.d/dnsmasq
 etc/rc.d/init.d/firewall
 etc/rc.d/init.d/networking/red.up/30-ddns
+etc/rc.d/init.d/rngd
 srv/web/ipfire/cgi-bin/ddns.cgi
 srv/web/ipfire/cgi-bin/logs.cgi/firewalllogcountry.dat
 srv/web/ipfire/cgi-bin/logs.cgi/log.dat
diff --git a/src/initscripts/init.d/rngd b/src/initscripts/init.d/rngd
index 22437fd..df4aa7d 100644
--- a/src/initscripts/init.d/rngd
+++ b/src/initscripts/init.d/rngd
@@ -28,12 +28,18 @@ case "${1}" in
 		fi
 
 		boot_mesg "Starting Random Number Generator Daemon..."
-		loadproc /usr/sbin/rngd --no-tpm=1
+
+		if pidofproc /usr/sbin/rngd &>/dev/null; then
+			# Is already running.
+			echo_ok
+		else
+			loadproc /usr/sbin/rngd --no-tpm=1
+		fi
 		;;
 
 	stop)
 		boot_mesg "Stopping Random Number Generator Daemon..."
-		killproc /usr/sbin/rngd
+		killproc -p /var/run/rngd.pid /usr/sbin/rngd
 		;;
 
 	restart)


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

                 reply	other threads:[~2014-07-29 10:15 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=20140729101533.3BA7721264@argus.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