[prev in list] [next in list] [prev in thread] [next in thread] 

List:       haiku-development
Subject:    [haiku-development] Re: Creating the TUN Interface
From:       pulkomandy () pulkomandy ! tk
Date:       2023-05-12 6:39:58
Message-ID: e73b93f1382ed91f8cf5043426fba4661e411dee () pulkomandy ! tk
[Download RAW message or body]

12 mai 2023 à 03:47 "Swan Geon" <swangeon@gmail.com> a écrit:

> 
> Sorry for the late response. After looking at \
> https://cgit.haiku-os.org/haiku/tree/src/add-ons/kernel/network/datalink_protocols/loopback_frame/loopback_frame.cpp#n51 \
> and after adding a dprinf, I was able to determine that it wants a type loopback \
> but even after changing the if statement to:  "if (interface->device->type != \
> IFT_TUN)" Note: This will be restored later I was able to create an interface tun0, \
> get it up with an ip address, and ping to it but I cannot ping with it as it would \
> just say it was a bad interface (). Luckily it was using tun.cpp. I added some \
> dprintf calls to tun.cpp's init & send function but those were apparently fine. Now \
> when I created the interface using "ifconfig tun netmask 255.255.255.0" it did a \
> kernel panic and this is the output: 
> I am wondering at this point if I should just start making my own frame for TUN at \
> this point and take from the loopback_frame? 

Well, you have to make a decision: maybe you can reuse the loopback frame for your \
driver. In that case, it could register itself as a "loopback" interface type instead \
of adding a new IFT_TUN, and the loopback datalink protocol could be used. Is this \
protocol carrying sufficient info for what you need to do with it? If not, then a new \
datalink_protocol will be needed. Or maybe the ethernet one can be used.

In any case, there should not be a panic in this situation, so it seems a good idea \
to fix that anyways.

-- 
Adrien.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic