I've been working on my packet server a lot lately.
Now, with the latest commits, it allows for the network mask of the host and the network mask of the clients (which can be different to provide a different subnet) to be patching the IPv4 packets onto the host network for the broadcast addresses as well (so with a host 123.456.789.200 (running the server) with netmask 255.255.255.0 and the client at 123.456.789.128 (netmask 255.255.255.192) with 62 available IP addresses (up to .191), it can now patch the IPv4 packets sent from the client (to 123.456.789.191) to be sent to the host network on 123.456.789.255. Of course, receiving from .255 on the host network is then patched back to the client network (at .191) when receiving said packets (or any of those broadcast subnet IP packets on the host network by other machines outside of UniPCemu).
So that should theoretically allow for the host network to be able to broadcast (ofc including the 255.255.255.255 address, which remains sent unchanged to the client network, as it's defined in IPv4 specs) based on both the subnet mask of either network (host network sending using the host subnet and client sending on the client subnet) and it'll be heard by all machines with the host and client network masks!
So that should, theoretically at least, allow SMB and other protocols requiring the subnet-based broadcast address to work accross the client and host networks.
That's of course assuming there's not anything else going wrong with SMB.
I've noticed myself that although I see SMB and "net diag" in Windows 95 OSR 2.5 sending to the broadcast addresses (which according to my testing should be received by all devices on the host and client networks):
- net diag as host on the first machine can't connect to net diag as host on the second machine (both connected to UniPCemu).
- The reverse does work (the first client hosting can be talked to with "net diag" on the second machine)?
- Both using SMB can't reach each other's shares?
- Pinging each other and reaching the default gateway for the internet (as well as pinging other devices on the host network) seems to work fine.
Anyone knows if I'm missing something that's still required to get SMB and "net diag" to work?
Edit: Removed the routing of the broadcast IP packets to the host network and vise versa. It shouldn't be done, apparently(the code is just commented out though). Also filtered out those broadcast IPv4 packets on the host receiver (client network receiver still passes them, from it's own clients, through to it's own network.
Subnet mask is now also applied on receiving, with 255.255.255.255 broadcast IP being filtered based on subnet mask, client IP address(for detecting destination network) and source address(for detecting destination network it's to be delivered to)).