summaryrefslogtreecommitdiff
path: root/src/regress/lib/libc/ifnameindex
diff options
context:
space:
mode:
authorcvs2svn <admin@example.com>2025-08-02 06:16:35 +0000
committercvs2svn <admin@example.com>2025-08-02 06:16:35 +0000
commita397c95f8aea58533e72379d6e0de12683ecd0dc (patch)
tree45ccaccd0ce2ea01650f0a9f5e9268a656e17e51 /src/regress/lib/libc/ifnameindex
parenta79e90e7342954ae2287db505811ca3c1cd336d7 (diff)
downloadopenbsd-tb_20250802.tar.gz
openbsd-tb_20250802.tar.bz2
openbsd-tb_20250802.zip
This commit was manufactured by cvs2git to create tag 'tb_20250802'.tb_20250802
Diffstat (limited to 'src/regress/lib/libc/ifnameindex')
-rw-r--r--src/regress/lib/libc/ifnameindex/Makefile12
-rw-r--r--src/regress/lib/libc/ifnameindex/ifnitest.c32
2 files changed, 0 insertions, 44 deletions
diff --git a/src/regress/lib/libc/ifnameindex/Makefile b/src/regress/lib/libc/ifnameindex/Makefile
deleted file mode 100644
index 1f21973a10..0000000000
--- a/src/regress/lib/libc/ifnameindex/Makefile
+++ /dev/null
@@ -1,12 +0,0 @@
1# $OpenBSD: Makefile,v 1.1 2015/10/22 15:47:00 claudio Exp $
2
3PROG= ifnitest
4SRCS= ifnitest.c
5NOMAN= # defined
6
7REGRESS_TARGETS=do-test
8
9do-test: ${PROG}
10 ./${PROG}
11
12.include <bsd.regress.mk>
diff --git a/src/regress/lib/libc/ifnameindex/ifnitest.c b/src/regress/lib/libc/ifnameindex/ifnitest.c
deleted file mode 100644
index fb7ed3704f..0000000000
--- a/src/regress/lib/libc/ifnameindex/ifnitest.c
+++ /dev/null
@@ -1,32 +0,0 @@
1/* $OpenBSD: ifnitest.c,v 1.3 2017/02/25 07:28:32 jsg Exp $ */
2
3/* Public domain. 2015, Claudio Jeker */
4
5#include <sys/types.h>
6#include <sys/socket.h>
7#include <net/if.h>
8#include <err.h>
9#include <stdio.h>
10#include <string.h>
11
12int
13main(int argc, char *argv[])
14{
15 char name[IF_NAMESIZE], *ifname;
16 unsigned int lo0index;
17
18 lo0index = if_nametoindex("lo0");
19 if (lo0index == 0)
20 err(1, "if_nametoindex(lo0)");
21 ifname = if_indextoname(lo0index, name);
22 if (ifname == NULL || strcmp("lo0", ifname) != 0)
23 err(1, "if_indextoname(%u)", lo0index);
24
25 /* test failures */
26 if (if_nametoindex("4kingbula") != 0)
27 err(1, "if_nametoindex(4kingbula)");
28 if (if_indextoname(65536, name) != NULL)
29 err(1, "if_indextoname(%u)", 65536);
30
31 return 0;
32}