Skip to content

Commit

Permalink
return AgentRemoteId after decoding, instead AgentCircuitId
Browse files Browse the repository at this point in the history
  • Loading branch information
abvarshney committed Nov 3, 2023
1 parent 44fe6c9 commit c6e38a8
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/v4/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Decodable for RelayInfo {
RelayCode::AgentRemoteId => {
let len = d.read_u8()? as usize;
let data = d.read_slice(len)?.to_vec();
AgentCircuitId(data)
AgentRemoteId(data)
}
RelayCode::DocsisDeviceClass => {
let _ = d.read_u8()?;
Expand Down Expand Up @@ -415,6 +415,15 @@ mod tests {
Ok(())
}
#[test]
fn test_remote() -> Result<()> {
test_opt(
RelayInfo::AgentRemoteId(vec![0, 1, 2, 3, 4]),
vec![2, 5, 0, 1, 2, 3, 4],
)?;

Ok(())
}
#[test]
fn test_flags() -> Result<()> {
test_opt(
RelayInfo::RelayAgentFlags(RelayFlags::default().set_unicast()),
Expand Down

0 comments on commit c6e38a8

Please sign in to comment.