narrowlink / ipstack

Asynchronous lightweight userspace implementation of TCP/IP stack for Tun device
Apache License 2.0
51 stars 12 forks source link

we can re-consider supporting freebsd now #24

Closed xmh0511 closed 8 months ago

xmh0511 commented 8 months ago

Since these defined packet information structures prevent ipstack from supporting FreeBSD, which is caused by tun, however, ipstack can support FreeBSD together with tun2 since tun2 supports FreeBSD now, we can re-consider supporting the platform by reverting https://github.com/narrowlink/ipstack/commit/04b7ac7c8e1d9e533584c6f817fa24b63258299a.

SajjadPourali commented 8 months ago

Could you please verify the correct values for TUN_PROTO_IP6 and TUN_PROTO_IP4 in FreeBSD? Are they the same as those in Linux or Darwin?

SajjadPourali commented 8 months ago

https://github.com/freebsd/freebsd-src/blob/89f4f91dbfdcabe65bc7476bc5f13dfb837870fe/sys/net/ethernet.h#L335

SajjadPourali commented 8 months ago

https://github.com/narrowlink/ipstack/commit/b29ace0b16578d734459ae87b97e5b4e8ab68e19

xmh0511 commented 8 months ago

FreeBSD always does not have packet information, in my test. see https://github.com/ssrlive/rust-tun/blob/v2/src/platform/freebsd/device.rs#L454