From 163c6be18dfdfe334ab0cdf6f1c8e1c944a5aa5f Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Sun, 16 Feb 2003 19:35:57 +0000 Subject: [PATCH] - fixed some warnings in the lowlevel networking code --- bochs/iodev/eth_linux.cc | 11 ++++++----- bochs/iodev/eth_tap.cc | 4 ++-- bochs/iodev/eth_tuntap.cc | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/bochs/iodev/eth_linux.cc b/bochs/iodev/eth_linux.cc index a1163db98..2201fa072 100644 --- a/bochs/iodev/eth_linux.cc +++ b/bochs/iodev/eth_linux.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: eth_linux.cc,v 1.13 2002-11-20 19:06:23 bdenney Exp $ +// $Id: eth_linux.cc,v 1.14 2003-02-16 19:35:57 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -236,10 +236,11 @@ bx_linux_pktmover_c::sendpkt(void *buf, unsigned io_len) { int status; - if (this->fd != -1) + if (this->fd != -1) { status = write(this->fd, buf, io_len); - if (status == -1) - BX_INFO(("eth_linux: write failed: %s", strerror(errno))); + if (status == -1) + BX_INFO(("eth_linux: write failed: %s", strerror(errno))); + } } // The receive poll process @@ -258,7 +259,7 @@ bx_linux_pktmover_c::rx_timer(void) Bit8u rxbuf[BX_PACKET_BUFSIZ]; struct sockaddr_ll sll; socklen_t fromlen; - static unsigned char bcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff}; +//static unsigned char bcast_addr[6] = {0xff,0xff,0xff,0xff,0xff,0xff}; if (this->fd == -1) return; diff --git a/bochs/iodev/eth_tap.cc b/bochs/iodev/eth_tap.cc index c1c89cf1e..6ac050e59 100644 --- a/bochs/iodev/eth_tap.cc +++ b/bochs/iodev/eth_tap.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: eth_tap.cc,v 1.11 2002-11-20 19:06:23 bdenney Exp $ +// $Id: eth_tap.cc,v 1.12 2003-02-16 19:35:57 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -266,7 +266,7 @@ bx_tap_pktmover_c::sendpkt(void *buf, unsigned io_len) // dump packet in hex into an ascii log file fprintf (txlog_txt, "NE2K transmitting a packet, length %u\n", io_len); Bit8u *charbuf = (Bit8u *)buf; - for (n=0; n0) fprintf (txlog_txt, "\n"); fprintf (txlog_txt, "%02x ", charbuf[n]); diff --git a/bochs/iodev/eth_tuntap.cc b/bochs/iodev/eth_tuntap.cc index c1d4c200f..e91980703 100644 --- a/bochs/iodev/eth_tuntap.cc +++ b/bochs/iodev/eth_tuntap.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: eth_tuntap.cc,v 1.7 2002-11-20 19:06:23 bdenney Exp $ +// $Id: eth_tuntap.cc,v 1.8 2003-02-16 19:35:57 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // Copyright (C) 2001 MandrakeSoft S.A. @@ -160,11 +160,11 @@ bx_tuntap_pktmover_c::bx_tuntap_pktmover_c(const char *netif, void *rxarg) { int flags; - char filename[BX_PATHNAME_LEN]; if (strncmp (netif, "tun", 3) != 0) { BX_PANIC (("eth_tuntap: interface name (%s) must be tun", netif)); } #ifdef NEVERDEF + char filename[BX_PATHNAME_LEN]; sprintf (filename, "/dev/net/%s", netif); // check if the TUN/TAP devices is running, and turn on ARP. This is based