face: send and receive NACK
refs #2930
Change-Id: I70c969ac12b493d2c83fa892beffae936cc23791
diff --git a/src/lp/packet.cpp b/src/lp/packet.cpp
index 67957af..82b7821 100644
--- a/src/lp/packet.cpp
+++ b/src/lp/packet.cpp
@@ -63,13 +63,21 @@
template size_t
Packet::wireEncode<encoding::EstimatorTag>(EncodingImpl<encoding::EstimatorTag>& encoder) const;
-const Block&
+const Block
Packet::wireEncode() const
{
if (m_wire.hasWire()) {
return m_wire;
}
+ // If no header or trailer, return bare network packet
+ Block::element_container elements = m_wire.elements();
+ if (elements.size() == 1 && elements.front().type() == FragmentField::TlvType::value) {
+ elements.front().parse();
+ elements.front().elements().front().parse();
+ return elements.front().elements().front();
+ }
+
EncodingEstimator estimator;
size_t estimatedSize = wireEncode(estimator);