mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore: fix clippy warnings in eBPF code (#10660)
This code appears to be configured out in CI and thus we don't run clippy there. My IDE pointed these out however so it seems fair enough to fix them. It is just unnecessary references, doesn't actually have an impact on the functionality.
This commit is contained in:
@@ -65,10 +65,10 @@ pub fn get_port_and_peer(key: impl Into<ClientAndChannel>) -> Result<PortAndPeer
|
||||
#[inline(always)]
|
||||
fn get_client_and_channel_v4(key: impl Into<PortAndPeer>) -> Result<ClientAndChannelV4, Error> {
|
||||
match key.into() {
|
||||
PortAndPeer::V4(pp) => unsafe { UDP_TO_CHAN_44.get(&pp) }
|
||||
PortAndPeer::V4(pp) => unsafe { UDP_TO_CHAN_44.get(pp) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Udp4ToChan)),
|
||||
PortAndPeer::V6(pp) => unsafe { UDP_TO_CHAN_64.get(&pp) }
|
||||
PortAndPeer::V6(pp) => unsafe { UDP_TO_CHAN_64.get(pp) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Udp6ToChan)),
|
||||
}
|
||||
@@ -77,10 +77,10 @@ fn get_client_and_channel_v4(key: impl Into<PortAndPeer>) -> Result<ClientAndCha
|
||||
#[inline(always)]
|
||||
fn get_client_and_channel_v6(key: impl Into<PortAndPeer>) -> Result<ClientAndChannelV6, Error> {
|
||||
match key.into() {
|
||||
PortAndPeer::V4(pp) => unsafe { UDP_TO_CHAN_46.get(&pp) }
|
||||
PortAndPeer::V4(pp) => unsafe { UDP_TO_CHAN_46.get(pp) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Udp4ToChan)),
|
||||
PortAndPeer::V6(pp) => unsafe { UDP_TO_CHAN_66.get(&pp) }
|
||||
PortAndPeer::V6(pp) => unsafe { UDP_TO_CHAN_66.get(pp) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Udp6ToChan)),
|
||||
}
|
||||
@@ -89,10 +89,10 @@ fn get_client_and_channel_v6(key: impl Into<PortAndPeer>) -> Result<ClientAndCha
|
||||
#[inline(always)]
|
||||
fn get_port_and_peer_v4(key: impl Into<ClientAndChannel>) -> Result<PortAndPeerV4, Error> {
|
||||
match key.into() {
|
||||
ClientAndChannel::V4(pp) => unsafe { CHAN_TO_UDP_44.get(&pp) }
|
||||
ClientAndChannel::V4(cc) => unsafe { CHAN_TO_UDP_44.get(cc) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Chan4ToUdp)),
|
||||
ClientAndChannel::V6(pp) => unsafe { CHAN_TO_UDP_64.get(&pp) }
|
||||
ClientAndChannel::V6(cc) => unsafe { CHAN_TO_UDP_64.get(cc) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Chan6ToUdp)),
|
||||
}
|
||||
@@ -101,10 +101,10 @@ fn get_port_and_peer_v4(key: impl Into<ClientAndChannel>) -> Result<PortAndPeerV
|
||||
#[inline(always)]
|
||||
fn get_port_and_peer_v6(key: impl Into<ClientAndChannel>) -> Result<PortAndPeerV6, Error> {
|
||||
match key.into() {
|
||||
ClientAndChannel::V4(pp) => unsafe { CHAN_TO_UDP_46.get(&pp) }
|
||||
ClientAndChannel::V4(cc) => unsafe { CHAN_TO_UDP_46.get(cc) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Chan4ToUdp)),
|
||||
ClientAndChannel::V6(pp) => unsafe { CHAN_TO_UDP_66.get(&pp) }
|
||||
ClientAndChannel::V6(cc) => unsafe { CHAN_TO_UDP_66.get(cc) }
|
||||
.copied()
|
||||
.ok_or(Error::NoEntry(SupportedChannel::Chan6ToUdp)),
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ static STATS: PerfEventArray<StatsEvent> = PerfEventArray::new(0);
|
||||
pub fn emit_data_relayed(ctx: &XdpContext, bytes: impl Into<u64>) {
|
||||
STATS.output(
|
||||
ctx,
|
||||
&StatsEvent {
|
||||
StatsEvent {
|
||||
relayed_data: bytes.into(),
|
||||
},
|
||||
0,
|
||||
|
||||
Reference in New Issue
Block a user