diff -urN wireless_tools.27.orig/ifrename.8 wireless_tools.27/ifrename.8
--- wireless_tools.27.orig/ifrename.8	2004-04-27 01:58:19 +0300
+++ wireless_tools.27/ifrename.8	2004-08-25 00:42:35 +0300
@@ -108,6 +108,10 @@
 In any case, name swapping and the use of this feature is discouraged,
 and you are invited to choose unique and unambiguous names for your
 interfaces...
+.TP
+.B -f
+"dry run". ifrename will only print new interface name, if applicable,
+and return.
 .\"
 .\" AUTHOR part
 .\"
diff -urN wireless_tools.27.orig/ifrename.c wireless_tools.27/ifrename.c
--- wireless_tools.27.orig/ifrename.c	2004-08-25 00:22:22 +0300
+++ wireless_tools.27/ifrename.c	2004-08-25 00:39:13 +0300
@@ -20,6 +20,7 @@
  * Subject to the Gnu Public License, version 2.  
  * TODO: make it support token ring etc.
  * $Id: nameif.c,v 1.3 2003/03/06 23:26:52 ecki Exp $
+ * Add dryrun option : ifname -f. Pilot - 24.08.04
  * Add hotplug compatibility : ifname -i eth0. Jean II - 03.12.03
  * Add MAC address wildcard : 01:23:45:*. Jean II - 03.12.03
  * Add interface name wildcard : wlan*. Jean II - 03.12.03
@@ -93,6 +94,7 @@
   {"debian", 0, NULL, 'd' },
   {"interface", 1, NULL, 'i' },
   {"newname", 1, NULL, 'n' },
+  {"dryrun", 0, NULL, 'f' },
   {"help", 0, NULL, '?' },
   {NULL, 0, NULL, '\0' }, 
 };
@@ -293,6 +295,7 @@
 /* Takeover support */
 int	force_takeover = 0;	/* Takeover name from other interface */
 int	num_takeover = 0;	/* Number of takeover done */
+int	dry_run = 0;            /* Just print new name, don't rename */
 
 /******************** INTERFACE NAME MANAGEMENT ********************/
 /*
@@ -1606,6 +1609,12 @@
   if(mapping == NULL)
     return(-1);
 
+  if(dry_run)
+    {
+      printf("%s\n", mapping->ifname);
+      return(0);
+    }
+
   /* Change the name of the interface */
   if(if_set_name(skfd, target->ifname, mapping->ifname, retname) < 0)
     {
@@ -1666,7 +1675,7 @@
 static void
 usage(void)
 {
-  fprintf(stderr, "usage: nameif [-c configurationfile] [-i ifname] [-p] [-t] [-d]\n");
+  fprintf(stderr, "usage: nameif [-c configurationfile] [-i ifname] [-p] [-t] [-d] [-f]\n");
   exit(1); 
 }
 
@@ -1689,7 +1698,7 @@
   /* Loop over all command line options */
   while(1)
     {
-      int c = getopt_long(argc, argv, "c:di:n:pt", long_opt, NULL);
+      int c = getopt_long(argc, argv, "c:di:n:ptf", long_opt, NULL);
       if(c == -1)
 	break;
 
@@ -1716,6 +1725,9 @@
 	case 't':
 	  force_takeover = 1;
 	  break;
+	case 'f':
+	  dry_run = 1;
+	  break;
 	}
     }
 
