Compare commits

...

15 Commits

Author SHA1 Message Date
Billy McFall
bbdfeaebf2 VPP-1131: doxygen: Documentation for Debug CLI stops at src/plugin/l2e
Change-Id: I3ce014da7b514aa766a90cacddd76cd2247406a8
Signed-off-by: Billy McFall <bmcfall@redhat.com>
2018-01-10 17:00:51 -05:00
Neale Ranns
9a5e61d775 makefile set CXXFLAGS so they are propageted to sub-builds
Change-Id: I55d9953851062f7106c66701d46bcd9073cf1ee4
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit 5ee623e789261552eb9460be10f34793d40b6575)
2018-01-10 18:42:43 +00:00
Pablo Camarillo
fd66de0f31 VPP-1120 SRv6 bug with SID list containing only one SID and no srh
Packets with a SR policy of one SID list create a malformed packet.
Outer IPv6 header points to a routing extension header that does not
exist since the SID list contains only one SID.

Change-Id: I1effee0457453bab95706a8a24fdabfbd843d5b7
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-10 08:40:37 +01:00
Pablo Camarillo
d01f4e76bd VPP-1113 SR MPLS path.frp_label_stack
provide one label stack per fib_table_entry_path_add2 call. otherwise multiple mheap releases take place.

Change-Id: I475ca1b801fc85dddda0b540c69ad628a274df7f
Signed-off-by: Pablo Camarillo <pcamaril@cisco.com>
2018-01-09 21:37:11 +00:00
Hongjun Ni
c287cd550b VPP-1119: PPPoE's destination MAC was overwritten
Change-Id: I6ae99c00e76058654f2c5e71377e9fd1bd13b47b
Signed-off-by: Hongjun Ni <hongjun.ni@intel.com>
2018-01-09 17:13:00 +00:00
Neale Ranns
f453a10cd4 BIER: missing endian swap for imposition object in API return
Change-Id: Iddd754d00ace3d042336e5c2c40431566275051a
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
(cherry picked from commit eea537a288721b867d65b736363ab3f71ba6116c)
2018-01-09 17:02:17 +00:00
Neale Ranns
2b97ac55ed test: consolidate the multiple versions of send_and_*
Change-Id: I7fa7d0ebf73dab8264a2e5ddbd412600d78ead05
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 52fae862646e25bac6d1cd11b9fc7ac77299bc25)
2018-01-09 17:01:21 +00:00
Neale Ranns
12bf52bae2 BIER: crash in show command when no tables are present
Change-Id: Ie291468ea9d05c47cefe39c4ff7fea3e016bacf2
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 0e8cb6c475b616a3296b08d25bcaa1eed3ab0084)
2018-01-09 17:00:39 +00:00
John Lo
eeafbef61d GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
Follow up fix - vl_api_gre_add_del_tunnel_t_handler should pass
outer_fib_id from API message to vnet_gre_add_del_tunnel() and
not convert it to fib_index, since vnet_gre_add_del_tunnel()
already perform the lookup to get fib_index from fib_id.

Change-Id: I24967a97f82ce018ddef596e556bd3eb1706cb63
Signed-off-by: John Lo <loj@cisco.com>
2018-01-08 23:19:18 -05:00
Matus Fabian
43ad007a0c NAT: fixed get_worker_out2in bug (VPP-1116)
Change-Id: I5e080d69f28661cc0b1846885d5001526b54fbd9
Signed-off-by: Matus Fabian <matfabia@cisco.com>
2018-01-08 09:20:24 +00:00
zhaoqingling
37aa1ffae6 VPP-1110 BVI reply ARP that doesn't request BVI loacl IP.
Change-Id: I66ae618edaa12c2b4e4afe276da689673b02c9cd
Signed-off-by: zhaoqingling <zhao.qingling@zte.com.cn>
(cherry picked from commit b4c42cdc6bbbf464f3f0034b2b39d4e20fd23a25)
2018-01-07 19:39:49 +00:00
John Lo
848b47c70e Unify/cleanup usage of hash_set/unset_mem by tunnels (VPP-1117)
Move the functions hash_set_key_copy() and hash_unset_key_free()
which are dupilicated in various tunnel support code modules to
hash.h as hash_set_mem_alloc() and hash_unset_mem_free() to be
used by all.

Change-Id: I40723cabe29072ab7feb1804c221f28606d8e4fe
Signed-off-by: John Lo <loj@cisco.com>
(cherry picked from commit e6bfeab1c352ae73a19361c038e2a06a58c035db)
2018-01-06 17:34:04 +00:00
John Lo
72247c8032 GRE tunnel key should use fib_index instead of fib_id (VPP-1118)
The code path in src/vnet/gre/interface.c uses fib_id as a
component to generate hash key for GRE tunnel. This should be
fib_index as the GRE rx/decap data path will be using fib_index
to generate the hash key to lookup the GRE tunnel.

Change-Id: Ia7f0892d84f9dac79223a6e016775892b61eb5fb
Signed-off-by: John Lo <loj@cisco.com>
2018-01-06 00:22:54 -05:00
Neale Ranns
1f720c3b19 VOM: NAT coverity found bugs
Change-Id: Ic55ad2e0a1435f552ce84ed1a9b1981191bc178b
Signed-off-by: Neale Ranns <nranns@cisco.com>
(cherry picked from commit 842eb22e5d5a7e11114fe093eeccafb080e9aa8b)
2018-01-04 11:56:46 +00:00
Dave Wallace
8c2bacde4f Initial changes for stable/1801 branch
This patch adds an entry for the defaultbranch
in .gitreview

Change-Id: I280cc0fb36a913cc5b26d2815d8429e18b8edde1
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2018-01-03 15:23:14 -05:00
33 changed files with 239 additions and 385 deletions

View File

@ -2,3 +2,4 @@
host=gerrit.fd.io
port=29418
project=vpp
defaultbranch=stable/1801

View File

@ -48,10 +48,13 @@ endif
vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 \
-fstack-protector-all -fPIC -Werror
vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_TAG_CXXFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror
vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -fstack-protector -fPIC -Werror

View File

@ -245,6 +245,8 @@ tag_var_with_added_space_fn = $(if $($(TAG)_TAG_$(1)),$($(TAG)_TAG_$(1)) )
# TAG=debug for debugging
debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
debug_TAG_CXXFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
-fstack-protector-all -fPIC
@ -537,6 +539,8 @@ configure_ldflags_fn = \
CONFIGURE_ENV = \
$(if $(call configure_var_fn,CPPFLAGS), \
CPPFLAGS="$(CPPFLAGS) $(call configure_var_fn,CPPFLAGS)") \
$(if $(call configure_var_fn,CXXFLAGS), \
CXXFLAGS="$(CXXFLAGS) $(call configure_var_fn,CXXFLAGS)") \
$(if $(call configure_var_fn,CFLAGS), \
CFLAGS="$(CFLAGS) $(call configure_var_fn,CFLAGS)") \
$(if $(call configure_var_fn,CCASFLAGS), \

View File

@ -294,25 +294,6 @@ gtpu_decap_next_is_valid (gtpu_main_t * gtm, u32 is_ip6, u32 decap_next_index)
return decap_next_index < r->n_next_nodes;
}
static void
hash_set_key_copy (uword ** h, void *key, uword v)
{
size_t ksz = hash_header (*h)->user;
void *copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
static void
hash_unset_key_free (uword ** h, void *key)
{
hash_pair_t *hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
static uword
vtep_addr_ref (ip46_address_t * ip)
{
@ -323,7 +304,7 @@ vtep_addr_ref (ip46_address_t * ip)
return ++(*vtep);
ip46_address_is_ip4 (ip) ?
hash_set (gtpu_main.vtep4, ip->ip4.as_u32, 1) :
hash_set_key_copy (&gtpu_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&gtpu_main.vtep6, &ip->ip6, 1);
return 1;
}
@ -338,7 +319,7 @@ vtep_addr_unref (ip46_address_t * ip)
return *vtep;
ip46_address_is_ip4 (ip) ?
hash_unset (gtpu_main.vtep4, ip->ip4.as_u32) :
hash_unset_key_free (&gtpu_main.vtep6, &ip->ip6);
hash_unset_mem_free (&gtpu_main.vtep6, &ip->ip6);
return 0;
}
@ -370,7 +351,7 @@ mcast_shared_add (ip46_address_t * dst, fib_node_index_t mfei, adj_index_t ai)
.mfib_entry_index = mfei,
};
hash_set_key_copy (&gtpu_main.mcast_shared, dst, new_ep.as_u64);
hash_set_mem_alloc (&gtpu_main.mcast_shared, dst, new_ep.as_u64);
}
static inline void
@ -381,7 +362,7 @@ mcast_shared_remove (ip46_address_t * dst)
adj_unlock (ep.mcast_adj_index);
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GTPU);
hash_unset_key_free (&gtpu_main.mcast_shared, dst);
hash_unset_mem_free (&gtpu_main.mcast_shared, dst);
}
static inline fib_protocol_t
@ -442,8 +423,8 @@ int vnet_gtpu_add_del_tunnel
/* copy the key */
if (is_ip6)
hash_set_key_copy (&gtm->gtpu6_tunnel_by_key, &key6,
t - gtm->tunnels);
hash_set_mem_alloc (&gtm->gtpu6_tunnel_by_key, &key6,
t - gtm->tunnels);
else
hash_set (gtm->gtpu4_tunnel_by_key, key4.as_u64, t - gtm->tunnels);
@ -621,7 +602,7 @@ int vnet_gtpu_add_del_tunnel
if (!is_ip6)
hash_unset (gtm->gtpu4_tunnel_by_key, key4.as_u64);
else
hash_unset_key_free (&gtm->gtpu6_tunnel_by_key, &key6);
hash_unset_mem_free (&gtm->gtpu6_tunnel_by_key, &key6);
if (!ip46_address_is_multicast (&t->dst))
{

View File

@ -136,12 +136,12 @@ l2_emulation_cli (vlib_main_t * vm,
}
/*?
* Configure l2 emualtion.
* Configure l2 emulation.
* When the interface is in L2 mode, configure the extraction of L3
* packets out of the L2 path and into the L3 path.
*
* @cliexpar
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]
* @cliexstart{set interface l2 input l2-emulation <interface-name> [disable]}
* @cliexend
?*/
/* *INDENT-OFF* */
@ -179,7 +179,7 @@ l2_emulation_show (vlib_main_t * vm,
* packets out of the L2 path and into the L3 path.
*
* @cliexpar
* @cliexstart{show interface l2 l2-emulation
* @cliexstart{show interface l2 l2-emulation}
* @cliexend
?*/
/* *INDENT-OFF* */

View File

@ -1582,7 +1582,7 @@ int snat_set_workers (uword * bitmap)
clib_bitmap_foreach (i, bitmap,
({
vec_add1(sm->workers, i);
sm->per_thread_data[i].snat_thread_index = j;
sm->per_thread_data[sm->first_worker_index + i].snat_thread_index = j;
j++;
}));
@ -2726,6 +2726,7 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
snat_session_t *s;
int i;
u32 proto;
u32 next_worker_index = 0;
/* first try static mappings without port */
if (PREDICT_FALSE (pool_elts (sm->static_mappings)))
@ -2841,7 +2842,10 @@ snat_get_worker_out2in_cb (ip4_header_t * ip0, u32 rx_fib_index0)
}
/* worker by outside port */
return (u32) ((clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread);
next_worker_index = sm->first_worker_index;
next_worker_index +=
sm->workers[(clib_net_to_host_u16 (port) - 1024) / sm->port_per_thread];
return next_worker_index;
}
static clib_error_t *

View File

@ -202,7 +202,7 @@ nat64_get_worker_out2in (ip4_header_t * ip)
/* worker by outside port (TCP/UDP) */
port = clib_net_to_host_u16 (port);
if (port > 1024)
return (u32) ((port - 1024) / sm->port_per_thread);
return nm->sm->first_worker_index + ((port - 1024) / sm->port_per_thread);
return vlib_get_thread_index ();
}
@ -497,13 +497,17 @@ nat64_alloc_out_addr_and_port (u32 fib_index, snat_protocol_t proto,
snat_main_t *sm = nm->sm;
snat_session_key_t k;
u32 ai;
u32 worker_index = 0;
int rv;
k.protocol = proto;
if (sm->num_workers > 1)
worker_index = thread_index - sm->first_worker_index;
rv =
sm->alloc_addr_and_port (nm->addr_pool, fib_index, thread_index, &k, &ai,
sm->port_per_thread, thread_index);
sm->port_per_thread, worker_index);
if (!rv)
{

View File

@ -150,10 +150,11 @@ pppoe_fixup (vlib_main_t * vm, ip_adjacency_t * adj, vlib_buffer_t * b0)
{
pppoe_header_t *pppoe0;
pppoe0 = vlib_buffer_get_current (b0);
pppoe0 = vlib_buffer_get_current (b0) + sizeof (ethernet_header_t);
pppoe0->length = clib_host_to_net_u16 (vlib_buffer_length_in_chain (vm, b0)
- sizeof (pppoe_header_t)
+ sizeof (pppoe0->ppp_proto)
- sizeof (ethernet_header_t));
}

View File

@ -350,7 +350,7 @@ vl_api_bier_imp_add_t_handler (vl_api_bier_imp_add_t * mp)
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_BIER_IMP_ADD_REPLY,
({
rmp->bi_index = bii;
rmp->bi_index = ntohl (bii);
}));
/* *INDENT-OM* */
}

View File

@ -239,6 +239,7 @@ show_bier_bift_cmd (vlib_main_t * vm,
if (NULL == bier_bift_table)
{
vlib_cli_output(vm, "no BIFT entries");
goto done;
}
if (~0 == set)

View File

@ -1123,6 +1123,12 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
&arp0->ip4_over_ethernet[0]);
goto drop1;
}
else if (arp0->opcode ==
clib_host_to_net_u16 (ETHERNET_ARP_OPCODE_request) &&
(dst_is_local0 == 0))
{
goto drop1;
}
send_reply:
/* Send a reply.

View File

@ -288,25 +288,6 @@ geneve_decap_next_is_valid (geneve_main_t * vxm, u32 is_ip6,
return decap_next_index < r->n_next_nodes;
}
static void
hash_set_key_copy (uword ** h, void *key, uword v)
{
size_t ksz = hash_header (*h)->user;
void *copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
static void
hash_unset_key_free (uword ** h, void *key)
{
hash_pair_t *hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
static uword
vtep_addr_ref (ip46_address_t * ip)
{
@ -317,7 +298,7 @@ vtep_addr_ref (ip46_address_t * ip)
return ++(*vtep);
ip46_address_is_ip4 (ip) ?
hash_set (geneve_main.vtep4, ip->ip4.as_u32, 1) :
hash_set_key_copy (&geneve_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&geneve_main.vtep6, &ip->ip6, 1);
return 1;
}
@ -332,7 +313,7 @@ vtep_addr_unref (ip46_address_t * ip)
return *vtep;
ip46_address_is_ip4 (ip) ?
hash_unset (geneve_main.vtep4, ip->ip4.as_u32) :
hash_unset_key_free (&geneve_main.vtep6, &ip->ip6);
hash_unset_mem_free (&geneve_main.vtep6, &ip->ip6);
return 0;
}
@ -365,7 +346,7 @@ mcast_shared_add (ip46_address_t * remote,
.mfib_entry_index = mfei,
};
hash_set_key_copy (&geneve_main.mcast_shared, remote, new_ep.as_u64);
hash_set_mem_alloc (&geneve_main.mcast_shared, remote, new_ep.as_u64);
}
static inline void
@ -376,7 +357,7 @@ mcast_shared_remove (ip46_address_t * remote)
adj_unlock (ep.mcast_adj_index);
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_GENEVE);
hash_unset_key_free (&geneve_main.mcast_shared, remote);
hash_unset_mem_free (&geneve_main.mcast_shared, remote);
}
static inline fib_protocol_t
@ -445,8 +426,8 @@ int vnet_geneve_add_del_tunnel
/* copy the key */
if (is_ip6)
hash_set_key_copy (&vxm->geneve6_tunnel_by_key, &key6,
t - vxm->tunnels);
hash_set_mem_alloc (&vxm->geneve6_tunnel_by_key, &key6,
t - vxm->tunnels);
else
hash_set (vxm->geneve4_tunnel_by_key, key4.as_u64, t - vxm->tunnels);
@ -624,7 +605,7 @@ int vnet_geneve_add_del_tunnel
if (!is_ip6)
hash_unset (vxm->geneve4_tunnel_by_key, key4.as_u64);
else
hash_unset_key_free (&vxm->geneve6_tunnel_by_key, &key6);
hash_unset_mem_free (&vxm->geneve6_tunnel_by_key, &key6);
if (!ip46_address_is_multicast (&t->remote))
{

View File

@ -54,19 +54,8 @@ static void vl_api_gre_add_del_tunnel_t_handler
vl_api_gre_add_del_tunnel_reply_t *rmp;
int rv = 0;
vnet_gre_add_del_tunnel_args_t _a, *a = &_a;
u32 outer_fib_id;
u32 p;
u32 sw_if_index = ~0;
p = fib_table_find (!mp->is_ipv6 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6,
ntohl (mp->outer_fib_id));
if (p == ~0)
{
rv = VNET_API_ERROR_NO_SUCH_FIB;
goto out;
}
outer_fib_id = p;
/* Check src & dst are different */
if ((mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 16) == 0) ||
(!mp->is_ipv6 && memcmp (mp->src_address, mp->dst_address, 4) == 0))
@ -92,7 +81,7 @@ static void vl_api_gre_add_del_tunnel_t_handler
clib_memcpy (&(a->dst.ip6), mp->dst_address, 16);
}
a->outer_fib_id = outer_fib_id;
a->outer_fib_id = ntohl (mp->outer_fib_id);
rv = vnet_gre_add_del_tunnel (a, &sw_if_index);
out:

View File

@ -270,7 +270,7 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a, u32 * sw_if_indexp)
return VNET_API_ERROR_NO_SUCH_FIB;
t =
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
if (NULL != t)
return VNET_API_ERROR_INVALID_VALUE;
@ -426,9 +426,18 @@ vnet_gre_tunnel_delete (vnet_gre_add_del_tunnel_args_t * a,
gre_tunnel_t *t;
gre_tunnel_key_t key;
u32 sw_if_index;
u32 outer_fib_index;
if (!a->is_ipv6)
outer_fib_index = ip4_fib_index_from_table_id (a->outer_fib_id);
else
outer_fib_index = ip6_fib_index_from_table_id (a->outer_fib_id);
if (~0 == outer_fib_index)
return VNET_API_ERROR_NO_SUCH_FIB;
t =
gre_tunnel_db_find (&a->src, &a->dst, a->outer_fib_id, a->is_ipv6, &key);
gre_tunnel_db_find (&a->src, &a->dst, outer_fib_index, a->is_ipv6, &key);
if (NULL == t)
return VNET_API_ERROR_NO_SUCH_ENTRY;

View File

@ -75,24 +75,24 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
(weight != (u32) ~ 0 ? weight : SR_SEGMENT_LIST_WEIGHT_DEFAULT);
segment_list->segments = vec_dup (sl);
fib_route_path_t path = {
.frp_proto = DPO_PROTO_MPLS,
.frp_sw_if_index = ~0,
.frp_fib_index = 0,
.frp_weight = segment_list->weight,
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
.frp_label_stack = NULL,
.frp_local_label = sl[0],
};
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
fib_route_path_t *paths = NULL;
vec_add1 (paths, path);
mpls_eos_bit_t eos;
FOR_EACH_MPLS_EOS_BIT (eos)
{
fib_route_path_t path = {
.frp_proto = DPO_PROTO_MPLS,
.frp_sw_if_index = ~0,
.frp_fib_index = 0,
.frp_weight = segment_list->weight,
.frp_flags = FIB_ROUTE_PATH_FLAG_NONE,
.frp_label_stack = NULL,
.frp_local_label = sl[0],
};
vec_add (path.frp_label_stack, sl + 1, vec_len (sl) - 1);
fib_route_path_t *paths = NULL;
vec_add1 (paths, path);
/* *INDENT-OFF* */
fib_prefix_t pfx = {
.fp_len = 21,
@ -109,10 +109,9 @@ create_sl (mpls_sr_policy_t * sr_policy, mpls_label_t * sl, u32 weight)
(sr_policy->type == SR_POLICY_TYPE_DEFAULT ?
FIB_ENTRY_FLAG_NONE :
FIB_ENTRY_FLAG_MULTICAST), paths);
vec_free (paths);
}
vec_free (paths);
return segment_list;
}

View File

@ -177,22 +177,27 @@ compute_rewrite_encaps (ip6_address_t * sl)
iph->protocol = IP_PROTOCOL_IPV6;
iph->hop_limit = IPv6_DEFAULT_HOP_LIMIT;
srh = (ip6_sr_header_t *) (iph + 1);
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
srh->protocol = IP_PROTOCOL_IPV6;
srh->type = ROUTING_HEADER_TYPE_SR;
srh->segments_left = vec_len (sl) - 1;
srh->first_segment = vec_len (sl) - 1;
srh->length = ((sizeof (ip6_sr_header_t) +
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
srh->flags = 0x00;
srh->reserved = 0x00;
addrp = srh->segments + vec_len (sl) - 1;
vec_foreach (this_address, sl)
{
clib_memcpy (addrp->as_u8, this_address->as_u8, sizeof (ip6_address_t));
addrp--;
}
if (vec_len (sl) > 1)
{
srh = (ip6_sr_header_t *) (iph + 1);
iph->protocol = IP_PROTOCOL_IPV6_ROUTE;
srh->protocol = IP_PROTOCOL_IPV6;
srh->type = ROUTING_HEADER_TYPE_SR;
srh->segments_left = vec_len (sl) - 1;
srh->first_segment = vec_len (sl) - 1;
srh->length = ((sizeof (ip6_sr_header_t) +
(vec_len (sl) * sizeof (ip6_address_t))) / 8) - 1;
srh->flags = 0x00;
srh->reserved = 0x00;
addrp = srh->segments + vec_len (sl) - 1;
vec_foreach (this_address, sl)
{
clib_memcpy (addrp->as_u8, this_address->as_u8,
sizeof (ip6_address_t));
addrp--;
}
}
iph->dst_address.as_u64[0] = sl->as_u64[0];
iph->dst_address.as_u64[1] = sl->as_u64[1];
return rs;
@ -1332,8 +1337,13 @@ encaps_processing_v4 (vlib_node_runtime_t * node,
ip0->ip_version_traffic_class_and_flow_label =
clib_host_to_net_u32 (0 | ((6 & 0xF) << 28) |
((ip0_encap->tos & 0xFF) << 20));
sr0 = (void *) (ip0 + 1);
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr0 = (void *) (ip0 + 1);
sr0->protocol = IP_PROTOCOL_IP_IN_IP;
}
else
ip0->protocol = IP_PROTOCOL_IP_IN_IP;
}
/**
@ -1816,13 +1826,37 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
ip3->payload_length =
clib_host_to_net_u16 (b3->current_length - sizeof (ip6_header_t));
sr0 = (void *) (ip0 + 1);
sr1 = (void *) (ip1 + 1);
sr2 = (void *) (ip2 + 1);
sr3 = (void *) (ip3 + 1);
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr0 = (void *) (ip0 + 1);
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
}
else
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
sr0->protocol = sr1->protocol = sr2->protocol = sr3->protocol =
IP_PROTOCOL_IP6_NONXT;
if (ip1->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr1 = (void *) (ip1 + 1);
sr1->protocol = IP_PROTOCOL_IP6_NONXT;
}
else
ip1->protocol = IP_PROTOCOL_IP6_NONXT;
if (ip2->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr2 = (void *) (ip2 + 1);
sr2->protocol = IP_PROTOCOL_IP6_NONXT;
}
else
ip2->protocol = IP_PROTOCOL_IP6_NONXT;
if (ip3->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr3 = (void *) (ip3 + 1);
sr3->protocol = IP_PROTOCOL_IP6_NONXT;
}
else
ip3->protocol = IP_PROTOCOL_IP6_NONXT;
/* 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));
@ -1930,8 +1964,13 @@ sr_policy_rewrite_encaps_l2 (vlib_main_t * vm, vlib_node_runtime_t * node,
ip0->payload_length =
clib_host_to_net_u16 (b0->current_length - sizeof (ip6_header_t));
sr0 = (void *) (ip0 + 1);
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
if (ip0->protocol == IP_PROTOCOL_IPV6_ROUTE)
{
sr0 = (void *) (ip0 + 1);
sr0->protocol = IP_PROTOCOL_IP6_NONXT;
}
else
ip0->protocol = IP_PROTOCOL_IP6_NONXT;
if (PREDICT_FALSE (node->flags & VLIB_NODE_FLAG_TRACE) &&
PREDICT_FALSE (b0->flags & VLIB_BUFFER_IS_TRACED))

View File

@ -381,25 +381,6 @@ vxlan6_gpe_rewrite (vxlan_gpe_tunnel_t * t, u32 extension_size,
return (0);
}
static void
hash_set_key_copy (uword ** h, void *key, uword v)
{
size_t ksz = hash_header (*h)->user;
void *copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
static void
hash_unset_key_free (uword ** h, void *key)
{
hash_pair_t *hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
static uword
vtep_addr_ref (ip46_address_t * ip)
{
@ -410,7 +391,7 @@ vtep_addr_ref (ip46_address_t * ip)
return ++(*vtep);
ip46_address_is_ip4 (ip) ?
hash_set (vxlan_gpe_main.vtep4, ip->ip4.as_u32, 1) :
hash_set_key_copy (&vxlan_gpe_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&vxlan_gpe_main.vtep6, &ip->ip6, 1);
return 1;
}
@ -425,7 +406,7 @@ vtep_addr_unref (ip46_address_t * ip)
return *vtep;
ip46_address_is_ip4 (ip) ?
hash_unset (vxlan_gpe_main.vtep4, ip->ip4.as_u32) :
hash_unset_key_free (&vxlan_gpe_main.vtep6, &ip->ip6);
hash_unset_mem_free (&vxlan_gpe_main.vtep6, &ip->ip6);
return 0;
}
@ -459,7 +440,7 @@ mcast_shared_add (ip46_address_t * remote,
.mfib_entry_index = mfei,
};
hash_set_key_copy (&vxlan_gpe_main.mcast_shared, remote, new_ep.as_u64);
hash_set_mem_alloc (&vxlan_gpe_main.mcast_shared, remote, new_ep.as_u64);
}
static inline void
@ -470,7 +451,7 @@ mcast_shared_remove (ip46_address_t * remote)
adj_unlock (ep.mcast_adj_index);
mfib_table_entry_delete_index (ep.mfib_entry_index, MFIB_SOURCE_VXLAN_GPE);
hash_unset_key_free (&vxlan_gpe_main.mcast_shared, remote);
hash_unset_mem_free (&vxlan_gpe_main.mcast_shared, remote);
}
static inline fib_protocol_t
@ -535,15 +516,18 @@ int vnet_vxlan_gpe_add_del_tunnel
memset (t, 0, sizeof (*t));
/* copy from arg structure */
/* *INDENT-OFF* */
#define _(x) t->x = a->x;
foreach_gpe_copy_field;
if (!a->is_ip6)
foreach_copy_ipv4
else
else
foreach_copy_ipv6
#undef _
if (!a->is_ip6)
t->flags |= VXLAN_GPE_TUNNEL_IS_IPV4;
/* *INDENT-ON* */
if (!a->is_ip6)
t->flags |= VXLAN_GPE_TUNNEL_IS_IPV4;
if (!a->is_ip6)
{
@ -743,7 +727,7 @@ int vnet_vxlan_gpe_add_del_tunnel
if (!is_ip6)
hash_unset (ngm->vxlan4_gpe_tunnel_by_key, key4.as_u64);
else
hash_unset_key_free (&ngm->vxlan6_gpe_tunnel_by_key, &key6);
hash_unset_mem_free (&ngm->vxlan6_gpe_tunnel_by_key, &key6);
if (!ip46_address_is_multicast (&t->remote))
{
@ -940,14 +924,17 @@ vxlan_gpe_add_del_tunnel_command_fn (vlib_main_t * vm,
a->is_add = is_add;
a->is_ip6 = ipv6_set;
/* *INDENT-OFF* */
#define _(x) a->x = x;
foreach_gpe_copy_field;
if (ipv4_set)
foreach_copy_ipv4
else
else
foreach_copy_ipv6
#undef _
rv = vnet_vxlan_gpe_add_del_tunnel (a, &sw_if_index);
/* *INDENT-ON* */
rv = vnet_vxlan_gpe_add_del_tunnel (a, &sw_if_index);
switch (rv)
{

View File

@ -263,23 +263,6 @@ vxlan_decap_next_is_valid (vxlan_main_t * vxm, u32 is_ip6, u32 decap_next_index)
return decap_next_index < r->n_next_nodes;
}
static void
hash_set_key_copy (uword ** h, void * key, uword v) {
size_t ksz = hash_header(*h)->user;
void * copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
static void
hash_unset_key_free (uword ** h, void * key) {
hash_pair_t * hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
static uword
vtep_addr_ref(ip46_address_t *ip)
{
@ -290,7 +273,7 @@ vtep_addr_ref(ip46_address_t *ip)
return ++(*vtep);
ip46_address_is_ip4(ip) ?
hash_set (vxlan_main.vtep4, ip->ip4.as_u32, 1) :
hash_set_key_copy (&vxlan_main.vtep6, &ip->ip6, 1);
hash_set_mem_alloc (&vxlan_main.vtep6, &ip->ip6, 1);
return 1;
}
@ -305,7 +288,7 @@ vtep_addr_unref(ip46_address_t *ip)
return *vtep;
ip46_address_is_ip4(ip) ?
hash_unset (vxlan_main.vtep4, ip->ip4.as_u32) :
hash_unset_key_free (&vxlan_main.vtep6, &ip->ip6);
hash_unset_mem_free (&vxlan_main.vtep6, &ip->ip6);
return 0;
}
@ -336,7 +319,7 @@ mcast_shared_add(ip46_address_t *dst,
.mfib_entry_index = mfei,
};
hash_set_key_copy (&vxlan_main.mcast_shared, dst, new_ep.as_u64);
hash_set_mem_alloc (&vxlan_main.mcast_shared, dst, new_ep.as_u64);
}
static inline void
@ -348,7 +331,7 @@ mcast_shared_remove(ip46_address_t *dst)
mfib_table_entry_delete_index(ep.mfib_entry_index,
MFIB_SOURCE_VXLAN);
hash_unset_key_free (&vxlan_main.mcast_shared, dst);
hash_unset_mem_free (&vxlan_main.mcast_shared, dst);
}
static inline fib_protocol_t
@ -415,7 +398,8 @@ int vnet_vxlan_add_del_tunnel
/* copy the key */
if (is_ip6)
hash_set_key_copy (&vxm->vxlan6_tunnel_by_key, &key6, t - vxm->tunnels);
hash_set_mem_alloc (&vxm->vxlan6_tunnel_by_key, &key6,
t - vxm->tunnels);
else
hash_set (vxm->vxlan4_tunnel_by_key, key4.as_u64, t - vxm->tunnels);
@ -588,7 +572,7 @@ int vnet_vxlan_add_del_tunnel
if (!is_ip6)
hash_unset (vxm->vxlan4_tunnel_by_key, key4.as_u64);
else
hash_unset_key_free (&vxm->vxlan6_tunnel_by_key, &key6);
hash_unset_mem_free (&vxm->vxlan6_tunnel_by_key, &key6);
if (!ip46_address_is_multicast(&t->dst))
{

View File

@ -15,8 +15,7 @@ AUTOMAKE_OPTIONS = foreign
ACLOCAL_AMFLAGS = -I m4
AM_LIBTOOLFLAGS = --quiet
AM_CXXFLAGS = -Wall -std=gnu++11 -I${top_srcdir} -I${top_builddir}/vpp-api/vapi/ -I$(top_srcdir)/vpp-api/ -I${libdir}/../include -O0
AM_LDFLAGS = -shared -no-undefined
AM_CXXFLAGS = -Wall -Werror -std=gnu++11 -I${top_srcdir} -I${top_builddir}/vpp-api/vapi/ -I$(top_srcdir)/vpp-api/ -I${libdir}/../include
bin_PROGRAMS =
noinst_LTLIBRARIES =

View File

@ -119,7 +119,7 @@ nat_binding::update(const nat_binding& desired)
HW::enqueue(new nat_binding_cmds::bind_44_input_cmd(
m_binding, m_itf->handle(), m_zone));
} else {
HW::enqueue(new nat_binding_cmds::bind_44_input_cmd(
HW::enqueue(new nat_binding_cmds::bind_44_output_cmd(
m_binding, m_itf->handle(), m_zone));
}
}

View File

@ -168,12 +168,12 @@ private:
/**
* The 'inside' IP address, could be v4 or v6
*/
const boost::asio::ip::address& m_inside;
const boost::asio::ip::address m_inside;
/**
* The 'outside' IP address - always v4
*/
const boost::asio::ip::address_v4& m_outside;
const boost::asio::ip::address_v4 m_outside;
/**
* A map of all NAT statics

View File

@ -273,12 +273,33 @@ uword hash_bytes (void *v);
/* Public macro to set (key, value) for pointer key */
#define hash_set_mem(h,key,value) hash_set3 (h, pointer_to_uword (key), (value), 0)
/* Public inline funcion allocate and copy key to use in hash for pointer key */
always_inline void
hash_set_mem_alloc (uword ** h, void *key, uword v)
{
size_t ksz = hash_header (*h)->user;
void *copy = clib_mem_alloc (ksz);
clib_memcpy (copy, key, ksz);
hash_set_mem (*h, copy, v);
}
/* Public macro to set (key, 0) for pointer key */
#define hash_set1_mem(h,key) hash_set3 ((h), pointer_to_uword (key), 0, 0)
/* Public macro to unset (key, value) for pointer key */
#define hash_unset_mem(h,key) ((h) = _hash_unset ((h), pointer_to_uword (key),0))
/* Public inline funcion to unset pointer key and then free the key memory */
always_inline void
hash_unset_mem_free (uword ** h, void *key)
{
hash_pair_t *hp = hash_get_pair_mem (*h, key);
ASSERT (hp);
key = uword_to_pointer (hp->key, void *);
hash_unset_mem (*h, key);
clib_mem_free (key);
}
/* internal routine to free a hash table */
extern void *_hash_free (void *v);

View File

@ -747,6 +747,25 @@ class VppTestCase(unittest.TestCase):
"Finished sleep (%s) - slept %ss (wanted %ss)" % (
remark, after - before, timeout))
def send_and_assert_no_replies(self, intf, pkts, remark=""):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
timeout = 1
for i in self.pg_interfaces:
i.get_capture(0, timeout=timeout)
i.assert_nothing_captured(remark=remark)
timeout = 0.1
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
class TestCasePrinter(object):
_shared_state = {}

View File

@ -66,21 +66,6 @@ class TestBier(VppTestCase):
i.admin_down()
super(TestBier, self).tearDown()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.assert_nothing_captured(remark=remark)
def send_and_expect(self, input, pkts, output):
self.vapi.cli("trace add bier-mpls-lookup 10")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def test_bier_midpoint(self):
"""BIER midpoint"""
@ -485,10 +470,14 @@ class TestBier(VppTestCase):
bier_route.add_vpp_config()
#
# An imposition object with all bit-positions set
# An 2 imposition objects with all bit-positions set
# only use the second, but creating 2 tests with a non-zero
# value index in the route add
#
bi = VppBierImp(self, bti, 333, chr(0xff) * 32)
bi.add_vpp_config()
bi2 = VppBierImp(self, bti, 334, chr(0xff) * 32)
bi2.add_vpp_config()
#
# Add a multicast route that will forward into the BIER doamin
@ -503,7 +492,7 @@ class TestBier(VppTestCase):
VppMRoutePath(0xffffffff,
MRouteItfFlags.MFIB_ITF_FLAG_FORWARD,
proto=DpoProto.DPO_PROTO_BIER,
bier_imp=bi.bi_index)])
bier_imp=bi2.bi_index)])
route_ing_232_1_1_1.add_vpp_config()
#

View File

@ -77,13 +77,6 @@ class TestDHCP(VppTestCase):
i.admin_down()
super(TestDHCP, self).tearDown()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.assert_nothing_captured(remark=remark)
def verify_dhcp_has_option(self, pkt, option, value):
dhcp = pkt[DHCP]
found = False

View File

@ -36,23 +36,6 @@ class TestDVR(VppTestCase):
super(TestDVR, self).tearDown()
def send_and_assert_no_replies(self, intf, pkts):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured()
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def assert_same_mac_addr(self, tx, rx):
t_eth = tx[Ether]
for p in rx:

View File

@ -572,14 +572,6 @@ class TestIPDisabled(VppTestCase):
i.unconfig_ip4()
i.admin_down()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_disabled(self):
""" IP Disabled """
@ -667,14 +659,6 @@ class TestIPSubNets(VppTestCase):
for i in self.pg_interfaces:
i.admin_down()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_sub_nets(self):
""" IP Sub Nets """
@ -985,12 +969,6 @@ class TestIPVlan0(VppTestCase):
i.admin_down()
super(TestIPVlan0, self).tearDown()
def send_and_expect(self, input, pkts, output):
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
def test_ip_vlan_0(self):
""" IP VLAN-0 """
@ -1028,23 +1006,6 @@ class TestIPPunt(VppTestCase):
i.unconfig_ip4()
i.admin_down()
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def send_and_assert_no_replies(self, intf, pkts, remark):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_punt(self):
""" IP punt police and redirect """
@ -1138,23 +1099,6 @@ class TestIPDeag(VppTestCase):
i.unconfig_ip4()
i.admin_down()
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def send_and_assert_no_replies(self, intf, pkts, remark):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_deag(self):
""" IP Deag Routes """
@ -1246,23 +1190,6 @@ class TestIPInput(VppTestCase):
i.unconfig_ip4()
i.admin_down()
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def send_and_assert_no_replies(self, intf, pkts, remark):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_input(self):
""" IP Input Exceptions """

View File

@ -136,14 +136,6 @@ class TestIPv6ND(VppTestCase):
rx = rx[0]
self.validate_ns(rx_intf, rx, tgt_ip)
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def verify_ip(self, rx, smac, dmac, sip, dip):
ether = rx[Ether]
self.assertEqual(ether.dst, dmac)
@ -1179,14 +1171,6 @@ class TestIPDisabled(VppTestCase):
i.unconfig_ip4()
i.admin_down()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_disabled(self):
""" IP Disabled """
@ -1528,22 +1512,6 @@ class TestIP6Punt(VppTestCase):
i.unconfig_ip6()
i.admin_down()
def send_and_expect(self, input, pkts, output):
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def send_and_assert_no_replies(self, intf, pkts, remark):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_punt(self):
""" IP6 punt police and redirect """
@ -1641,23 +1609,6 @@ class TestIP6Input(VppTestCase):
i.unconfig_ip6()
i.admin_down()
def send_and_expect(self, input, pkts, output):
self.vapi.cli("clear trace")
input.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = output.get_capture(len(pkts))
return rx
def send_and_assert_no_replies(self, intf, pkts, remark):
self.vapi.cli("clear trace")
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_ip_input(self):
""" IP6 Input Exceptions """

View File

@ -38,13 +38,6 @@ class TestMAP(VppTestCase):
i.unconfig_ip6()
i.admin_down()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.assert_nothing_captured(remark=remark)
def send_and_assert_encapped(self, tx, ip6_src, ip6_dst, dmac=None):
if not dmac:
dmac = self.pg1.remote_mac

View File

@ -314,13 +314,6 @@ class TestMPLS(VppTestCase):
except:
raise
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.assert_nothing_captured(remark=remark)
def test_swap(self):
""" MPLS label swap tests """
@ -1218,7 +1211,13 @@ class TestMPLS(VppTestCase):
#
tx = self.create_stream_labelled_ip6(self.pg0, [34], 255,
dst_ip="ff01::1", hlim=1)
self.send_and_assert_no_replies(self.pg0, tx, "Hop Limt Expired")
self.pg0.add_stream(tx)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
rx = self.pg0.get_capture(257)
self.verify_capture_ip6_icmp(self.pg0, rx, tx)
#
# set the RPF-ID of the enrtry to not match the input packet's
@ -1258,14 +1257,6 @@ class TestMPLSDisabled(VppTestCase):
self.pg0.disable_mpls()
super(TestMPLSDisabled, self).tearDown()
def send_and_assert_no_replies(self, intf, pkts, remark):
intf.add_stream(pkts)
self.pg_enable_capture(self.pg_interfaces)
self.pg_start()
for i in self.pg_interfaces:
i.get_capture(0)
i.assert_nothing_captured(remark=remark)
def test_mpls_disabled(self):
""" MPLS Disabled """

Some files were not shown because too many files have changed in this diff Show More