Skip to content

Commit

Permalink
fix packet-information (meh#55)
Browse files Browse the repository at this point in the history
* update example

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* set tun name

* add set_tun_name for freebsd

* add set_tun_name for freebsd

* unify the access of internal api

* update freebsd

* update example

* cargo fmt

* cargo fmt

* fix packet-information

* cargo fmt

* update

* Update split.rs

* Update split.rs

* Update split.rs

* Update split.rs

---------

Co-authored-by: ssrlive <[email protected]>
  • Loading branch information
xmh0511 and ssrlive authored Mar 6, 2024
1 parent 565568a commit dbb7b23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/platform/posix/split.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ pub(crate) fn generate_packet_information(
#[cfg(any(target_os = "macos", target_os = "ios"))]
const TUN_PROTO_IP4: [u8; PIL] = (libc::AF_INET as u32).to_be_bytes();

// FIXME: Currently, the FreeBSD we test (FreeBSD-14.0-RELEASE) seems to have no PI. Here just a dummy.
#[cfg(target_os = "freebsd")]
const TUN_PROTO_IP6: [u8; PIL] = (libc::AF_INET6 as u32).to_be_bytes();
const TUN_PROTO_IP6: [u8; PIL] = 0x86DD_u32.to_be_bytes();
#[cfg(target_os = "freebsd")]
const TUN_PROTO_IP4: [u8; PIL] = (libc::AF_INET as u32).to_be_bytes();
const TUN_PROTO_IP4: [u8; PIL] = 0x0800_u32.to_be_bytes();

#[cfg(unix)]
if _packet_information {
Expand Down

0 comments on commit dbb7b23

Please sign in to comment.