Code clean up in NetLib:

1. Add GLOBAL_REMOVE_IF_UNREFERENCED to all globals
2. Update NTOHL and NTOHS to be BaseLib func SwapBytes32/SwapBytes16
3. Remove duplicate NET_SWAP_SHORT (to use NTOHS instead)

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9648 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
xdu2
2009-12-30 13:44:11 +00:00
parent 9ae650ef6c
commit 1204fe8319
13 changed files with 473 additions and 475 deletions

View File

@@ -105,6 +105,8 @@ Ip4ProcessIcmpRedirect (
IP4_ROUTE_CACHE_ENTRY *CacheEntry;
IP4_INTERFACE *IpIf;
IP4_ADDR Gateway;
IP4_ADDR Src;
IP4_ADDR Dst;
//
// Find the interface whose IP address is the source of the
@@ -133,11 +135,9 @@ Ip4ProcessIcmpRedirect (
continue;
}
CacheEntry = Ip4FindRouteCache (
Ip4Instance->RouteTable,
NTOHL (Icmp->IpHead.Dst),
NTOHL (Icmp->IpHead.Src)
);
Dst = NTOHL (Icmp->IpHead.Dst);
Src = NTOHL (Icmp->IpHead.Src);
CacheEntry = Ip4FindRouteCache (Ip4Instance->RouteTable, Dst, Src);
//
// Only update the route cache's gateway if the source of the