+ if (SubnetMask != NULL) {\r
+ //\r
+ // Overwrite Udp4CfgData/Ip4CfgData SubnetMask.\r
+ //\r
+ CopyMem (&Private->Udp4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
+ CopyMem (&Private->Ip4CfgData.SubnetMask, SubnetMask, sizeof (EFI_IPv4_ADDRESS));\r
+ }\r
+\r
+ if (StationIp != NULL && SubnetMask != NULL) {\r
+ //\r
+ // Updated the route table.\r
+ //\r
+ Mode->RouteTableEntries = 1;\r
+ Mode->RouteTable[0].IpAddr.Addr[0] = StationIp->Addr[0] & SubnetMask->Addr[0];\r
+ Mode->RouteTable[0].SubnetMask.Addr[0] = SubnetMask->Addr[0];\r
+ Mode->RouteTable[0].GwAddr.Addr[0] = 0;\r
+ }\r
+\r
+ if (StationIp != NULL || SubnetMask != NULL) {\r
+ //\r
+ // Reconfigure the Ip4 instance to capture background ICMP packets with new station Ip address.\r
+ //\r
+ Private->Ip4->Cancel (Private->Ip4, &Private->IcmpToken);\r
+ Private->Ip4->Configure (Private->Ip4, NULL);\r
+\r
+ Status = Private->Ip4->Configure (Private->Ip4, &Private->Ip4CfgData);\r
+ if (EFI_ERROR (Status)) {\r
+ goto ON_EXIT;\r
+ }\r
+\r
+ Status = Private->Ip4->Receive (Private->Ip4, &Private->IcmpToken);\r
+ }\r