Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: qt multi- and broadcast (was Re: dhcpcd not working in simh-vax with xq0:nat networking)



Uh... If broadcast wasn't working, you'd not have working ARP, more or less. I would expect that people had noticed that a long time ago by now... (There are other protocols also using broadcasts, but ARP is very fundamental, and going on all the time, on any machine using ethernet.)

So, I'm very certain it works correctly on real hardware.

  Johnny

On 2021-12-11 22:21, Mark Pizzolato - Info Comm wrote:
Olaf,

After the network stack is initialized (dhcp client seems to be early in
that process) there have to be other cases where reasonable
expectations of broadcast reception is needed.  A simple case of
ping the host with the QT device from another host on the LAN.
Hopefully that other host is running tcpdump and should be
looking at the ARP response packet to be sure that it was actually
coming from the system with the QT interface...

If broadcast isn't working, then your below suggestion seems to
be right.

- Mark

On Saturday, December 11, 2021 at 12:00 PM, Rhialto wrote:
So, given that NetBSD's if_qt.c doesn't do anything with multicast
(except setting IFF_MULTICAST, which seems to be a lie), I was looking
for the simplest solution. Apart from properly doing multicast, that is.

a) I didn't find a simple "receive broadcasts" bit
b) neither a simple "receive all multicasts" bit
c) so the next best thing seems to be to set the multicast filter wide
open, to all 1s.
d) doing it properly would mean changing the multicast filter after
initialization, which may differ from setting a fixed filter.

Something like the below. I haven't tested it, or even thought out yet
how to test it (maybe I have to break simh again :)...

Index: if_qt.c
==========================================================
=========
RCS file: /cvsroot/src/sys/dev/qbus/if_qt.c,v
retrieving revision 1.25
diff -u -u -5 -r1.25 if_qt.c
--- if_qt.c	29 Jan 2020 05:57:21 -0000	1.25
+++ if_qt.c	11 Dec 2021 19:50:47 -0000
@@ -277,11 +277,11 @@
  	sc->is_addr[4] = QT_RCSR(8);
  	sc->is_addr[5] = QT_RCSR(10);

  	strcpy(ifp->if_xname, device_xname(sc->sc_dev));
  	ifp->if_softc = sc;
-	ifp->if_flags = IFF_BROADCAST|IFF_MULTICAST;
+	ifp->if_flags = IFF_BROADCAST|IFF_ALLMULTI;
  	ifp->if_ioctl = qtioctl;
  	ifp->if_start = qtstart;
  	ifp->if_init = qtinit;
  	ifp->if_stop = qtstop;
  	IFQ_SET_READY(&ifp->if_snd);
@@ -377,10 +377,11 @@
  		memset(sc->sc_ib, 0, sizeof(struct qt_cdata));
  		iniblk = &sc->sc_ib->qc_init;

  		iniblk->vector = sc->vector;
  		memcpy(iniblk->paddr, sc->is_addr, 6);
+		memset(iniblk->laddr, 0xFF, sizeof(iniblk->laddr));

  		iniblk->options = INIT_OPTIONS_INT;
  		iniblk->rx_lo = loint(&sc->sc_pib->qc_r);
  		iniblk->rx_hi = hiint(&sc->sc_pib->qc_r);
  		iniblk->tx_lo = loint(&sc->sc_pib->qc_t);

Does ifp->if_flags indicte a current setting, or a capability?
Can something change it behind our back?

-Olaf.
--
___ "Buying carbon credits is a bit like a serial killer paying someone else to
\X/  have kids to make his activity cost neutral." -The BOFH    falu.nl@rhialto


--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index