[MS-NCT] Incorrect implementation of Microsoft Network Cost IE
According to commit 5307b1ed , there is a link to screwed up microsoft documentation page. The correct documentation for [MS-NCT] is here: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-nct/
And due to screwed up documentation, the implementation is completely unusable.
The correct order of bytes as described in [MS-NCT] is
bytes[-2] // Type of IE: Vendor-Specific = 0xDD
bytes[-1] // Length of IE data
bytes[0] byte[1] byte[2] // MS OUI: 0x00 0x50 0xF2
bytes[3] // OUI Type: Network Cost IE (0x11)
bytes[4] // Cost Level (Refer to [MS-NCT])
bytes[5] // Reserved, SHOULD be zero
bytes[6] // Cost Flags (Refer to [MS-NCT])
bytes[7] // Reserved, SHOULD be zero
But in NM code bytes[7] > 1
is used to check if connection is metered. This byte SHOULD always be 0x00 due to [MS-NCT] specification.
Please change this to bytes[7]
to bytes[4]
.
Refers issue #200 when this was incorrectly implemented first time.