OldTpl = NET_RAISE_TPL (NET_TPL_LOCK);\r
\r
Instance = MTFTP4_PROTOCOL_FROM_THIS (This);\r
- ModeData->ConfigData = Instance->Config;\r
+ CopyMem(&ModeData->ConfigData, &Instance->Config, sizeof (Instance->Config));\r
ModeData->SupportedOptionCount = MTFTP4_SUPPORTED_OPTIONS;\r
- ModeData->SupportedOptoins = mMtftp4SupportedOptions;\r
+ ModeData->SupportedOptoins = (UINT8 **) mMtftp4SupportedOptions;\r
ModeData->UnsupportedOptionCount = 0;\r
ModeData->UnsupportedOptoins = NULL;\r
\r
return EFI_ACCESS_DENIED;\r
}\r
\r
- Instance->Config = *ConfigData;\r
+ CopyMem(&Instance->Config, ConfigData, sizeof (*ConfigData));;\r
Instance->State = MTFTP4_STATE_CONFIGED;\r
\r
NET_RESTORE_TPL (OldTpl);\r
return EFI_SUCCESS;\r
}\r
\r
+ if (!Config->UseDefaultSetting && !EFI_IP4_EQUAL (&mZeroIp4Addr, &Config->GatewayIp)) {\r
+ //\r
+ // The station IP address is manually configured and the Gateway IP is not 0.\r
+ // Add the default route for this UDP instance.\r
+ //\r
+ Status = UdpIo->Udp->Routes (UdpIo->Udp, FALSE, &mZeroIp4Addr, &mZeroIp4Addr, &Config->GatewayIp);\r
+ if (EFI_ERROR (Status)) {\r
+ UdpIo->Udp->Configure (UdpIo->Udp, NULL);\r
+ }\r
+ }\r
return Status;\r
}\r
\r