summaryrefslogtreecommitdiffstats
path: root/src/vnet/interface_api.c
diff options
context:
space:
mode:
authorAlexander Chernavin <achernavin@netgate.com>2019-04-26 10:43:09 -0400
committerAlexander Chernavin <achernavin@netgate.com>2019-04-26 10:43:09 -0400
commitfdea5c6a00b74971dbb1b7ec4e25839a871006ca (patch)
tree946fece3fb7ffdb008c815f3c453b79a5c6538ea /src/vnet/interface_api.c
parentd97918ec678c4086001840e7263ba9ac3504ce24 (diff)
IF: return VTR attributes for all ifs in dump API
With this commit, VTR attributes are shown not only for subinterfaces but for all interfaces. Change-Id: I498185d905c0bf48431cddb916165f8e9c841b1f Signed-off-by: Alexander Chernavin <achernavin@netgate.com>
Diffstat (limited to 'src/vnet/interface_api.c')
-rw-r--r--src/vnet/interface_api.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/vnet/interface_api.c b/src/vnet/interface_api.c
index 4cd2ec95b0f..b896433e959 100644
--- a/src/vnet/interface_api.c
+++ b/src/vnet/interface_api.c
@@ -239,38 +239,38 @@ send_sw_interface_details (vpe_api_main_t * am,
mp->sub_default = sub->eth.flags.default_sub;
mp->sub_outer_vlan_id_any = sub->eth.flags.outer_vlan_id_any;
mp->sub_inner_vlan_id_any = sub->eth.flags.inner_vlan_id_any;
+ }
- /* vlan tag rewrite data */
- u32 vtr_op = L2_VTR_DISABLED;
- u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0;
+ /* vlan tag rewrite data */
+ u32 vtr_op = L2_VTR_DISABLED;
+ u32 vtr_push_dot1q = 0, vtr_tag1 = 0, vtr_tag2 = 0;
- if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
- &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0)
- {
- // error - default to disabled
- mp->vtr_op = ntohl (L2_VTR_DISABLED);
- clib_warning ("cannot get vlan tag rewrite for sw_if_index %d",
- swif->sw_if_index);
- }
- else
- {
- mp->vtr_op = ntohl (vtr_op);
- mp->vtr_push_dot1q = ntohl (vtr_push_dot1q);
- mp->vtr_tag1 = ntohl (vtr_tag1);
- mp->vtr_tag2 = ntohl (vtr_tag2);
- }
+ if (l2vtr_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
+ &vtr_op, &vtr_push_dot1q, &vtr_tag1, &vtr_tag2) != 0)
+ {
+ // error - default to disabled
+ mp->vtr_op = ntohl (L2_VTR_DISABLED);
+ clib_warning ("cannot get vlan tag rewrite for sw_if_index %d",
+ swif->sw_if_index);
+ }
+ else
+ {
+ mp->vtr_op = ntohl (vtr_op);
+ mp->vtr_push_dot1q = ntohl (vtr_push_dot1q);
+ mp->vtr_tag1 = ntohl (vtr_tag1);
+ mp->vtr_tag2 = ntohl (vtr_tag2);
}
/* pbb tag rewrite data */
ethernet_header_t eth_hdr;
- u32 vtr_op = L2_VTR_DISABLED;
+ u32 pbb_vtr_op = L2_VTR_DISABLED;
u16 outer_tag = 0;
u16 b_vlanid = 0;
u32 i_sid = 0;
clib_memset (&eth_hdr, 0, sizeof (eth_hdr));
if (!l2pbb_get (am->vlib_main, am->vnet_main, swif->sw_if_index,
- &vtr_op, &outer_tag, &eth_hdr, &b_vlanid, &i_sid))
+ &pbb_vtr_op, &outer_tag, &eth_hdr, &b_vlanid, &i_sid))
{
mp->sub_dot1ah = 1;
clib_memcpy (mp->b_dmac, eth_hdr.dst_address,