diff options
Diffstat (limited to 'src/vnet/gre')
-rw-r--r-- | src/vnet/gre/gre.c | 27 | ||||
-rw-r--r-- | src/vnet/gre/interface.c | 8 |
2 files changed, 20 insertions, 15 deletions
diff --git a/src/vnet/gre/gre.c b/src/vnet/gre/gre.c index a3702920334..75b11017e50 100644 --- a/src/vnet/gre/gre.c +++ b/src/vnet/gre/gre.c @@ -383,19 +383,22 @@ gre_interface_tx (vlib_main_t * vm, adj_index0 = gt0->l2_adj_index; } - if (sw_if_index0 == vnet_buffer (b1)->sw_if_index[VLIB_TX]) + if (sw_if_index1 != vnet_buffer (b1)->sw_if_index[VLIB_TX]) { - sw_if_index1 = sw_if_index0; - gt1 = gt0; - adj_index1 = adj_index0; - } - else if (sw_if_index1 != vnet_buffer (b1)->sw_if_index[VLIB_TX]) - { - sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX]; - vnet_hw_interface_t *hi1 = - vnet_get_sup_hw_interface (vnm, sw_if_index1); - gt1 = &gm->tunnels[hi1->dev_instance]; - adj_index1 = gt1->l2_adj_index; + if (sw_if_index0 == vnet_buffer (b1)->sw_if_index[VLIB_TX]) + { + sw_if_index1 = sw_if_index0; + gt1 = gt0; + adj_index1 = adj_index0; + } + else + { + sw_if_index1 = vnet_buffer (b1)->sw_if_index[VLIB_TX]; + vnet_hw_interface_t *hi1 = + vnet_get_sup_hw_interface (vnm, sw_if_index1); + gt1 = &gm->tunnels[hi1->dev_instance]; + adj_index1 = gt1->l2_adj_index; + } } vnet_buffer (b0)->ip.adj_index[VLIB_TX] = adj_index0; diff --git a/src/vnet/gre/interface.c b/src/vnet/gre/interface.c index 97c4f1643d9..5b165c858d3 100644 --- a/src/vnet/gre/interface.c +++ b/src/vnet/gre/interface.c @@ -309,9 +309,11 @@ vnet_gre_tunnel_add (vnet_gre_add_del_tunnel_args_t * a, else { /* Default MAC address (d00b:eed0:0000 + sw_if_index) */ - u8 address[6] = { 0xd0, 0x0b, 0xee, 0xd0, (u8) t_idx >> 8, (u8) t_idx }; - error = ethernet_register_interface (vnm, gre_device_class.index, t_idx, - address, &hw_if_index, 0); + u8 address[6] = + { 0xd0, 0x0b, 0xee, 0xd0, (u8) (t_idx >> 8), (u8) t_idx }; + error = + ethernet_register_interface (vnm, gre_device_class.index, t_idx, + address, &hw_if_index, 0); if (error) { clib_error_report (error); |