NetworkPkg: Dhcp6Dxe: Packet-Length is not updated before appending

In order for Dhcp6AppendIaAddrOption (..) to safely append the IA
Address option, the Packet-Length field must be updated before appending
the option.

Cc: Saloni Kasbekar <saloni.kasbekar@intel.com>
Cc: Zachary Clark-williams <zachary.clark-williams@intel.com>
Signed-off-by: Doug Flick [MSFT] <doug.edk2@gmail.com>
Reviewed-by: Saloni Kasbekar <saloni.kasbekar@intel.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
This commit is contained in:
Doug Flick 2024-02-13 10:46:02 -08:00 committed by mergify[bot]
parent af3fad99d6
commit 75deaf5c3c
1 changed files with 5 additions and 5 deletions

View File

@ -924,6 +924,11 @@ Dhcp6AppendIaOption (
*PacketCursor += sizeof (T2);
}
//
// Update the packet length
//
Packet->Length += BytesNeeded;
//
// Fill all the addresses belong to the Ia
//
@ -935,11 +940,6 @@ Dhcp6AppendIaOption (
}
}
//
// Update the packet length
//
Packet->Length += BytesNeeded;
//
// Fill the value of Ia option length
//