X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvnet%2Fsession%2Ftransport.c;h=acbb4f65e7a42251660bcf37259c7cf7fe326569;hb=5fda7a3925be145f0c326d0aecc36d883cbcb2ee;hp=2f01ac6c0925b9f4f8bce6152093a686af297472;hpb=561af9b441c7392cf391dd46399b0b16b876a08a;p=vpp.git diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c index 2f01ac6c092..acbb4f65e7a 100644 --- a/src/vnet/session/transport.c +++ b/src/vnet/session/transport.c @@ -54,6 +54,9 @@ format_transport_proto (u8 * s, va_list * args) case TRANSPORT_PROTO_UDP: s = format (s, "UDP"); break; + case TRANSPORT_PROTO_SCTP: + s = format (s, "SCTP"); + break; } return s; } @@ -70,6 +73,9 @@ format_transport_proto_short (u8 * s, va_list * args) case TRANSPORT_PROTO_UDP: s = format (s, "U"); break; + case TRANSPORT_PROTO_SCTP: + s = format (s, "S"); + break; } return s; } @@ -86,6 +92,10 @@ unformat_transport_proto (unformat_input_t * input, va_list * args) *proto = TRANSPORT_PROTO_UDP; else if (unformat (input, "UDP")) *proto = TRANSPORT_PROTO_UDP; + else if (unformat (input, "sctp")) + *proto = TRANSPORT_PROTO_SCTP; + else if (unformat (input, "SCTP")) + *proto = TRANSPORT_PROTO_SCTP; else return 0; return 1; @@ -300,6 +310,13 @@ transport_alloc_local_endpoint (u8 proto, transport_endpoint_t * rmt, { ip4_address_t *ip4; ip4 = ip_interface_get_first_ip (sw_if_index, 1); + if (!ip4) + { + clib_warning ("no routable ip4 address on %U", + format_vnet_sw_if_index_name, vnet_get_main (), + sw_if_index); + return -1; + } lcl_addr->ip4.as_u32 = ip4->as_u32; } else