Fixed bug where global adresses wre classified as having an unknown scope

This commit is contained in:
Slatian 2023-02-22 23:05:38 +01:00
parent 70f06ac501
commit 5a27eb793d

View File

@ -61,6 +61,8 @@ impl AddressInfo {
} else if addr.is_broadcast() {
address_cast = AddressCast::Broadcast;
address_scope = AddressScope::LinkLocal;
} else {
address_scope = AddressScope::Global;
}
},
IpAddr::V6(addr) => {
@ -88,6 +90,8 @@ impl AddressInfo {
0 | 3 | 0xf => address_scope = AddressScope::Reserved,
_ => address_scope = AddressScope::Unknown,
}
} else if segments[0] & 0xe000 == 0x2000 {
address_scope = AddressScope::Global;
}
}