From eb5598be7c3e598c6a970f5382e178571776e471 Mon Sep 17 00:00:00 2001 From: Ben McMorran Date: Mon, 20 Apr 2015 02:45:27 -0400 Subject: [PATCH] Perserve IP protocol when using RawPDU Previously, the IP protocol field for non-fragmented packets was forcibly overwritten to the protocol of the inner PDU even if that PDU was a RawPDU. This behavior contradicts the documentation. --- src/ip.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ip.cpp b/src/ip.cpp index eb646f7..f1d6bfc 100644 --- a/src/ip.cpp +++ b/src/ip.cpp @@ -385,7 +385,7 @@ void IP::write_serialization(uint8_t *buffer, uint32_t total_sz, const PDU* pare Internals::pdu_type_to_id(inner_pdu()->pdu_type()) ); } - if(!is_fragmented() || new_flag != 0xff) + if(!is_fragmented() && new_flag != 0xff) protocol(new_flag); }