Skip to content

Commit e659f2c

Browse files
IPv6Header: fix FlowLabel field size
Following the RFC6437 [1] flow lable from IPv6 is a 20 bits field, this is setting the correct number of bits for both setter and getter in the ipv6 header [1] https://www.rfc-editor.org/rfc/rfc6437 Signed-off-by: Raslan Darawsheh <rasland@nvidia.com>
1 parent cc01743 commit e659f2c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/common/Network/Packet/IPv6Header.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,13 +205,13 @@ IPv6Header::setTrafficClass(uint16_t argTrafficClass)
205205
//--------------------------------
206206
inline uint32_t IPv6Header::getFlowLabel()
207207
{
208-
return getMaskBit32(PKT_NTOHL(myVer_TrafficClass_FlowLabel), 12, 31);
208+
return getMaskBit32(PKT_NTOHL(myVer_TrafficClass_FlowLabel), 20, 31);
209209
}
210210

211211
inline void IPv6Header::setFlowLabel(uint32_t argFlowLabel)
212212
{
213213
uint32_t myFlowLabel = PKT_HTONL(myVer_TrafficClass_FlowLabel);
214-
setMaskBit32(myFlowLabel, 12, 31, argFlowLabel);
214+
setMaskBit32(myFlowLabel, 20, 31, argFlowLabel);
215215
myVer_TrafficClass_FlowLabel = PKT_NTOHL(myFlowLabel);
216216
}
217217

0 commit comments

Comments
 (0)