--- nono/host/netdriver_tap.cpp 2026/04/29 17:05:21 1.1.1.7 +++ nono/host/netdriver_tap.cpp 2026/04/29 17:06:02 1.1.1.9 @@ -40,7 +40,7 @@ // コンストラクタ NetDriverTap::NetDriverTap(HostDevice *hostdev_, const std::string& devpath_) - : inherited(hostdev_, "Tap") + : inherited(hostdev_, "tap") { devpath = devpath_; if (devpath.empty()) { @@ -56,7 +56,7 @@ NetDriverTap::~NetDriverTap() // ドライバ初期化 bool -NetDriverTap::InitDriver() +NetDriverTap::InitDriver(bool startup) { bool r; @@ -314,7 +314,7 @@ NetDriverTap::Close() // モニタ (ドライバ依存情報のみ) void -NetDriverTap::MonitorUpdateMD(TextScreen& screen, int y) +NetDriverTap::MonitorScreenMD(TextScreen& screen, int y) { screen.Print(0, y++, "Device : %s", devpath.c_str()); screen.Print(0, y++, "Interface: %s", ifname.c_str()); @@ -328,11 +328,11 @@ NetDriverTap::Write(const void *buf, int n = write(fd, buf, buflen); if (n < 0) { - putmsg(0, "write: %s", strerror(errno)); + putmsg(0, "write(%d): %s", buflen, strerror(errno)); return; } if (n < buflen) { - putmsg(0, "write: short"); + putmsg(0, "write(%d): short(%zd)", buflen, n); return; } } @@ -341,13 +341,14 @@ NetDriverTap::Write(const void *buf, int int NetDriverTap::Read(NetPacket *p) { + uint8 buf[1600]; int n; - n = read(fd, p->data(), p->size()); + n = read(fd, buf, sizeof(buf)); if (n < 0) { putmsg(0, "read: %s", strerror(errno)); return NODATA; } - p->length = n; + p->Assign(buf, n); return 0; }