[prev in list] [next in list] [prev in thread] [next in thread] 

List:       user-mode-linux-devel
Subject:    [uml-devel] [PATCH] uml_switch bug
From:       Steve Bennett <steveb () snapgear ! com>
Date:       2003-07-21 22:44:25
[Download RAW message or body]

This is a small patch to fix a bug in uml_switch where
specifying "-unix <args>" on the command line would cause any
subsequent arguments to be ignored.

-- 
Steve Bennett                 http://www.SnapGear.com/
steveb@snapgear.com           Custom Embedded Solutions + Security

["uml_switch_arg_error.diff" (text/plain)]

diff  -u tools/uml_router/uml_switch.c
--- tools/uml_router/uml_switch.c.orig
+++ tools/uml_router/uml_switch.c	2003-07-22 08:27:17.000000000 +1000
@@ -408,14 +408,16 @@
       ctl_socket = argv[1];
       argc -= 2;
       argv += 2;
-      if(!compat_v0) break;
-      if(argc < 1) Usage();
-      data_socket = argv[0];
-      argc--;
-      argv++;
+      if(compat_v0) {
+	if(argc < 1) Usage();
+	data_socket = argv[0];
+	argc--;
+	argv++;
+      }
     }
-    if(!strcmp(argv[0], "-tap")){
+    else if(!strcmp(argv[0], "-tap")){
 #ifdef TUNTAP
+      if(argc < 2) Usage();
       tap_dev = argv[1];
       argv += 2;
       argc -= 2;
@@ -480,9 +482,16 @@
   hash_init();
 
   if(compat_v0) 
-    printf("%s attached to unix sockets '%s' and '%s'\n", prog, ctl_socket,
+    printf("%s attached to unix sockets '%s' and '%s'", prog, ctl_socket,
 	   data_socket);
-  else printf("%s attached to unix socket '%s'\n", prog, ctl_socket);
+  else printf("%s attached to unix socket '%s'", prog, ctl_socket);
+
+#ifdef TUNTAP
+  if(tap_dev != NULL) {
+    printf(" tap device '%s'", tap_dev);
+  }
+#endif
+  printf("\n");
 
   if(isatty(0))
     add_fd(0);

-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic