mirror of https://github.com/acidanthera/audk.git
Fix a bug in IP4 driver when computing the network broadcast adress.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu, Siyuan <siyuan.fu@intel.com> Reviewed-By: Ye, Ting <ting.ye@intel.com> Reviewed-by: Wu, Jiaxin <jiaxin.wu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15603 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
9e2364ef12
commit
48178d7ab1
|
@ -581,9 +581,10 @@ Ip4SetAddress (
|
|||
Interface->SubnetBrdcast = (IpAddr | ~SubnetMask);
|
||||
|
||||
Type = NetGetIpClass (IpAddr);
|
||||
ASSERT (Type <= IP4_ADDR_CLASSC);
|
||||
Len = NetGetMaskLength (SubnetMask);
|
||||
ASSERT (Len >= 1);
|
||||
Netmask = gIp4AllMasks[MIN ((Len - 1), Type << 3)];
|
||||
ASSERT (Len < IP4_MASK_NUM);
|
||||
Netmask = gIp4AllMasks[MIN (Len, Type << 3)];
|
||||
Interface->NetBrdcast = (IpAddr | ~Netmask);
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue