1. Add new interface Ip6IsValidUnicast 
2. Add new enum IP6_EXTENSION_HEADER_TYPE
3. Add new structure IP6_ICMP_* definitions
4. Update structure from EFI_UDP4_HEADER to EFI_UDP_HEADER
5. Add new macro EFI_IP6_EQUAL


IpIoLib:
1. Update the IpIoLib to a combined library for both v4 and v6 network stack 
2. Fix a bug in IpIoIcmpHandler() - for IPv6 packet, the header length is variable (basic header + extension) rathar than fixed length.
   The fix removes the IPv6 header fields and notify the user with the ICMPv6 packet only containing payload.

TcpDxe/UdpDxe:
1. Update to adapt the new combined IpIoLib
2. Add gEfiIp6ProtocolGuid/gEfiIp6ServiceBindingProtocolGuid to [Protocols] in INF file since the Ip6.h is included in IpIoLib and NetLib.
3. Pass the TCP4/UDP4 UEFI SCT test on NT32 platform.

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9374 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
tye
2009-10-26 10:15:40 +00:00
parent 326f0711dc
commit fb115c6150
14 changed files with 1217 additions and 312 deletions

View File

@ -1,8 +1,8 @@
/** @file /** @file
Ihis library is only intended to be used by UEFI network stack modules. This library is only intended to be used by UEFI network stack modules.
It provides the IpIo layer on the EFI IP4 Protocol. It provides the combined IpIo layer on the EFI IP4 Protocol and EFI IP6 protocol.
Copyright (c) 2005 - 2008, Intel Corporation.<BR> Copyright (c) 2005 - 2009, Intel Corporation.<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -17,6 +17,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define _IP_IO_H_ #define _IP_IO_H_
#include <Protocol/Ip4.h> #include <Protocol/Ip4.h>
#include <Protocol/Ip6.h>
#include <Library/NetLib.h> #include <Library/NetLib.h>
@ -77,7 +78,13 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head)) #define NET_PROTO_HDR(Buf, Type) ((Type *) ((Buf)->BlockOp[0].Head))
extern EFI_IP4_CONFIG_DATA mIpIoDefaultIpConfigData; extern EFI_IP4_CONFIG_DATA mIp4IoDefaultIpConfigData;
extern EFI_IP6_CONFIG_DATA mIp6IoDefaultIpConfigData;
typedef enum {
IP_VERSION_4 = 4,
IP_VERSION_6 = 6
} IP_VERSION;
/// ///
/// This error will be delivered to the /// This error will be delivered to the
@ -97,21 +104,64 @@ typedef enum {
ICMP_ERR_PARAMPROB ICMP_ERR_PARAMPROB
} ICMP_ERROR; } ICMP_ERROR;
typedef enum {
ICMP6_ERR_UNREACH_NET = 0,
ICMP6_ERR_UNREACH_HOST,
ICMP6_ERR_UNREACH_PROTOCOL,
ICMP6_ERR_UNREACH_PORT,
ICMP6_ERR_PACKAGE_TOOBIG,
ICMP6_ERR_TIMXCEED_HOPLIMIT,
ICMP6_ERR_TIMXCEED_REASS,
ICMP6_ERR_PARAMPROB_HEADER,
ICMP6_ERR_PARAMPROB_NEXHEADER,
ICMP6_ERR_PARAMPROB_IPV6OPTION
} ICMP6_ERROR;
/// ///
/// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only. /// The helper struct for IpIoGetIcmpErrStatus(). It is for internal use only.
/// ///
typedef struct { typedef struct {
BOOLEAN IsHard; EFI_STATUS Error;
BOOLEAN Notify; BOOLEAN IsHard;
BOOLEAN Notify;
} ICMP_ERROR_INFO; } ICMP_ERROR_INFO;
typedef union {
EFI_IP4_COMPLETION_TOKEN Ip4Token;
EFI_IP6_COMPLETION_TOKEN Ip6Token;
} IP_IO_IP_COMPLETION_TOKEN;
typedef union {
EFI_IP4_TRANSMIT_DATA Ip4TxData;
EFI_IP6_TRANSMIT_DATA Ip6TxData;
} IP_IO_IP_TX_DATA;
typedef union {
EFI_IP4_RECEIVE_DATA Ip4RxData;
EFI_IP6_RECEIVE_DATA Ip6RxData;
} IP_IO_IP_RX_DATA;
typedef union {
EFI_IP4_OVERRIDE_DATA Ip4OverrideData;
EFI_IP6_OVERRIDE_DATA Ip6OverrideData;
} IP_IO_OVERRIDE;
typedef union {
EFI_IP4_CONFIG_DATA Ip4CfgData;
EFI_IP6_CONFIG_DATA Ip6CfgData;
} IP_IO_IP_CONFIG_DATA;
/// ///
/// The IP session for an IP receive packet. /// The IP session for an IP receive packet.
/// ///
typedef struct _EFI_NET_SESSION_DATA { typedef struct _EFI_NET_SESSION_DATA {
IP4_ADDR Source; ///< Source IP of the received packet EFI_IP_ADDRESS Source; ///< Source IP of the received packet
IP4_ADDR Dest; ///< Destination IP of the received packet EFI_IP_ADDRESS Dest; ///< Destination IP of the received packet
EFI_IP4_HEADER *IpHdr; ///< IP4 header of the received packet union {
EFI_IP4_HEADER *Ip4Hdr; ///< IP4 header of the received packet
EFI_IP6_HEADER *Ip6Hdr; ///< IP6 header of the received packet
} IpHdr;
IP_VERSION IpVersion; ///< The IP version of the received packet
} EFI_NET_SESSION_DATA; } EFI_NET_SESSION_DATA;
/** /**
@ -141,7 +191,7 @@ VOID
@param[in] Status Result of the sending @param[in] Status Result of the sending
@param[in] Context The data provided by user for the received packet when @param[in] Context The data provided by user for the received packet when
the callback is registered in IP_IO_OPEN_DATA::SndContext. the callback is registered in IP_IO_OPEN_DATA::SndContext.
@param[in] Sender A pointer to EFI_IP4_PROTOCOL for sender @param[in] Sender A pointer to EFI_IP4_PROTOCOL or EFI_IP6_PROTOCOL
@param[in] NotifyData Context data specified when calling IpIoSend() @param[in] NotifyData Context data specified when calling IpIoSend()
**/ **/
@ -155,8 +205,8 @@ VOID
); );
/// ///
/// This data structure wraps Ip4 instances. The IpIo Library uses it for all /// This data structure wraps Ip4/Ip6 instances. The IpIo Library uses it for all
/// Ip4 operations. /// Ip4/Ip6 operations.
/// ///
typedef struct _IP_IO { typedef struct _IP_IO {
/// ///
@ -175,7 +225,7 @@ typedef struct _IP_IO {
// //
// The IP instance consumed by this IP_IO // The IP instance consumed by this IP_IO
// //
EFI_IP4_PROTOCOL *Ip; VOID *Ip;
BOOLEAN IsConfigured; BOOLEAN IsConfigured;
/// ///
@ -186,7 +236,7 @@ typedef struct _IP_IO {
/// ///
/// Token and event used to get data from IP /// Token and event used to get data from IP
/// ///
EFI_IP4_COMPLETION_TOKEN RcvToken; IP_IO_IP_COMPLETION_TOKEN RcvToken;
/// ///
/// List entry used to link the token passed to IP_IO /// List entry used to link the token passed to IP_IO
@ -200,6 +250,10 @@ typedef struct _IP_IO {
VOID *SndContext; ///< See IP_IO_OPEN_DATA::SndContext VOID *SndContext; ///< See IP_IO_OPEN_DATA::SndContext
PKT_RCVD_NOTIFY PktRcvdNotify; ///< See IP_IO_OPEN_DATA::PktRcvdNotify PKT_RCVD_NOTIFY PktRcvdNotify; ///< See IP_IO_OPEN_DATA::PktRcvdNotify
PKT_SENT_NOTIFY PktSentNotify; ///< See IP_IO_OPEN_DATA::PktSentNotify PKT_SENT_NOTIFY PktSentNotify; ///< See IP_IO_OPEN_DATA::PktSentNotify
//
// Ip Version
//
IP_VERSION IpVersion;
} IP_IO; } IP_IO;
/// ///
@ -207,11 +261,11 @@ typedef struct _IP_IO {
/// It is used by IpIoOpen(). /// It is used by IpIoOpen().
/// ///
typedef struct _IP_IO_OPEN_DATA { typedef struct _IP_IO_OPEN_DATA {
EFI_IP4_CONFIG_DATA IpConfigData; ///< Configuration of the IP instance IP_IO_IP_CONFIG_DATA IpConfigData; ///< Configuration of the IP instance
VOID *RcvdContext; ///< Context data used by receive callback VOID *RcvdContext; ///< Context data used by receive callback
VOID *SndContext; ///< Context data used by send callback VOID *SndContext; ///< Context data used by send callback
PKT_RCVD_NOTIFY PktRcvdNotify; ///< Receive callback PKT_RCVD_NOTIFY PktRcvdNotify; ///< Receive callback
PKT_SENT_NOTIFY PktSentNotify; ///< Send callback PKT_SENT_NOTIFY PktSentNotify; ///< Send callback
} IP_IO_OPEN_DATA; } IP_IO_OPEN_DATA;
/// ///
@ -225,37 +279,41 @@ typedef struct _IP_IO_SEND_ENTRY {
IP_IO *IpIo; IP_IO *IpIo;
VOID *Context; VOID *Context;
VOID *NotifyData; VOID *NotifyData;
EFI_IP4_PROTOCOL *Ip; VOID *Ip;
NET_BUF *Pkt; NET_BUF *Pkt;
EFI_IP4_COMPLETION_TOKEN *SndToken; IP_IO_IP_COMPLETION_TOKEN SndToken;
} IP_IO_SEND_ENTRY; } IP_IO_SEND_ENTRY;
typedef EFI_IP4_OVERRIDE_DATA IP_IO_OVERRIDE;
/// ///
/// The IP_IO_IP_INFO is used in IpIoSend() to override the default IP instance /// The IP_IO_IP_INFO is used in IpIoSend() to override the default IP instance
/// in IP_IO. /// in IP_IO.
/// ///
typedef struct _IP_IO_IP_INFO { typedef struct _IP_IO_IP_INFO {
IP4_ADDR Addr; EFI_IP_ADDRESS Addr;
IP4_ADDR SubnetMask; union {
IP4_ADDR SubnetMask;
UINT8 PrefixLength;
} PreMask;
LIST_ENTRY Entry; LIST_ENTRY Entry;
EFI_HANDLE ChildHandle; EFI_HANDLE ChildHandle;
EFI_IP4_PROTOCOL *Ip; VOID *Ip;
EFI_IP4_COMPLETION_TOKEN DummyRcvToken; IP_IO_IP_COMPLETION_TOKEN DummyRcvToken;
INTN RefCnt; INTN RefCnt;
IP_VERSION IpVersion;
} IP_IO_IP_INFO; } IP_IO_IP_INFO;
/** /**
Create a new IP_IO instance. Create a new IP_IO instance.
This function uses IP4 service binding protocol in Controller to create an IP4 This function uses IP4/IP6 service binding protocol in Controller to create
child (aka IP4 instance). an IP4/IP6 child (aka IP4/IP6 instance).
@param[in] Image The image handle of the driver or application that @param[in] Image The image handle of the driver or application that
consumes IP_IO. consumes IP_IO.
@param[in] Controller The controller handle that has IP4 service binding @param[in] Controller The controller handle that has IP4 or IP6 service
protocol installed. binding protocol installed.
@param[in] IpVersion The version of the IP protocol to use, either
IPv4 or IPv6.
@return Pointer to a newly created IP_IO instance, or NULL if failed. @return Pointer to a newly created IP_IO instance, or NULL if failed.
@ -264,7 +322,8 @@ IP_IO *
EFIAPI EFIAPI
IpIoCreate ( IpIoCreate (
IN EFI_HANDLE Image, IN EFI_HANDLE Image,
IN EFI_HANDLE Controller IN EFI_HANDLE Controller,
IN IP_VERSION IpVersion
); );
/** /**
@ -361,7 +420,7 @@ IpIoSend (
IN IP_IO_IP_INFO *Sender OPTIONAL, IN IP_IO_IP_INFO *Sender OPTIONAL,
IN VOID *Context OPTIONAL, IN VOID *Context OPTIONAL,
IN VOID *NotifyData OPTIONAL, IN VOID *NotifyData OPTIONAL,
IN IP4_ADDR Dest, IN EFI_IP_ADDRESS *Dest,
IN IP_IO_OVERRIDE *OverrideData OPTIONAL IN IP_IO_OVERRIDE *OverrideData OPTIONAL
); );
@ -399,15 +458,15 @@ IpIoAddIp (
); );
/** /**
Configure the IP instance of this IpInfo and start the receiving if Ip4ConfigData Configure the IP instance of this IpInfo and start the receiving if IpConfigData
is not NULL. is not NULL.
@param[in, out] IpInfo Pointer to the IP_IO_IP_INFO instance. @param[in, out] IpInfo Pointer to the IP_IO_IP_INFO instance.
@param[in, out] Ip4ConfigData The IP4 configure data used to configure the IP @param[in, out] IpConfigData The IP4 or IP6 configure data used to configure
instance. If NULL, the IP instance is reset. If the IP instance. If NULL, the IP instance is reset.
UseDefaultAddress is set to TRUE, and the configure If UseDefaultAddress is set to TRUE, and the configure
operation succeeds, the default address information operation succeeds, the default address information
is written back in this Ip4ConfigData. is written back in this IpConfigData.
@retval EFI_SUCCESS The IP instance of this IpInfo is configured successfully, @retval EFI_SUCCESS The IP instance of this IpInfo is configured successfully,
or there is no need to reconfigure it. or there is no need to reconfigure it.
@ -418,7 +477,7 @@ EFI_STATUS
EFIAPI EFIAPI
IpIoConfigIp ( IpIoConfigIp (
IN OUT IP_IO_IP_INFO *IpInfo, IN OUT IP_IO_IP_INFO *IpInfo,
IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData OPTIONAL IN OUT VOID *IpConfigData OPTIONAL
); );
/** /**
@ -448,6 +507,8 @@ IpIoRemoveIp (
specified Src. The IpIo was added previously by IpIoAddIp(). specified Src. The IpIo was added previously by IpIoAddIp().
@param[in, out] IpIo Pointer to the pointer of the IP_IO instance. @param[in, out] IpIo Pointer to the pointer of the IP_IO instance.
@param[in] IpVersion The version of the IP protocol to use, either
IPv4 or IPv6.
@param[in] Src The local IP address. @param[in] Src The local IP address.
@return Pointer to the IP protocol can be used for sending purpose and its local @return Pointer to the IP protocol can be used for sending purpose and its local
@ -457,8 +518,9 @@ IpIoRemoveIp (
IP_IO_IP_INFO * IP_IO_IP_INFO *
EFIAPI EFIAPI
IpIoFindSender ( IpIoFindSender (
IN OUT IP_IO **IpIo, IN OUT IP_IO **IpIo,
IN IP4_ADDR Src IN IP_VERSION IpVersion,
IN EFI_IP_ADDRESS *Src
); );
/** /**
@ -468,6 +530,9 @@ IpIoFindSender (
are not NULL, this routine will fill them. are not NULL, this routine will fill them.
@param[in] IcmpError IcmpError Type. @param[in] IcmpError IcmpError Type.
@param[in] IpVersion The version of the IP protocol to use,
either IPv4 or IPv6.
@param[out] IsHard Whether it is a hard error. @param[out] IsHard Whether it is a hard error.
@param[out] Notify Whether it need to notify SockError. @param[out] Notify Whether it need to notify SockError.
@ -478,8 +543,41 @@ EFI_STATUS
EFIAPI EFIAPI
IpIoGetIcmpErrStatus ( IpIoGetIcmpErrStatus (
IN ICMP_ERROR IcmpError, IN ICMP_ERROR IcmpError,
IN IP_VERSION IpVersion,
OUT BOOLEAN *IsHard OPTIONAL, OUT BOOLEAN *IsHard OPTIONAL,
OUT BOOLEAN *Notify OPTIONAL OUT BOOLEAN *Notify OPTIONAL
); );
/**
Refresh the remote peer's Neighbor Cache entries.
This function is called when the caller needs the IpIo to refresh the existing
IPv6 neighbor cache entries since the neighbor is considered reachable by the
node has recently received a confirmation that packets sent recently to the
neighbor were received by its IP layer.
@param[in] IpIo Pointer to an IP_IO instance
@param[in] Neighbor The IP address of the neighbor
@param[in] Timeout Time in 100-ns units that this entry will
remain in the neighbor cache. A value of
zero means that the entry is permanent.
A value of non-zero means that the entry is
dynamic and will be deleted after Timeout.
@retval EFI_SUCCESS The operation is completed successfully.
@retval EFI_NOT_STARTED The IpIo is not configured.
@retval EFI_INVALID_PARAMETER Neighbor Address is invalid.
@retval EFI_NOT_FOUND The neighbor cache entry is not in the
neighbor table.
@retval EFI_OUT_OF_RESOURCES Failed due to resource limit.
**/
EFI_STATUS
IpIoRefreshNeighbor (
IN IP_IO *IpIo,
IN EFI_IP_ADDRESS *Neighbor,
IN UINT32 Timeout
);
#endif #endif

View File

@ -16,6 +16,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#ifndef _NET_LIB_H_ #ifndef _NET_LIB_H_
#define _NET_LIB_H_ #define _NET_LIB_H_
#include <Protocol/Ip6.h>
typedef UINT32 IP4_ADDR; typedef UINT32 IP4_ADDR;
typedef UINT32 TCP_SEQNO; typedef UINT32 TCP_SEQNO;
typedef UINT16 TCP_PORTNO; typedef UINT16 TCP_PORTNO;
@ -40,6 +42,15 @@ typedef enum {
IP4_MASK_NUM = 33 IP4_MASK_NUM = 33
} IP4_CLASS_TYPE; } IP4_CLASS_TYPE;
typedef enum {
IP6_HOP_BY_HOP = 0,
IP6_DESTINATION = 60,
IP6_FRAGMENT = 44,
IP6_AH = 51,
IP6_ESP = 50,
IP6_NO_NEXT_HEADER = 59
} IP6_EXTENSION_HEADER_TYPE;
#pragma pack(1) #pragma pack(1)
// //
@ -95,6 +106,22 @@ typedef struct {
UINT16 Seq; UINT16 Seq;
} IP4_ICMP_QUERY_HEAD; } IP4_ICMP_QUERY_HEAD;
typedef struct {
UINT8 Type;
UINT8 Code;
UINT16 Checksum;
} IP6_ICMP_HEAD;
typedef struct {
IP6_ICMP_HEAD Head;
UINT32 Fourth;
EFI_IP6_HEADER IpHead;
} IP6_ICMP_ERROR_HEAD;
typedef struct {
IP6_ICMP_HEAD Head;
UINT32 Fourth;
} IP6_ICMP_INFORMATION_HEAD;
// //
// UDP header definition // UDP header definition
@ -104,8 +131,7 @@ typedef struct {
UINT16 DstPort; UINT16 DstPort;
UINT16 Length; UINT16 Length;
UINT16 Checksum; UINT16 Checksum;
} EFI_UDP4_HEADER; } EFI_UDP_HEADER;
// //
// TCP header definition // TCP header definition
@ -160,6 +186,9 @@ typedef struct {
#define EFI_NTOHL(EfiIp) (NTOHL (EFI_IP4 ((EfiIp)))) #define EFI_NTOHL(EfiIp) (NTOHL (EFI_IP4 ((EfiIp))))
#define EFI_IP4_EQUAL(Ip1, Ip2) (CompareMem ((Ip1), (Ip2), sizeof (EFI_IPv4_ADDRESS)) == 0) #define EFI_IP4_EQUAL(Ip1, Ip2) (CompareMem ((Ip1), (Ip2), sizeof (EFI_IPv4_ADDRESS)) == 0)
#define EFI_IP6_EQUAL(Ip1, Ip2) (CompareMem ((Ip1), (Ip2), sizeof (EFI_IPv6_ADDRESS)) == 0)
/** /**
Return the length of the mask. Return the length of the mask.
@ -227,6 +256,25 @@ Ip4IsUnicast (
IN IP4_ADDR NetMask IN IP4_ADDR NetMask
); );
/**
Check whether the incoming IPv6 address is a valid unicast address.
If the address is a multicast address has binary 0xFF at the start, it is not
a valid unicast address. If the address is unspecified ::, it is not a valid
unicast address to be assigned to any node. If the address is loopback address
::1, it is also not a valid unicast address to be assigned to any physical
interface.
@param[in] Ip6 The IPv6 address to check against.
@return TRUE if Ip6 is a valid unicast address on the network, otherwise FALSE.
**/
BOOLEAN
Ip6IsValidUnicast (
IN EFI_IPv6_ADDRESS *Ip6
);
extern IP4_ADDR gIp4AllMasks[IP4_MASK_NUM]; extern IP4_ADDR gIp4AllMasks[IP4_MASK_NUM];

File diff suppressed because it is too large Load Diff

View File

@ -203,6 +203,46 @@ Ip4IsUnicast (
return TRUE; return TRUE;
} }
/**
Check whether the incoming IPv6 address is a valid unicast address.
If the address is a multicast address has binary 0xFF at the start, it is not
a valid unicast address. If the address is unspecified ::, it is not a valid
unicast address to be assigned to any node. If the address is loopback address
::1, it is also not a valid unicast address to be assigned to any physical
interface.
@param[in] Ip6 The IPv6 address to check against.
@return TRUE if Ip6 is a valid unicast address on the network, otherwise FALSE.
**/
BOOLEAN
Ip6IsValidUnicast (
IN EFI_IPv6_ADDRESS *Ip6
)
{
UINT8 t;
UINT8 i;
if (Ip6->Addr[0] == 0xFF) {
return FALSE;
}
for (i = 0; i < 15; i++) {
if (Ip6->Addr[i] != 0) {
return TRUE;
}
}
t = Ip6->Addr[i];
if (t == 0x0 || t == 0x1) {
return FALSE;
}
return TRUE;
}
/** /**
Initialize a random seed using current time. Initialize a random seed using current time.

View File

@ -1,7 +1,7 @@
/** @file /** @file
Tcp request dispatcher implementation. Tcp request dispatcher implementation.
Copyright (c) 2005 - 2006, Intel Corporation<BR> Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -357,7 +357,7 @@ Tcp4ConfigurePcb (
// //
// Add Ip for send pkt to the peer // Add Ip for send pkt to the peer
// //
CopyMem (&IpCfgData, &mIpIoDefaultIpConfigData, sizeof (IpCfgData)); CopyMem (&IpCfgData, &mIp4IoDefaultIpConfigData, sizeof (IpCfgData));
IpCfgData.DefaultProtocol = EFI_IP_PROTO_TCP; IpCfgData.DefaultProtocol = EFI_IP_PROTO_TCP;
IpCfgData.UseDefaultAddress = CfgData->AccessPoint.UseDefaultAddress; IpCfgData.UseDefaultAddress = CfgData->AccessPoint.UseDefaultAddress;
IpCfgData.StationAddress = CfgData->AccessPoint.StationAddress; IpCfgData.StationAddress = CfgData->AccessPoint.StationAddress;
@ -605,7 +605,7 @@ Tcp4Dispatcher (
switch (Request) { switch (Request) {
case SOCK_POLL: case SOCK_POLL:
Ip = ProtoData->TcpService->IpIo->Ip; Ip = (EFI_IP4_PROTOCOL *) (ProtoData->TcpService->IpIo->Ip);
Ip->Poll (Ip); Ip->Poll (Ip);
break; break;

View File

@ -1,7 +1,7 @@
/** @file /** @file
Tcp driver function. Tcp driver function.
Copyright (c) 2005 - 2007, Intel Corporation<BR> Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -303,7 +303,11 @@ Tcp4DriverBindingStart (
// //
// Create a new IP IO to Consume it // Create a new IP IO to Consume it
// //
TcpServiceData->IpIo = IpIoCreate (This->DriverBindingHandle, ControllerHandle); TcpServiceData->IpIo = IpIoCreate (
This->DriverBindingHandle,
ControllerHandle,
IP_VERSION_4
);
if (NULL == TcpServiceData->IpIo) { if (NULL == TcpServiceData->IpIo) {
DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough" DEBUG ((EFI_D_ERROR, "Tcp4DriverBindingStart: Have no enough"
@ -318,8 +322,13 @@ Tcp4DriverBindingStart (
// //
ZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA)); ZeroMem (&OpenData, sizeof (IP_IO_OPEN_DATA));
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData)); CopyMem (
OpenData.IpConfigData.DefaultProtocol = EFI_IP_PROTO_TCP; &OpenData.IpConfigData.Ip4CfgData,
&mIp4IoDefaultIpConfigData,
sizeof (EFI_IP4_CONFIG_DATA)
);
OpenData.IpConfigData.Ip4CfgData.DefaultProtocol = EFI_IP_PROTO_TCP;
OpenData.PktRcvdNotify = Tcp4RxCallback; OpenData.PktRcvdNotify = Tcp4RxCallback;
Status = IpIoOpen (TcpServiceData->IpIo, &OpenData); Status = IpIoOpen (TcpServiceData->IpIo, &OpenData);

View File

@ -2,7 +2,7 @@
# Component name for module Tcp4 # Component name for module Tcp4
# #
# FIX ME! # FIX ME!
# Copyright (c) 2006, Intel Corporation. # Copyright (c) 2006 - 2009, Intel Corporation.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -77,3 +77,6 @@
gEfiTcp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiTcp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiTcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiTcp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp6ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp6ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED

View File

@ -1,7 +1,7 @@
/** @file /** @file
TCP input process routines. TCP input process routines.
Copyright (c) 2005 - 2007, Intel Corporation<BR> Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -1441,7 +1441,12 @@ TcpIcmpInput (
goto CLEAN_EXIT; goto CLEAN_EXIT;
} }
IcmpErrStatus = IpIoGetIcmpErrStatus (IcmpErr, &IcmpErrIsHard, &IcmpErrNotify); IcmpErrStatus = IpIoGetIcmpErrStatus (
IcmpErr,
IP_VERSION_4,
&IcmpErrIsHard,
&IcmpErrNotify
);
if (IcmpErrNotify) { if (IcmpErrNotify) {

View File

@ -1,7 +1,7 @@
/** @file /** @file
I/O interfaces between TCP and IpIo. I/O interfaces between TCP and IpIo.
Copyright (c) 2005 - 2006, Intel Corporation<BR> Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -37,9 +37,9 @@ Tcp4RxCallback (
) )
{ {
if (EFI_SUCCESS == Status) { if (EFI_SUCCESS == Status) {
TcpInput (Pkt, NetSession->Source, NetSession->Dest); TcpInput (Pkt, NetSession->Source.Addr[0], NetSession->Dest.Addr[0]);
} else { } else {
TcpIcmpInput (Pkt, IcmpErr, NetSession->Source, NetSession->Dest); TcpIcmpInput (Pkt, IcmpErr, NetSession->Source.Addr[0], NetSession->Dest.Addr[0]);
} }
} }
@ -70,11 +70,16 @@ TcpSendIpPacket (
SOCKET *Sock; SOCKET *Sock;
VOID *IpSender; VOID *IpSender;
TCP4_PROTO_DATA *TcpProto; TCP4_PROTO_DATA *TcpProto;
EFI_IP_ADDRESS Source;
EFI_IP_ADDRESS Destination;
Source.Addr[0] = Src;
Destination.Addr[0] = Dest;
if (NULL == Tcb) { if (NULL == Tcb) {
IpIo = NULL; IpIo = NULL;
IpSender = IpIoFindSender (&IpIo, Src); IpSender = IpIoFindSender (&IpIo, IP_VERSION_4, &Source);
if (IpSender == NULL) { if (IpSender == NULL) {
DEBUG ((EFI_D_WARN, "TcpSendIpPacket: No appropriate IpSender.\n")); DEBUG ((EFI_D_WARN, "TcpSendIpPacket: No appropriate IpSender.\n"));
@ -88,14 +93,14 @@ TcpSendIpPacket (
IpSender = Tcb->IpInfo; IpSender = Tcb->IpInfo;
} }
Override.TypeOfService = 0; Override.Ip4OverrideData.TypeOfService = 0;
Override.TimeToLive = 255; Override.Ip4OverrideData.TimeToLive = 255;
Override.DoNotFragment = FALSE; Override.Ip4OverrideData.DoNotFragment = FALSE;
Override.Protocol = EFI_IP_PROTO_TCP; Override.Ip4OverrideData.Protocol = EFI_IP_PROTO_TCP;
ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS)); ZeroMem (&Override.Ip4OverrideData.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
CopyMem (&Override.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Override.Ip4OverrideData.SourceAddress, &Src, sizeof (EFI_IPv4_ADDRESS));
Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, Dest, &Override); Status = IpIoSend (IpIo, Nbuf, IpSender, NULL, NULL, &Destination, &Override);
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {
DEBUG ((EFI_D_ERROR, "TcpSendIpPacket: return %r error\n", Status)); DEBUG ((EFI_D_ERROR, "TcpSendIpPacket: return %r error\n", Status));

View File

@ -1,7 +1,7 @@
/** @file /** @file
Misc support routines for tcp. Misc support routines for tcp.
Copyright (c) 2005 - 2006, Intel Corporation<BR> Copyright (c) 2005 - 2009, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at which accompanies this distribution. The full text of the license may be found at
@ -478,7 +478,7 @@ TcpGetRcvMss (
ASSERT (Sock != NULL); ASSERT (Sock != NULL);
TcpProto = (TCP4_PROTO_DATA *) Sock->ProtoReserved; TcpProto = (TCP4_PROTO_DATA *) Sock->ProtoReserved;
Ip = TcpProto->TcpService->IpIo->Ip; Ip = (EFI_IP4_PROTOCOL *) (TcpProto->TcpService->IpIo->Ip);
ASSERT (Ip != NULL); ASSERT (Ip != NULL);
Ip->GetModeData (Ip, NULL, NULL, &SnpMode); Ip->GetModeData (Ip, NULL, NULL, &SnpMode);

View File

@ -2,7 +2,7 @@
# Component name for module Udp4 # Component name for module Udp4
# #
# FIX ME! # FIX ME!
# Copyright (c) 2006, Intel Corporation. # Copyright (c) 2006 - 2009, Intel Corporation.
# #
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License # are licensed and made available under the terms and conditions of the BSD License
@ -63,3 +63,6 @@
gEfiUdp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiUdp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiIp4ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED gEfiUdp4ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp6ProtocolGuid # PROTOCOL ALWAYS_CONSUMED
gEfiIp6ServiceBindingProtocolGuid # PROTOCOL ALWAYS_CONSUMED

View File

@ -270,8 +270,9 @@ Udp4CreateService (
IN EFI_HANDLE ControllerHandle IN EFI_HANDLE ControllerHandle
) )
{ {
EFI_STATUS Status; EFI_STATUS Status;
IP_IO_OPEN_DATA OpenData; IP_IO_OPEN_DATA OpenData;
EFI_IP4_CONFIG_DATA *Ip4ConfigData;
ZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA)); ZeroMem (Udp4Service, sizeof (UDP4_SERVICE_DATA));
@ -286,7 +287,7 @@ Udp4CreateService (
// //
// Create the IpIo for this service context. // Create the IpIo for this service context.
// //
Udp4Service->IpIo = IpIoCreate (ImageHandle, ControllerHandle); Udp4Service->IpIo = IpIoCreate (ImageHandle, ControllerHandle, IP_VERSION_4);
if (Udp4Service->IpIo == NULL) { if (Udp4Service->IpIo == NULL) {
return EFI_OUT_OF_RESOURCES; return EFI_OUT_OF_RESOURCES;
} }
@ -294,12 +295,13 @@ Udp4CreateService (
// //
// Set the OpenData used to open the IpIo. // Set the OpenData used to open the IpIo.
// //
CopyMem (&OpenData.IpConfigData, &mIpIoDefaultIpConfigData, sizeof (OpenData.IpConfigData)); Ip4ConfigData = &OpenData.IpConfigData.Ip4CfgData;
OpenData.IpConfigData.AcceptBroadcast = TRUE; CopyMem (Ip4ConfigData, &mIp4IoDefaultIpConfigData, sizeof (EFI_IP4_CONFIG_DATA));
OpenData.RcvdContext = (VOID *) Udp4Service; Ip4ConfigData->AcceptBroadcast = TRUE;
OpenData.SndContext = NULL; OpenData.RcvdContext = (VOID *) Udp4Service;
OpenData.PktRcvdNotify = Udp4DgramRcvd; OpenData.SndContext = NULL;
OpenData.PktSentNotify = Udp4DgramSent; OpenData.PktRcvdNotify = Udp4DgramRcvd;
OpenData.PktSentNotify = Udp4DgramSent;
// //
// Configure and start the IpIo. // Configure and start the IpIo.
@ -731,7 +733,7 @@ Udp4BuildIp4ConfigData (
IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData IN OUT EFI_IP4_CONFIG_DATA *Ip4ConfigData
) )
{ {
CopyMem (Ip4ConfigData, &mIpIoDefaultIpConfigData, sizeof (*Ip4ConfigData)); CopyMem (Ip4ConfigData, &mIp4IoDefaultIpConfigData, sizeof (*Ip4ConfigData));
Ip4ConfigData->DefaultProtocol = EFI_IP_PROTO_UDP; Ip4ConfigData->DefaultProtocol = EFI_IP_PROTO_UDP;
Ip4ConfigData->AcceptBroadcast = Udp4ConfigData->AcceptBroadcast; Ip4ConfigData->AcceptBroadcast = Udp4ConfigData->AcceptBroadcast;
@ -1592,7 +1594,7 @@ Udp4Demultiplex (
IN NET_BUF *Packet IN NET_BUF *Packet
) )
{ {
EFI_UDP4_HEADER *Udp4Header; EFI_UDP_HEADER *Udp4Header;
UINT16 HeadSum; UINT16 HeadSum;
EFI_UDP4_RECEIVE_DATA RxData; EFI_UDP4_RECEIVE_DATA RxData;
EFI_UDP4_SESSION_DATA *Udp4Session; EFI_UDP4_SESSION_DATA *Udp4Session;
@ -1601,15 +1603,15 @@ Udp4Demultiplex (
// //
// Get the datagram header from the packet buffer. // Get the datagram header from the packet buffer.
// //
Udp4Header = (EFI_UDP4_HEADER *) NetbufGetByte (Packet, 0, NULL); Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);
if (Udp4Header->Checksum != 0) { if (Udp4Header->Checksum != 0) {
// //
// check the checksum. // check the checksum.
// //
HeadSum = NetPseudoHeadChecksum ( HeadSum = NetPseudoHeadChecksum (
NetSession->Source, NetSession->Source.Addr[0],
NetSession->Dest, NetSession->Dest.Addr[0],
EFI_IP_PROTO_UDP, EFI_IP_PROTO_UDP,
0 0
); );
@ -1689,7 +1691,7 @@ Udp4SendPortUnreach (
IP_IO_OVERRIDE Override; IP_IO_OVERRIDE Override;
IP_IO_IP_INFO *IpSender; IP_IO_IP_INFO *IpSender;
IpSender = IpIoFindSender (&IpIo, NetSession->Dest); IpSender = IpIoFindSender (&IpIo, NetSession->IpVersion, &NetSession->Dest);
if (IpSender == NULL) { if (IpSender == NULL) {
// //
// No apropriate sender, since we cannot send out the ICMP message through // No apropriate sender, since we cannot send out the ICMP message through
@ -1698,7 +1700,7 @@ Udp4SendPortUnreach (
return; return;
} }
IpHdr = NetSession->IpHdr; IpHdr = NetSession->IpHdr.Ip4Hdr;
// //
// Calculate the requried length of the icmp error message. // Calculate the requried length of the icmp error message.
@ -1747,18 +1749,18 @@ Udp4SendPortUnreach (
// //
// Fill the override data. // Fill the override data.
// //
Override.DoNotFragment = FALSE; Override.Ip4OverrideData.DoNotFragment = FALSE;
Override.TypeOfService = 0; Override.Ip4OverrideData.TypeOfService = 0;
Override.TimeToLive = 255; Override.Ip4OverrideData.TimeToLive = 255;
Override.Protocol = EFI_IP_PROTO_ICMP; Override.Ip4OverrideData.Protocol = EFI_IP_PROTO_ICMP;
CopyMem (&Override.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Override.Ip4OverrideData.SourceAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS)); ZeroMem (&Override.Ip4OverrideData.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
// //
// Send out this icmp packet. // Send out this icmp packet.
// //
IpIoSend (IpIo, Packet, IpSender, NULL, NULL, NetSession->Source, &Override); IpIoSend (IpIo, Packet, IpSender, NULL, NULL, &NetSession->Source, &Override);
NetbufFree (Packet); NetbufFree (Packet);
} }
@ -1783,12 +1785,12 @@ Udp4IcmpHandler (
IN NET_BUF *Packet IN NET_BUF *Packet
) )
{ {
EFI_UDP4_HEADER *Udp4Header; EFI_UDP_HEADER *Udp4Header;
EFI_UDP4_SESSION_DATA Udp4Session; EFI_UDP4_SESSION_DATA Udp4Session;
LIST_ENTRY *Entry; LIST_ENTRY *Entry;
UDP4_INSTANCE_DATA *Instance; UDP4_INSTANCE_DATA *Instance;
Udp4Header = (EFI_UDP4_HEADER *) NetbufGetByte (Packet, 0, NULL); Udp4Header = (EFI_UDP_HEADER *) NetbufGetByte (Packet, 0, NULL);
CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Udp4Session.SourceAddress, &NetSession->Source, sizeof (EFI_IPv4_ADDRESS));
CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Udp4Session.DestinationAddress, &NetSession->Dest, sizeof (EFI_IPv4_ADDRESS));
@ -1819,7 +1821,7 @@ Udp4IcmpHandler (
// //
// Translate the Icmp Error code according to the udp spec. // Translate the Icmp Error code according to the udp spec.
// //
Instance->IcmpError = IpIoGetIcmpErrStatus (IcmpError, NULL, NULL); Instance->IcmpError = IpIoGetIcmpErrStatus (IcmpError, IP_VERSION_4, NULL, NULL);
if (IcmpError > ICMP_ERR_UNREACH_PORT) { if (IcmpError > ICMP_ERR_UNREACH_PORT) {
Instance->IcmpError = EFI_ICMP_ERROR; Instance->IcmpError = EFI_ICMP_ERROR;

View File

@ -45,7 +45,7 @@ extern UINT16 mUdp4RandomPort;
#define UDP4_TIMEOUT_INTERVAL (50 * TICKS_PER_MS) // 50 milliseconds #define UDP4_TIMEOUT_INTERVAL (50 * TICKS_PER_MS) // 50 milliseconds
#define UDP4_HEADER_SIZE sizeof (EFI_UDP4_HEADER) #define UDP4_HEADER_SIZE sizeof (EFI_UDP_HEADER)
#define UDP4_MAX_DATA_SIZE 65507 #define UDP4_MAX_DATA_SIZE 65507
#define UDP4_PORT_KNOWN 1024 #define UDP4_PORT_KNOWN 1024

View File

@ -507,7 +507,7 @@ Udp4Transmit (
UDP4_INSTANCE_DATA *Instance; UDP4_INSTANCE_DATA *Instance;
EFI_TPL OldTpl; EFI_TPL OldTpl;
NET_BUF *Packet; NET_BUF *Packet;
EFI_UDP4_HEADER *Udp4Header; EFI_UDP_HEADER *Udp4Header;
EFI_UDP4_CONFIG_DATA *ConfigData; EFI_UDP4_CONFIG_DATA *ConfigData;
IP4_ADDR Source; IP4_ADDR Source;
IP4_ADDR Destination; IP4_ADDR Destination;
@ -516,6 +516,7 @@ Udp4Transmit (
UDP4_SERVICE_DATA *Udp4Service; UDP4_SERVICE_DATA *Udp4Service;
IP_IO_OVERRIDE Override; IP_IO_OVERRIDE Override;
UINT16 HeadSum; UINT16 HeadSum;
EFI_IP_ADDRESS IpDestAddr;
if ((This == NULL) || (Token == NULL)) { if ((This == NULL) || (Token == NULL)) {
return EFI_INVALID_PARAMETER; return EFI_INVALID_PARAMETER;
@ -575,7 +576,7 @@ Udp4Transmit (
Udp4Service = Instance->Udp4Service; Udp4Service = Instance->Udp4Service;
*((UINTN *) &Packet->ProtoData[0]) = (UINTN) (Udp4Service->IpIo); *((UINTN *) &Packet->ProtoData[0]) = (UINTN) (Udp4Service->IpIo);
Udp4Header = (EFI_UDP4_HEADER *) NetbufAllocSpace (Packet, UDP4_HEADER_SIZE, TRUE); Udp4Header = (EFI_UDP_HEADER *) NetbufAllocSpace (Packet, UDP4_HEADER_SIZE, TRUE);
ASSERT (Udp4Header != NULL); ASSERT (Udp4Header != NULL);
ConfigData = &Instance->ConfigData; ConfigData = &Instance->ConfigData;
@ -589,7 +590,7 @@ Udp4Transmit (
Udp4Header->Checksum = 0; Udp4Header->Checksum = 0;
UdpSessionData = TxData->UdpSessionData; UdpSessionData = TxData->UdpSessionData;
Override.SourceAddress = ConfigData->StationAddress; Override.Ip4OverrideData.SourceAddress = ConfigData->StationAddress;
if (UdpSessionData != NULL) { if (UdpSessionData != NULL) {
// //
@ -597,7 +598,7 @@ Udp4Transmit (
// UdpSessionData. // UdpSessionData.
// //
if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) { if (!EFI_IP4_EQUAL (&UdpSessionData->SourceAddress, &mZeroIp4Addr)) {
CopyMem (&Override.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Override.Ip4OverrideData.SourceAddress, &UdpSessionData->SourceAddress, sizeof (EFI_IPv4_ADDRESS));
} }
if (UdpSessionData->SourcePort != 0) { if (UdpSessionData->SourcePort != 0) {
@ -608,7 +609,7 @@ Udp4Transmit (
Udp4Header->DstPort = HTONS (UdpSessionData->DestinationPort); Udp4Header->DstPort = HTONS (UdpSessionData->DestinationPort);
} }
CopyMem (&Source, &Override.SourceAddress, sizeof (IP4_ADDR)); CopyMem (&Source, &Override.Ip4OverrideData.SourceAddress, sizeof (IP4_ADDR));
CopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR)); CopyMem (&Destination, &UdpSessionData->DestinationAddress, sizeof (IP4_ADDR));
// //
@ -644,15 +645,15 @@ Udp4Transmit (
// Fill the IpIo Override data. // Fill the IpIo Override data.
// //
if (TxData->GatewayAddress != NULL) { if (TxData->GatewayAddress != NULL) {
CopyMem (&Override.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS)); CopyMem (&Override.Ip4OverrideData.GatewayAddress, TxData->GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
} else { } else {
ZeroMem (&Override.GatewayAddress, sizeof (EFI_IPv4_ADDRESS)); ZeroMem (&Override.Ip4OverrideData.GatewayAddress, sizeof (EFI_IPv4_ADDRESS));
} }
Override.Protocol = EFI_IP_PROTO_UDP; Override.Ip4OverrideData.Protocol = EFI_IP_PROTO_UDP;
Override.TypeOfService = ConfigData->TypeOfService; Override.Ip4OverrideData.TypeOfService = ConfigData->TypeOfService;
Override.TimeToLive = ConfigData->TimeToLive; Override.Ip4OverrideData.TimeToLive = ConfigData->TimeToLive;
Override.DoNotFragment = ConfigData->DoNotFragment; Override.Ip4OverrideData.DoNotFragment = ConfigData->DoNotFragment;
// //
// Save the token into the TxToken map. // Save the token into the TxToken map.
@ -665,13 +666,14 @@ Udp4Transmit (
// //
// Send out this datagram through IpIo. // Send out this datagram through IpIo.
// //
IpDestAddr.Addr[0] = Destination;
Status = IpIoSend ( Status = IpIoSend (
Udp4Service->IpIo, Udp4Service->IpIo,
Packet, Packet,
Instance->IpInfo, Instance->IpInfo,
Instance, Instance,
Token, Token,
Destination, &IpDestAddr,
&Override &Override
); );
if (EFI_ERROR (Status)) { if (EFI_ERROR (Status)) {