From: Volker R. <vru...@us...> - 2005-05-21 07:38:37
|
Update of /cvsroot/bochs/bochs/iodev In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28750/iodev Modified Files: eth_tuntap.cc Log Message: - fixed tuntap incompatibility with Linux kernels 2.6.x (SF patch #1203305) - improved debug message for the received packet Index: eth_tuntap.cc =================================================================== RCS file: /cvsroot/bochs/bochs/iodev/eth_tuntap.cc,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- eth_tuntap.cc 24 Apr 2005 11:06:49 -0000 1.20 +++ eth_tuntap.cc 21 May 2005 07:38:29 -0000 1.21 @@ -347,7 +347,7 @@ fflush (rxlog_txt); } #endif - BX_DEBUG(("eth_tuntap: got packet: %d bytes, dst=%x:%x:%x:%x:%x:%x, src=%x:%x:%x:%x:%x:%x\n", nbytes, rxbuf[0], rxbuf[1], rxbuf[2], rxbuf[3], rxbuf[4], rxbuf[5], rxbuf[6], rxbuf[7], rxbuf[8], rxbuf[9], rxbuf[10], rxbuf[11])); + BX_DEBUG(("eth_tuntap: got packet: %d bytes, dst=%02x:%02x:%02x:%02x:%02x:%02x, src=%02x:%02x:%02x:%02x:%02x:%02x", nbytes, rxbuf[0], rxbuf[1], rxbuf[2], rxbuf[3], rxbuf[4], rxbuf[5], rxbuf[6], rxbuf[7], rxbuf[8], rxbuf[9], rxbuf[10], rxbuf[11])); if (nbytes < 60) { BX_INFO (("packet too short (%d), padding to 60", nbytes)); nbytes = 60; @@ -372,12 +372,13 @@ * IFF_NO_PI - Do not provide packet information */ ifr.ifr_flags = IFF_TAP | IFF_NO_PI; - if (*dev) - strncpy(ifr.ifr_name, dev, IFNAMSIZ); + ifr.ifr_name[0]=0; if ((err = ioctl(fd, TUNSETIFF, (void *) &ifr)) < 0) { close(fd); return err; } + strncpy(dev, ifr.ifr_name, IFNAMSIZ); + dev[IFNAMSIZ-1]=0; ioctl( fd, TUNSETNOCSUM, 1 ); #endif |