ipv6: fix Solicited Node address calculation

master
Dario Nieuwenhuis 2021-10-07 04:38:44 +02:00
parent 3269ce6124
commit a0b9fb6ebc
1 changed files with 4 additions and 6 deletions

View File

@ -183,12 +183,10 @@ impl Address {
/// unicast.
pub fn solicited_node(&self) -> Address {
assert!(self.is_unicast());
let mut bytes = [
0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00,
];
bytes[14..].copy_from_slice(&self.0[14..]);
Address(bytes)
Address([
0xff, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xFF,
self.0[13], self.0[14], self.0[15],
])
}
}