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:
Fu, Siyuan 2014-06-30 07:48:23 +00:00 committed by sfu5
parent 9e2364ef12
commit 48178d7ab1
1 changed files with 3 additions and 2 deletions

View File

@ -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);
//