Skip to content

Commit

Permalink
Fix vlan pcp parsing.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eder Leão Fernandes committed Dec 17, 2014
1 parent 80ffd77 commit 58fc961
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions nbee_link/nbee_link.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,11 @@ int nblink_extract_proto_fields(struct ofpbuf * pktin, _nbPDMLField * field, str
ofl_structs_match_put16(pktout, header, m_value);
}
else if (header == OXM_OF_VLAN_PCP){
uint8_t m_value;
sscanf(field->Value, "%hhx", &m_value);
m_value = (m_value & VLAN_PCP_MASK) >> VLAN_PCP_SHIFT;
ofl_structs_match_put8(pktout, header, m_value);
uint16_t m_value;
uint8_t vlan_pcp;
sscanf(field->Value, "%hx", &m_value);
vlan_pcp = (m_value & VLAN_PCP_MASK) >> VLAN_PCP_SHIFT;
ofl_structs_match_put8(pktout, header, vlan_pcp);
}
else if(header == OXM_OF_IP_DSCP){
uint8_t m_value;
Expand Down

0 comments on commit 58fc961

Please sign in to comment.