From 3baaf6c028a0b0d9ae6721d0d039b78c31797d9f Mon Sep 17 00:00:00 2001 From: Lars Brinkhoff Date: Mon, 18 Oct 2021 14:25:59 +0200 Subject: [PATCH] H316: Fix host interface word counts. The host interface uses the UDP packet format from the modem interface, with an additional flags word. Ensure the flags are not included in the word count. --- H316/h316_hi.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/H316/h316_hi.c b/H316/h316_hi.c index f61eeace..152eca29 100644 --- a/H316/h316_hi.c +++ b/H316/h316_hi.c @@ -344,7 +344,7 @@ void hi_start_tx (uint16 line, uint16 flags) tmp [0] = flags; for (i = 0; i < count; i ++) tmp [i + 1] = M [next+i]; - ret = udp_send(PDEVICE(line), PHIDB(line)->link, tmp, count); + ret = udp_send(PDEVICE(line), PHIDB(line)->link, tmp, count + 1); free (tmp); if (ret != SCPE_OK && ret != 66) hi_link_error(line); } @@ -438,6 +438,9 @@ void hi_poll_rx (uint16 line) return; } + // Exclude the flags from the count. + count--; + // We really got a packet! Update the DMC pointers to reflect the actual // size of the packet received. If the packet length would have exceeded the // receiver buffer, then that sets the error flag too.