Skip to contentSkip to conversation

DOSEMU does not pick up all packets

DISCUSSION Stas Sergeev 2 participants 2 messages Nov 28, 2002

lore
Share & tools
lore
#0 lore raw

Hello.

Quoted 2 lines · Stian Sletner

I experimented some more with this, since it seemed to be the right
thing to do, the dosnet stuff is IP oriented after all, and shouldn't be necessary to achieve this, I would think.

Dosnet have nothing to do with IP. It's goal is to emulate an Ethernet network on a single machine.
This is accomplished by:
1. Assigning an unique MAC address (fake) to each dosemu session (done in libpacket.c);
2. Ensuring that each dosemu receives only the packets directed to it, and the broadcast ones. (done in dosnet module). This is achieved by manipulating the "protocol" field of skb, and your patch breaks this.

Quoted 2 lines

There's no end to what one
can achieve with an all-nighter of source hacking, eh?

I think you'd better spent some efforts to rethink your needs:) as what you are doing, seems out of curiosity (to me at least).

Quoted 3 lines

After tons of
experimenting and code-writing (and Coke drinking), it boiled down to a one-line change (of course :) to get it working.

To get working what? If you want to put the packets to the interface and pick them back immediately, then why not just use a loopback lo interface (for example)?

Quoted 1 line

Here's the patch.

You could probably achieve the same with just ETH_P_LOOP instead of ETH_P_ALL.

Quoted 1 line

I'd like to know if this could be applied or if that'd break something else?

It breaks everything.
It breaks dosnet for already described reason (all dosemus will receive all the packets, and not only the ones directed to them).
It breaks also a packet driver, as the DOS software will now receive every ethernet frames, even if it requested a particular type.

Well, before anything else, please just explain (to yourself and to me:) what do you *actually* need?
How something can work correctly, if you use an interface the way it is not intended to be used?
What is a dest. address of the frames you are going to pick up? If the dest. address doesn't match the addr. of the interface you are picking it from (and the dest is not a broadcast), then you are already doing something wrong.
From what I have currently, it seems to me that you have to think again about a dosnet (reverting your patch at first of course, otherwise don't think about dosnet anymore:), because dosnet was specially designed for the tricks like that and it's functionality is very close to TAP interface (maybe one day I'll make dosemu to use TAP so that we throw dosnet away).

I don't have an internet connection from my LAN now because the admins changed the net mask on their routers from 255.255.255.0 to 255.255.0.0 in order to "make all the subnets visible to each other", but actually they got a clash of an IP ranges on every router's interfaces, so whenever my station sends an ARP request with my IP, the router answers with it's own MAC, because it thinks this IP exists in another subnet.
This incident definitely have some similarities with your patch:)
[OK, gone to duel with admins:) ]

#1 lore raw

* At 2002-11-29T00:06+0300, Stas Sergeev wrote:
| Well, before anything else, please just explain (to yourself and to | me:) what do you *actually* need?

Stas, thanks for answering, I'm sorry if I sound confused, because I'm not actually very much so. :) Let me try to explain in examples.

I have a Linux box and a DOS box on my LAN. Using DOSEMU's packet driver I'm able to link them up with IPX in Doom. That's great.

Now, if I want to link with someone else over the Internet, I can use an IPX bridge/tunnel to connect to a remote LAN from my Linux box. Doing this, I can link my DOS box with the other side in Doom and play over the net.

However, I can _not_ link my Linux box running DOSEMU to the other side, as long as the IPX tunnel runs on the same box. The incoming IPX packets _are_ to broadcast address, but DOSEMU does not pick them up because (I assume) they originate from the same interface, eth0. I cannot use the loopback interface for this, as that wouldn't enable me to link to both the DOS box and the other side of the tunnel at once. Using my hack, DOSEMU picks up the tunneled packets, and is able to link to both the other side and my local DOS box.

It seems to me that DOSEMU _should_ be able to pick up these packets, since, again, they're aimed to broadcast (all Doom IPX traffic is, AFAIK).

Any clearer?

Signature · 1 line
Stian Sletner