SOURCES: p0f.init - use ip to overcome ifconfig limitation of not ...

glen glen at pld-linux.org
Sun Jan 15 17:47:48 CET 2006


Author: glen                         Date: Sun Jan 15 16:47:48 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- use ip to overcome ifconfig limitation of not seeing non-primary addresses

---- Files affected:
SOURCES:
   p0f.init (1.10 -> 1.11) 

---- Diffs:

================================================================
Index: SOURCES/p0f.init
diff -u SOURCES/p0f.init:1.10 SOURCES/p0f.init:1.11
--- SOURCES/p0f.init:1.10	Mon Apr  4 15:33:38 2005
+++ SOURCES/p0f.init	Sun Jan 15 17:47:43 2006
@@ -27,8 +27,8 @@
 	# Check if the service is already running?
 	if [ ! -f /var/lock/subsys/p0f ]; then
 		msg_starting "p0f"
-		# The command in backticks returns primary IP addresses on this machine
-		for OneIP in `/sbin/ifconfig 2>/dev/null | grep 'inet addr' | sed -e 's/.*addr://' -e 's/ .*//'` ; do
+		# The command in backticks returns all the local IP addresses on this machine.
+		for OneIP in `/sbin/ip -f inet addr show | awk '/inet/{print $2}' | awk -F/ '{print $1}' | LC_ALL=C sort -u`; do
 			if [ -z "$BpfFilter" ]; then
 				BpfFilter="not src host $OneIP"
 			else
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/p0f.init?r1=1.10&r2=1.11&f=u



More information about the pld-cvs-commit mailing list