Problems and solution with TAP networking on Solaris
Hi,
i'm using Qemu 0.9.1 on Solaris 10 64bit (0805 edition) SPARC, qemu 32 bit compiled. It works well, but tap networking initiates tapX interface in a strange way (device is running, but has not UP flag and cannot be brought up using ifconfig). For TAP i'm using latest driver from whiteboard.ne.jp.
I have modified vl.c code (exactly the same part of code is innet.c in current svn version) in function tap_alloc so it is reduced only to opening /dev/tap and allocating new PPA. After it i use "ifconfig tapX plumb", "ifconfig tapX ip netmask up" and all works well. See attached patch - maybe will be useful for somebody.
With best regards,
Pavel Dufek, Czech Republic.
vl.c renamed from vl.c.original +6 -0
@@ -3966,11 +3966,15 @@if ( ip_fd )close (ip_fd); +/* Pavel Dufek - block out all other Solaris tun/tap code; only basic open and +PPA assign left active */ +#ifdef NEVERDEF TFR (ip_fd =open ("/dev/udp" ,O_RDWR ,0 ));if (ip_fd <0 ) {syslog (LOG_ERR ,"Can't open /dev/ip (actually /dev/udp)" );return -1 ; } +#endif /* NEVERDEF */ TFR (tap_fd =open ("/dev/tap" ,O_RDWR ,0 ));if (tap_fd <0 ) {
@@ -3986,6 +3990,7 @@if ((ppa =ioctl (tap_fd,I_STR , &strioc_ppa)) <0 )syslog (LOG_ERR ,"Can't assign new interface" ); +#ifdef NEVERDEF TFR (if_fd =open ("/dev/tap" ,O_RDWR ,0 ));if (if_fd <0 ) {syslog (LOG_ERR ,"Can't open /dev/tap (2)" );
@@ -4053,6 +4058,7 @@ioctl (ip_fd,I_PUNLINK , ip_muxid); syslog (LOG_ERR, "Can't set multiplexor id"); } +#endif /* NEVERDEF */ sprintf (dev,"tap%d" , ppa);return tap_fd;