Package: fping
Version: 2.4b2-to-ipv6-14
Severity: minor
Tags: patch

This is a trivial patch to allow fping to bind to a specific interface
in the same way that regular ping does so, with the -I flag.  This
also fixes some typos.

Thanks.
Only in fping-2.4b2-to-ipv6.new/: autom4te.cache
diff -ur fping-2.4b2-to-ipv6/debian/changelog fping-2.4b2-to-ipv6.new/debian/changelog
--- fping-2.4b2-to-ipv6/debian/changelog	2007-08-21 08:59:30.000000000 -0700
+++ fping-2.4b2-to-ipv6.new/debian/changelog	2007-08-21 08:44:18.000000000 -0700
@@ -23,7 +23,7 @@
 
 fping (2.4b2-to-ipv6-11) unstable; urgency=low
 
-  * Fixed "would be usefull to specify 'source address' like ping for multi
+  * Fixed "would be useful to specify 'source address' like ping for multi
     homed machines", closes: #198486.
     Patch by Marc Haber <[EMAIL PROTECTED]>.
 
diff -ur fping-2.4b2-to-ipv6/fping.c fping-2.4b2-to-ipv6.new/fping.c
--- fping-2.4b2-to-ipv6/fping.c	2007-08-21 08:59:30.000000000 -0700
+++ fping-2.4b2-to-ipv6.new/fping.c	2007-08-21 08:55:20.000000000 -0700
@@ -448,7 +448,7 @@
 
 #ifdef IPV6
 	/*
-	 * let the kerel pass extension headers of incoming packets,
+	 * let the kernel pass extension headers of incoming packets,
 	 * for privileged socket options
 	 */
 #ifdef IPV6_RECVHOPOPTS
@@ -529,7 +529,7 @@
 
 	/* get command line options */
 
-	while( ( c = getopt( argc, argv, "gedhlmnqusaAvz:t:i:p:f:r:c:b:C:Q:B:S:" ) ) != EOF )
+	while( ( c = getopt( argc, argv, "gedhlmnqusaAvz:t:i:p:f:r:c:b:C:Q:B:S:I:" ) ) != EOF )
 	{
 		switch( c )
 		{
@@ -687,6 +687,12 @@
 			src_addr_present = 1;
 			break;
 
+		case 'I':
+		        if (setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, optarg,
+		                   strlen(optarg)))
+			        err(1, "setsockopt(AF_INET, SO_BINDTODEVICE)");
+		        break;
+
 		default:
 			usage();
 			break;

Reply via email to