From 03ad7f3ae74816a2dcd23f88fbbdead4d8bd435f Mon Sep 17 00:00:00 2001 From: Matias Fontanini Date: Thu, 31 Dec 2015 06:18:44 -0800 Subject: [PATCH] Fix big endian issue on MPLS --- src/mpls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mpls.cpp b/src/mpls.cpp index 92cb2bd..1854a5b 100644 --- a/src/mpls.cpp +++ b/src/mpls.cpp @@ -63,7 +63,7 @@ MPLS::MPLS(const uint8_t* buffer, uint32_t total_sz) { void MPLS::label(small_uint<20> value) { const uint32_t label_value = value; const uint16_t label_high = Endian::host_to_be(label_value >> 4); - const uint8_t label_low = (Endian::host_to_be(label_value) >> 20) & 0xf0; + const uint8_t label_low = (label_value << 4) & 0xf0; header_.label_high = label_high & 0xffff; header_.label_low_and_bottom = (header_.label_low_and_bottom & 0x0f) | label_low; }