Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
ibigbug committed Dec 3, 2024
1 parent 4b4737e commit 1847631
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions clash_lib/src/proxy/wg/wireguard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,7 @@ impl WireguardTunnel {
match IpVersion::of_packet(packet) {
Ok(IpVersion::Ipv4) => Ipv4Packet::new_checked(&packet)
.ok()
.filter(|packet| {
Ipv4Addr::from(packet.dst_addr()) == self.source_peer_ip
})
.filter(|packet| packet.dst_addr() == self.source_peer_ip)
.and_then(|packet| {
match packet.next_header() {
IpProtocol::Tcp => Some(PortProtocol::Tcp),
Expand All @@ -394,9 +392,7 @@ impl WireguardTunnel {
}),
Ok(IpVersion::Ipv6) => Ipv6Packet::new_checked(&packet)
.ok()
.filter(|packet| {
Some(Ipv6Addr::from(packet.dst_addr())) == self.source_peer_ipv6
})
.filter(|packet| Some(packet.dst_addr()) == self.source_peer_ipv6)
.and_then(|packet| {
match packet.next_header() {
IpProtocol::Tcp => Some(PortProtocol::Tcp),
Expand Down

0 comments on commit 1847631

Please sign in to comment.