[ipv6] Fix mask calculation when prefix length is not a multiple of 8

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2022-09-06 13:02:17 +01:00
parent 131daf1aae
commit bc19aeca5f
2 changed files with 38 additions and 1 deletions

View File

@@ -251,7 +251,7 @@ int ipv6_add_miniroute ( struct net_device *netdev, struct in6_addr *address,
*prefix_mask = 0xff;
}
if ( remaining )
*prefix_mask <<= ( 8 - remaining );
*prefix_mask = ( 0xff << ( 8 - remaining ) );
}
/* Add to start of routing table */