- } else if (IP4_IS_MULTICAST (Dest)) {\r
- //\r
- // Set the gateway to the destination if it is an multicast\r
- // address. The IP4_INTERFACE won't consult ARP to send local\r
- // broadcast and multicast.\r
- //\r
- GateWay = Head->Dst;\r
+ //\r
+ // Call IPsec process.\r
+ //\r
+ Status = Ip4IpSecProcessPacket (\r
+ IpSb,\r
+ &Head,\r
+ &Packet,\r
+ &Option,\r
+ &OptLen,\r
+ EfiIPsecOutBound,\r
+ Context\r
+ );\r
+\r
+ if (EFI_ERROR(Status)) {\r
+ return Status;\r
+ }\r
+\r
+ Dest = Head->Dst;\r
+ if (IP4_IS_BROADCAST (Ip4GetNetCast (Dest, IpIf)) || (Dest == IP4_ALLONE_ADDRESS)) {\r
+ //\r
+ // Set the gateway to local broadcast if the Dest is\r
+ // the broadcast address for the connected network or\r
+ // it is local broadcast.\r
+ //\r
+ GateWay = IP4_ALLONE_ADDRESS;\r
+\r
+ } else if (IP4_IS_MULTICAST (Dest)) {\r
+ //\r
+ // Set the gateway to the destination if it is an multicast\r
+ // address. The IP4_INTERFACE won't consult ARP to send local\r
+ // broadcast and multicast.\r
+ //\r
+ GateWay = Head->Dst;\r