diff options
author | Mauro Sardara <msardara@cisco.com> | 2019-06-06 17:34:47 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2019-06-06 17:34:47 +0000 |
commit | 2d555daf9034459ec5ef20f7d63cccd25c6c4b0c (patch) | |
tree | 243fa1779ac9d3ac64733fda847e1ccff66ad1f4 /hicn-plugin/src/parser.h | |
parent | b1933e1c8e2988975ad8a5d9bddad300f3df485f (diff) | |
parent | 8400addd9e21b9ba5a7e210f2cd27842dbf8cd38 (diff) |
Merge "[HICN-212] Fixed bug on ipv6 test in udp faces. Uniformed test with a single function."
Diffstat (limited to 'hicn-plugin/src/parser.h')
-rw-r--r-- | hicn-plugin/src/parser.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/hicn-plugin/src/parser.h b/hicn-plugin/src/parser.h index cbc5696ba..0d72780ae 100644 --- a/hicn-plugin/src/parser.h +++ b/hicn-plugin/src/parser.h @@ -42,8 +42,7 @@ hicn_interest_parse_pkt (vlib_buffer_t * pkt, hicn_name_t * name, hicn_header_t *pkt_hdr = vlib_buffer_get_current (pkt); *pkt_hdrp = pkt_hdr; u8 *ip_pkt = vlib_buffer_get_current (pkt); - u8 version = (pkt_hdr->v4.ip.version_ihl & 0xf0) >> 4; - *isv6 = ((version & 2) >> 1); + *isv6 = hicn_is_v6 (pkt_hdr); u8 ip_proto = (*isv6) * IPPROTO_IPV6; u8 next_proto_offset = 6 + (1 - *isv6) * 3; //in the ipv6 header the next header field is at byte 6 @@ -72,8 +71,7 @@ hicn_data_parse_pkt (vlib_buffer_t * pkt, hicn_name_t * name, *pkt_hdrp = pkt_hdr; *pkt_hdrp = pkt_hdr; u8 *ip_pkt = vlib_buffer_get_current (pkt); - u8 version = (pkt_hdr->v4.ip.version_ihl & 0xf0) >> 4; - *isv6 = ((version & 2) >> 1); + *isv6 = hicn_is_v6 (pkt_hdr); u8 ip_proto = (*isv6) * IPPROTO_IPV6; /* * in the ipv6 header the next header field is at byte 6 in the ipv4 |