#18673 closed bug (fixed)

Clean up TUN subsystem

Reported by: waddlesplash Owned by: waddlesplash
Priority: normal Milestone: R1/beta5
Component: Network & Internet/Tunnel Version: R1/beta4
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

The new TUN subsystem has a number of things that should be fixed.

  1. TAP-related code.

Does this actually work? (It doesn't look like it.) FreeBSD does have a unified TUN/TAP driver in their kernel, but there's a lot of TAP-related branching that we do not have. It may make more sense to remove a lot of this (as it doesn't appear to be correct anyway) until/when we actually implement TAP support.

  1. Separate driver interface.

There's a lot of places where the network device module reads/writes into the driver interface or otherwise interacts with it across a FD boundary. This should be done away with, and the published device in devfs managed directly from the network device module. This should simplify a lot of code.

  1. Proper path placement.

Reading FreeBSD's manual page, TUN interfaces behave like any other network interface (can be used with ifconfig, etc.) We thus shouldn't have /dev/tun0, but rather /dev/net/tun/0 etc. (As TUN interfaces are created on-demand, there won't be a /dev/net/tun directory at all unless one is created.)

Attachments (3)

0001-Haiku-Introduce-basic-platform-support.patch (3.9 KB ) - added by kallisti5 12 months ago.
openvpn patches
0001-tun-adjust-tun-device-name-to-dev-net-tun-0.patch (2.5 KB ) - added by kallisti5 12 months ago.
haiku patches i was playing with, likely less useful
openvpn.png (1.8 MB ) - added by kallisti5 12 months ago.
stuff unhappy after these patches lol

Download all attachments as: .zip

Change History (7)

comment:1 by waddlesplash, 12 months ago

Owner: changed from pairisto to waddlesplash
Status: newassigned

Reassigning to myself. I guess I will take a look at these things next week.

comment:2 by kallisti5, 12 months ago

Attaching an openvpn patch to help. This refactor the one in haikuports to be "more sane" (and follow this new naming)

  • fixing the odd static tap to a dynamic tun
  • making the dynamic_name equal to the full path (later in the code it mentions dynamic_name is used simply for ifconfig calls.. our ifconfig uses full device paths)

Feel free to use, or adjust

Last edited 12 months ago by kallisti5 (previous) (diff)

by kallisti5, 12 months ago

openvpn patches

by kallisti5, 12 months ago

haiku patches i was playing with, likely less useful

by kallisti5, 12 months ago

Attachment: openvpn.png added

stuff unhappy after these patches lol

comment:4 by waddlesplash, 12 months ago

Milestone: UnscheduledR1/beta5
Resolution: fixed
Status: assignedclosed

Overhaul done in hrev57427.

Note: See TracTickets for help on using tickets.