From 43ae8c395fea5d7c2e85146b30ac87a1450d97a3 Mon Sep 17 00:00:00 2001 From: Pavel Tvrdik Date: Tue, 5 Apr 2016 09:12:59 +0200 Subject: [PATCH] Socktest: check existence of given name of interface --- socktest/common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/socktest/common.c b/socktest/common.c index 8c5995e4..df00388c 100644 --- a/socktest/common.c +++ b/socktest/common.c @@ -102,6 +102,11 @@ skt_parse_args(int argc, char *argv[], int is_send) case 'i': s->iface = if_get_by_name(optarg); s->iface->index = if_nametoindex(optarg); + if (s->iface->index == 0) + { + printf("No interface exists with the name %s \n", optarg); + exit(1); + } break; case 'B': cf_bind = 1;