shift right, not left
This commit is contained in:
@@ -45,7 +45,7 @@ We can combine the internal IP and subnet pretty easily using cidr notation. e.g
|
|||||||
`255:10::1` and the network is `255::/16`.
|
`255:10::1` and the network is `255::/16`.
|
||||||
|
|
||||||
The router id can be calculated from the host and network. We take the set prefix of `255:10::1/16` which is `255::/16`
|
The router id can be calculated from the host and network. We take the set prefix of `255:10::1/16` which is `255::/16`
|
||||||
and convert that to a 128-bit integer. We then shift that integer left 96 bits and convert the lower 32 bits to an IPv4
|
and convert that to a 128-bit integer. We then shift that integer right 96 bits and convert the lower 32 bits to an IPv4
|
||||||
address. If the lowest byte of that new IPv4 addr is 0, we add 1.
|
address. If the lowest byte of that new IPv4 addr is 0, we add 1.
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user