fix last two commits and fix core actual problem
This commit is contained in:
parent
1c0eb0b604
commit
c4e03234a9
2 changed files with 7 additions and 5 deletions
|
|
@ -65,24 +65,26 @@ pub struct VirtualPort(u8);
|
|||
impl VirtualPort{
|
||||
#[inline]
|
||||
pub const fn get_stream_type(self) -> u8 {
|
||||
(self.0 & 0x0F)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub const fn get_port_number(self) -> u8 {
|
||||
(self.0 & 0xF0) >> 4
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn stream_type(self, val: u8) -> Self {
|
||||
let masked_val = val & 0xF0;
|
||||
pub const fn get_port_number(self) -> u8 {
|
||||
(self.0 & 0xF0)
|
||||
}
|
||||
|
||||
Self((self.0 & 0x0F) | masked_val)
|
||||
#[inline]
|
||||
pub fn stream_type(self, val: u8) -> Self {
|
||||
let masked_val = val & 0x0F;
|
||||
assert_eq!(masked_val, val);
|
||||
|
||||
Self((self.0 & 0xF0) | masked_val)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub fn port_number(self, val: u8) -> Self {
|
||||
let masked_val = val & 0x0F;
|
||||
assert_eq!(masked_val, val);
|
||||
|
||||
Self((self.0 & 0x0F) | (masked_val << 4))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ impl NexServer{
|
|||
};
|
||||
|
||||
let Some(endpoint) = endpoints.iter().find(|e|{
|
||||
e.get_virual_port().get_port_number() == connection.prudp_addr.virtual_port.get_port_number()
|
||||
e.get_virual_port().get_port_number() == packet.header.destination_port.get_port_number()
|
||||
}) else {
|
||||
error!("connection to invalid endpoint({}) attempted by {}", connection.prudp_addr.virtual_port.get_port_number(), connection.prudp_addr.regular_socket_addr);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue