]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Socktest: check existence of given name of interface
authorPavel Tvrdik <pawel.tvrdik@gmail.com>
Tue, 5 Apr 2016 07:12:59 +0000 (09:12 +0200)
committerPavel Tvrdik <pawel.tvrdik@gmail.com>
Wed, 6 Apr 2016 13:57:14 +0000 (15:57 +0200)
socktest/common.c

index 8c5995e48153c0a1d89582c8b787b0618bafbb34..df00388c72f9a1a9630f9dc1c2ef1184d3248513 100644 (file)
@@ -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;