hi->min_packet_bytes = 64 + sizeof (gre_header_t) +
sizeof (ip4_header_t) + sizeof (esp_header_t) + sizeof (esp_footer_t);
- hi->per_packet_overhead_bytes =
- /* preamble */ 8 + /* inter frame gap */ 12;
/* Standard default gre MTU. */
- hi->max_l3_packet_bytes[VLIB_RX] = hi->max_l3_packet_bytes[VLIB_TX] =
- 9000;
+ /* TODO: Should take tunnel overhead into consideration */
+ vnet_sw_interface_set_mtu (vnm, sw_if_index, 9000);
clib_memcpy (&t->tunnel_src, &a->src, sizeof (t->tunnel_src));
clib_memcpy (&t->tunnel_dst, &a->dst, sizeof (t->tunnel_dst));
vnet_ipsec_gre_add_del_tunnel_args_t _a, *a = &_a;
int rv;
u32 sw_if_index;
+ clib_error_t *error = NULL;
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
else if (unformat (line_input, "remote-sa %d", &rsa))
num_m_args++;
else
- return clib_error_return (0, "unknown input `%U'",
- format_unformat_error, input);
+ {
+ error = clib_error_return (0, "unknown input `%U'",
+ format_unformat_error, line_input);
+ goto done;
+ }
}
- unformat_free (line_input);
if (num_m_args < 4)
- return clib_error_return (0, "mandatory argument(s) missing");
+ {
+ error = clib_error_return (0, "mandatory argument(s) missing");
+ goto done;
+ }
if (memcmp (&src, &dst, sizeof (src)) == 0)
- return clib_error_return (0, "src and dst are identical");
+ {
+ error = clib_error_return (0, "src and dst are identical");
+ goto done;
+ }
memset (a, 0, sizeof (*a));
a->is_add = is_add;
vnet_get_main (), sw_if_index);
break;
case VNET_API_ERROR_INVALID_VALUE:
- return clib_error_return (0, "GRE tunnel already exists...");
+ error = clib_error_return (0, "GRE tunnel already exists...");
+ goto done;
default:
- return clib_error_return (0,
- "vnet_ipsec_gre_add_del_tunnel returned %d",
- rv);
+ error = clib_error_return (0,
+ "vnet_ipsec_gre_add_del_tunnel returned %d",
+ rv);
+ goto done;
}
- return 0;
+done:
+ unformat_free (line_input);
+
+ return error;
}
/* *INDENT-OFF* */