Upon encapsulation of L2 frames, IETF has replaced the NextHeader value from 59 (IPv6 No Next Header) to 143 (Ethernet).
https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
Type: fix
Signed-off-by: pcamaril <pcamaril@cisco.com>
Change-Id: I88aa5590c81d16700ff7a0bbe6337e113179496e
Signed-off-by: pcamaril <pcamaril@cisco.com>
/* Make sure next header is valid */
if (PREDICT_FALSE (next_hdr != IP_PROTOCOL_IPV6 &&
next_hdr != IP_PROTOCOL_IP_IN_IP &&
- next_hdr != IP_PROTOCOL_IP6_NONXT))
+ next_hdr != IP_PROTOCOL_IP6_ETHERNET))
{
return;
}
/* Remove IP header and extensions */
vlib_buffer_advance (b0, total_size);
- if (next_hdr == IP_PROTOCOL_IP6_NONXT)
+ if (next_hdr == IP_PROTOCOL_IP6_ETHERNET)
{
/* Set output interface */
vnet_buffer (b0)->sw_if_index[VLIB_TX] = ls0_mem->sw_if_index_out;
p = IPv6(src=srcaddr, dst=sidlist[segleft]) / \
IPv6ExtHdrSegmentRouting(addresses=sidlist,
- segleft=segleft, nh=59) / \
+ segleft=segleft, nh=143) / \
eth
return p
self.assertEqual(rx_srh.segleft, len(tx_seglist)-1)
# segleft should be equal to lastentry
self.assertEqual(rx_srh.segleft, rx_srh.lastentry)
- # nh should be "No Next Header" (59)
- self.assertEqual(rx_srh.nh, 59)
+ # nh should be "No Next Header" (143)
+ self.assertEqual(rx_srh.nh, 143)
# the whole rx'ed pkt beyond SRH should be equal to tx'ed pkt
self.assertEqual(Ether(scapy.compat.raw(rx_srh.payload)), tx_ether)
p = (IPv6(src='1234::1', dst=sidlist[segleft]) /
IPv6ExtHdrSegmentRouting(addresses=sidlist,
- segleft=segleft, nh=59) /
+ segleft=segleft, nh=143) /
eth)
return p
else:
eth.type = etype
- p = (IPv6(src='1234::1', dst=dst_outer, nh=59) / eth)
+ p = (IPv6(src='1234::1', dst=dst_outer, nh=143) / eth)
return p
def get_payload_info(self, packet):
/* Prepare rewrite string */
ls_mem->rewrite = prepare_rewrite (ls_mem->src_addr, ls_mem->sid_list,
- IP_PROTOCOL_IP6_NONXT);
+ IP_PROTOCOL_IP6_ETHERNET);
/* Associate local SID index to this interface (resize vector if needed) */
if (ls_mem->sw_if_index_in >= vec_len (sm->sw_iface_localsid2))
/* Make sure next header is valid */
if (PREDICT_FALSE (hdr_type != IP_PROTOCOL_IPV6 &&
hdr_type != IP_PROTOCOL_IP_IN_IP &&
- hdr_type != IP_PROTOCOL_IP6_NONXT))
+ hdr_type != IP_PROTOCOL_IP6_ETHERNET))
{
return;
}
/* Remove IP header and extensions */
vlib_buffer_advance (b0, encap_len);
- if (hdr_type == IP_PROTOCOL_IP6_NONXT)
+ if (hdr_type == IP_PROTOCOL_IP6_ETHERNET)
{
/* Set output interface */
vnet_buffer (b0)->sw_if_index[VLIB_TX] = ls0_mem->sw_if_index_out;
self.assertEqual(rx_srh.segleft, len(tx_seglist)-1)
# segleft should be equal to lastentry
self.assertEqual(rx_srh.segleft, rx_srh.lastentry)
- # nh should be "No Next Header" (59)
- self.assertEqual(rx_srh.nh, 59)
+ # nh should be "No Next Header" (143)
+ self.assertEqual(rx_srh.nh, 143)
# get payload
payload = rx_srh.payload
else:
p = (IPv6(src='1234::1', dst=sidlist[segleft]) /
IPv6ExtHdrSegmentRouting(addresses=sidlist,
- segleft=segleft, nh=59) /
+ segleft=segleft, nh=143) /
eth)
return p
#define SRV6_NHTYPE_IPV6 2
#define SRV6_NHTYPE_NON_IP 3
-#ifndef IP_PROTOCOL_NONE
-#define IP_PROTOCOL_NONE 59
+#ifndef IP_PROTOCOL_IP6_ETHERNET
+#define IP_PROTOCOL_IP6_ETHERNET 143
#endif
#define SRV6_GTP6_UNKNOW 0
}
else if (ls_param->nhtype == SRV6_NHTYPE_NON_IP)
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
else
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
else
{
ip6srv->ip.protocol = IP_PROTOCOL_IPV6_ROUTE;
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
ip6srv->sr.tag =
clib_host_to_net_u16 (srh_tagfield[gtpu_type]);
}
else if (ls_param->nhtype == SRV6_NHTYPE_NON_IP)
{
- ip6srv->ip.protocol = IP_PROTOCOL_NONE;
+ ip6srv->ip.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
}
}
else if (ls_param->nhtype == SRV6_NHTYPE_NON_IP)
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
else
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
else
{
ip6srv->ip.protocol = IP_PROTOCOL_IPV6_ROUTE;
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
ip6srv->sr.tag =
clib_host_to_net_u16 (srh_tagfield[gtpu_type]);
}
else if (ls_param->nhtype == SRV6_NHTYPE_NON_IP)
{
- ip6srv->ip.protocol = IP_PROTOCOL_NONE;
+ ip6srv->ip.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
}
}
else if (ls_param->nhtype == SRV6_NHTYPE_NON_IP)
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
}
else
{
- ip6srv->sr.protocol = IP_PROTOCOL_NONE;
+ ip6srv->sr.protocol = IP_PROTOCOL_IP6_ETHERNET;
}
good_n++;
ip_protocol (140, SHIM6)
ip_protocol (141, WESP)
ip_protocol (142, ROHC)
+ip_protocol (143, IP6_ETHERNET)
-/* unassigned 143 - 252 */
+/* unassigned 144 - 252 */
ip_protocol (253, EXP1)
ip_protocol (254, EXP2)
return;
}
break;
- case IP_PROTOCOL_IP6_NONXT:
+ case IP_PROTOCOL_IP6_ETHERNET:
/* L2 encaps */
if (ls0->behavior == SR_BEHAVIOR_DX2)
{
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr0 = (void *) (ip0 + 1);
- sr0->protocol = IP_PROTOCOL_IP6_NONXT;
+ sr0->protocol = IP_PROTOCOL_IP6_ETHERNET;
}
else
- ip0->protocol = IP_PROTOCOL_IP6_NONXT;
+ ip0->protocol = IP_PROTOCOL_IP6_ETHERNET;
if (ip1->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr1 = (void *) (ip1 + 1);
- sr1->protocol = IP_PROTOCOL_IP6_NONXT;
+ sr1->protocol = IP_PROTOCOL_IP6_ETHERNET;
}
else
- ip1->protocol = IP_PROTOCOL_IP6_NONXT;
+ ip1->protocol = IP_PROTOCOL_IP6_ETHERNET;
if (ip2->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr2 = (void *) (ip2 + 1);
- sr2->protocol = IP_PROTOCOL_IP6_NONXT;
+ sr2->protocol = IP_PROTOCOL_IP6_ETHERNET;
}
else
- ip2->protocol = IP_PROTOCOL_IP6_NONXT;
+ ip2->protocol = IP_PROTOCOL_IP6_ETHERNET;
if (ip3->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr3 = (void *) (ip3 + 1);
- sr3->protocol = IP_PROTOCOL_IP6_NONXT;
+ sr3->protocol = IP_PROTOCOL_IP6_ETHERNET;
}
else
- ip3->protocol = IP_PROTOCOL_IP6_NONXT;
+ ip3->protocol = IP_PROTOCOL_IP6_ETHERNET;
/* Which Traffic class and flow label do I set ? */
//ip0->ip_version_traffic_class_and_flow_label = clib_host_to_net_u32(0|((6&0xF)<<28)|((ip0_encap->tos&0xFF)<<20));
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr0 = (void *) (ip0 + 1);
- sr0->protocol = IP_PROTOCOL_IP6_NONXT;
+ sr0->protocol = IP_PROTOCOL_IP6_ETHERNET;
}
else
- ip0->protocol = IP_PROTOCOL_IP6_NONXT;
+ ip0->protocol = IP_PROTOCOL_IP6_ETHERNET;
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))
+ # +-+-+-+-+-+-+-+-+
+
+ name = "IPv6 Segment Routing Extension Header"
-+ fields_desc = [ ByteEnumField("nh", 59, ipv6nh),
++ fields_desc = [ ByteEnumField("nh", 143, ipv6nh),
+ ByteField("len", None),
+ ByteField("type", 4),
+ ByteField("segleft", None),