diff options
author | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
---|---|---|
committer | cvs2svn <admin@example.com> | 2025-04-14 17:32:06 +0000 |
commit | eb8dd9dca1228af0cd132f515509051ecfabf6f6 (patch) | |
tree | edb6da6af7e865d488dc1a29309f1e1ec226e603 /src/regress/lib/libc/ifnameindex | |
parent | 247f0352e0ed72a4f476db9dc91f4d982bc83eb2 (diff) | |
download | openbsd-tb_20250414.tar.gz openbsd-tb_20250414.tar.bz2 openbsd-tb_20250414.zip |
This commit was manufactured by cvs2git to create tag 'tb_20250414'.tb_20250414
Diffstat (limited to '')
-rw-r--r-- | src/regress/lib/libc/ifnameindex/Makefile | 12 | ||||
-rw-r--r-- | src/regress/lib/libc/ifnameindex/ifnitest.c | 32 |
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 | |||
3 | PROG= ifnitest | ||
4 | SRCS= ifnitest.c | ||
5 | NOMAN= # defined | ||
6 | |||
7 | REGRESS_TARGETS=do-test | ||
8 | |||
9 | do-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 | |||
12 | int | ||
13 | main(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 | } | ||