[iscsiboot] Fix calculation of subnet masks with a non-byte boundary
authorMichael Brown <mbrown@fensystems.co.uk>
Fri, 19 Dec 2008 00:32:11 +0000 (00:32 +0000)
committerMichael Brown <mbrown@fensystems.co.uk>
Fri, 19 Dec 2008 00:32:11 +0000 (00:32 +0000)
driver/iscsiboot.c

index dd93dab..a38ebd5 100644 (file)
@@ -786,7 +786,7 @@ static NTSTATUS store_tcpip_parameters ( PIBFT_NIC nic,
                goto err_reg_store;
 
        /* Store subnet mask */
-       subnet_mask = ( 0xffffffffUL >> ( 32 - nic->subnet_mask_prefix ) );
+       subnet_mask = RtlUlongByteSwap ( 0xffffffffUL << ( 32 - nic->subnet_mask_prefix ) );
        status = store_ipv4_parameter_multi_sz ( reg_key, L"SubnetMask",
                                                 subnet_mask );
        if ( ! NT_SUCCESS ( status ) )