]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/Ip4Dxe/Ip4Route.c
MdeModulePkg: Update the Ethernet interface name.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / Ip4Dxe / Ip4Route.c
index 0c901e8266f7f6293da68525a0b1bc9ded218f2d..d240d5343aea366a3f0acab82ef73f09724114e6 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
 \r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
-All rights reserved. This program and the accompanying materials\r
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.<BR>\r
+This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
 http://opensource.org/licenses/bsd-license.php\r
@@ -67,7 +67,7 @@ Ip4FreeRouteEntry (
   ASSERT (RtEntry->RefCnt > 0);\r
 \r
   if (--RtEntry->RefCnt == 0) {\r
-    gBS->FreePool (RtEntry);\r
+    FreePool (RtEntry);\r
   }\r
 }\r
 \r
@@ -127,7 +127,7 @@ Ip4FreeRouteCacheEntry (
   ASSERT (RtCacheEntry->RefCnt > 0);\r
 \r
   if (--RtCacheEntry->RefCnt == 0) {\r
-    gBS->FreePool (RtCacheEntry);\r
+    FreePool (RtCacheEntry);\r
   }\r
 }\r
 \r
@@ -204,7 +204,7 @@ Ip4CreateRouteTable (
   RtTable->RefCnt   = 1;\r
   RtTable->TotalNum = 0;\r
 \r
-  for (Index = 0; Index < IP4_MASK_NUM; Index++) {\r
+  for (Index = 0; Index <= IP4_MASK_MAX; Index++) {\r
     InitializeListHead (&(RtTable->RouteArea[Index]));\r
   }\r
 \r
@@ -241,7 +241,7 @@ Ip4FreeRouteTable (
   //\r
   // Free all the route table entry and its route cache.\r
   //\r
-  for (Index = 0; Index < IP4_MASK_NUM; Index++) {\r
+  for (Index = 0; Index <= IP4_MASK_MAX; Index++) {\r
     NET_LIST_FOR_EACH_SAFE (Entry, Next, &(RtTable->RouteArea[Index])) {\r
       RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);\r
 \r
@@ -252,7 +252,7 @@ Ip4FreeRouteTable (
 \r
   Ip4CleanRouteCache (&RtTable->Cache);\r
 \r
-  gBS->FreePool (RtTable);\r
+  FreePool (RtTable);\r
 }\r
 \r
 \r
@@ -469,7 +469,7 @@ Ip4FindRouteEntry (
 \r
   RtEntry = NULL;\r
 \r
-  for (Index = IP4_MASK_NUM - 1; Index >= 0; Index--) {\r
+  for (Index = IP4_MASK_MAX; Index >= 0; Index--) {\r
     for (Table = RtTable; Table != NULL; Table = Table->Next) {\r
       NET_LIST_FOR_EACH (Entry, &Table->RouteArea[Index]) {\r
         RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);\r
@@ -611,7 +611,7 @@ Ip4BuildEfiRouteTable (
   RtTable = IpInstance->RouteTable;\r
 \r
   if (IpInstance->EfiRouteTable != NULL) {\r
-    gBS->FreePool (IpInstance->EfiRouteTable);\r
+    FreePool (IpInstance->EfiRouteTable);\r
 \r
     IpInstance->EfiRouteTable = NULL;\r
     IpInstance->EfiRouteCount = 0;\r
@@ -641,7 +641,7 @@ Ip4BuildEfiRouteTable (
   //\r
   Count = 0;\r
 \r
-  for (Index = IP4_MASK_NUM - 1; Index >= 0; Index--) {\r
+  for (Index = IP4_MASK_MAX; Index >= 0; Index--) {\r
     for (RtTable = IpInstance->RouteTable; RtTable != NULL; RtTable = RtTable->Next) {\r
       NET_LIST_FOR_EACH (Entry, &(RtTable->RouteArea[Index])) {\r
         RtEntry = NET_LIST_USER_STRUCT (Entry, IP4_ROUTE_ENTRY, Link);\r