X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fsrv6-as%2Fas.c;h=1876765b8d687197068c83b18f3dd9921f8ce267;hb=2de9c0f92;hp=e771cb485efd8200775a4912852935819f943046;hpb=b02f3b7b8a1c68a974ce43c64b28625b3ca2d4a5;p=vpp.git diff --git a/src/plugins/srv6-as/as.c b/src/plugins/srv6-as/as.c index e771cb485ef..1876765b8d6 100644 --- a/src/plugins/srv6-as/as.c +++ b/src/plugins/srv6-as/as.c @@ -36,6 +36,7 @@ unsigned char def_str[] = unsigned char params_str[] = "nh oif iif src next [next ...]"; +srv6_as_main_t srv6_as_main; static inline u8 * prepare_rewrite (ip6_address_t src_addr, ip6_address_t * sid_list, @@ -63,7 +64,7 @@ prepare_rewrite (ip6_address_t src_addr, ip6_address_t * sid_list, iph->src_address = src_addr; iph->dst_address = sid_list[0]; iph->payload_length = sr_hdr_len; - iph->hop_limit = IPv6_DEFAULT_HOP_LIMIT; + iph->hop_limit = sr_get_hop_limit (); if (num_sids > 1) { @@ -76,13 +77,13 @@ prepare_rewrite (ip6_address_t src_addr, ip6_address_t * sid_list, srh->length = sr_hdr_len / 8 - 1; srh->type = ROUTING_HEADER_TYPE_SR; srh->segments_left = num_sids - 1; - srh->first_segment = num_sids - 1; + srh->last_entry = num_sids - 1; srh->flags = 0x00; - srh->reserved = 0x00; + srh->tag = 0x0000; /* Fill segment list */ ip6_address_t *this_address; - ip6_address_t *addrp = srh->segments + srh->first_segment; + ip6_address_t *addrp = srh->segments + srh->last_entry; vec_foreach (this_address, sid_list) { *addrp = *this_address; @@ -181,7 +182,7 @@ srv6_as_localsid_creation_fn (ip6_sr_localsid_t * localsid) /* 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)) @@ -462,7 +463,7 @@ unformat_srv6_as_localsid (unformat_input_t * input, va_list * args) /* Allocate and initialize memory block for local SID parameters */ ls_mem = clib_mem_alloc_aligned_at_offset (sizeof *ls_mem, 0, 0, 1); - memset (ls_mem, 0, sizeof *ls_mem); + clib_memset (ls_mem, 0, sizeof *ls_mem); *plugin_mem_p = ls_mem; /* Set local SID parameters */ @@ -534,6 +535,7 @@ srv6_as_init (vlib_main_t * vm) keyword_str, def_str, params_str, + 128, &sm->srv6_as_dpo_type, format_srv6_as_localsid, unformat_srv6_as_localsid, @@ -573,7 +575,7 @@ VLIB_INIT_FUNCTION (srv6_as_init); VLIB_PLUGIN_REGISTER () = { .version = VPP_BUILD_VER, - .description = "Static SRv6 proxy", + .description = "Static Segment Routing for IPv6 (SRv6) Proxy", }; /* *INDENT-ON* */