pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: pkg/42471: qemu tap device bug



The following reply was made to PR pkg/42471; it has been noted by GNATS.

From: Victor Dorneanu <victor%dornea.nu@localhost>
To: gnats-bugs%gnats.netbsd.org@localhost
Cc: Aleksey Cheusov <cheusov%tut.by@localhost>
Subject: Re: pkg/42471: qemu tap device bug
Date: Sat, 19 Dec 2009 21:04:32 +0100

 This is a multi-part message in MIME format.
 --------------080308050209020506010201
 Content-Type: text/plain; charset=ISO-8859-1
 Content-Transfer-Encoding: 7bit
 
 Aleksey Cheusov wrote:
 >> There you go.
 >>     
 >
 > Please resend your patch tp gnats-lalala@
 > I'm not commiter.
 >   
 
 Patch is attached.
 
 -- 
 Victor Dorneanu
 
 
 --------------080308050209020506010201
 Content-Type: text/plain;
  name="patch.diff"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="patch.diff"
 
 --- net.c.orig 2009-12-18 18:24:20.000000000 +0100
 +++ net.c      2009-12-19 10:52:16.000000000 +0100
 @@ -116,7 +116,7 @@
  #include "sysemu.h"
  #include "qemu-timer.h"
  #include "qemu-char.h"
 -#include "audio/audio.h"
 +#include "audio/qaudio.h"
  #include "qemu_socket.h"
  #include "qemu-log.h"
  
 @@ -1461,11 +1461,27 @@
  {
      int fd;
      char *dev;
 +    char tap_dev[1024];
      struct stat s;
  
 -    TFR(fd = open("/dev/tap", O_RDWR));
 +#if defined (__NetBSD__)
 +    // Concatenate dev path (/dev/) and tap device name (e.g. tap0)
 +    if (strlcpy(tap_dev, "/dev/", sizeof(tap_dev)) >= sizeof(tap_dev)) {
 +        fprintf(stderr, "error: tap device name too long\n");
 +        return -1;
 +    }
 +
 +    if (strlcat(tap_dev, ifname, sizeof(tap_dev)) >= sizeof(tap_dev)) {
 +        fprintf(stderr, "error: tap device name too long\n");
 +        return -1;
 +    }
 +#else
 +    strcpy(tap_dev, "/dev/tap");
 +#endif
 +    TFR(fd = open(tap_dev, O_RDWR));
 +
      if (fd < 0) {
 -        fprintf(stderr, "warning: could not open /dev/tap: no virtual network 
emulation\n");
 +        fprintf(stderr, "warning: could not open %s: no virtual network 
emulation\n",tap_dev);
          return -1;
      }
  
 
 --------------080308050209020506010201--
 


Home | Main Index | Thread Index | Old Index