summaryrefslogtreecommitdiff
path: root/sbin/iked
diff options
context:
space:
mode:
authorTobias Heider <tobhe@cvs.openbsd.org>2023-08-14 12:02:03 +0000
committerTobias Heider <tobhe@cvs.openbsd.org>2023-08-14 12:02:03 +0000
commit3a307f43c91baf47f7219eaf5affb2695d832a17 (patch)
tree87acd53be535715680b00dc881aaf842201acae1 /sbin/iked
parent2dc9e68c884da39681b395532c3bc1787abda8e5 (diff)
Improve error message when if_indextoname() fails.
Diffstat (limited to 'sbin/iked')
-rw-r--r--sbin/iked/pfkey.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/iked/pfkey.c b/sbin/iked/pfkey.c
index 80a931d5132..ac9e79c20df 100644
--- a/sbin/iked/pfkey.c
+++ b/sbin/iked/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.83 2023/08/11 11:24:55 tobhe Exp $ */
+/* $OpenBSD: pfkey.c,v 1.84 2023/08/14 12:02:02 tobhe Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -697,9 +697,9 @@ pfkey_sa(struct iked *env, uint8_t satype, uint8_t action, struct iked_childsa *
if (pol->pol_flags & IKED_POLICY_ROUTING) {
sa_iface.sadb_x_iface_exttype = SADB_X_EXT_IFACE;
sa_iface.sadb_x_iface_len = sizeof(sa_iface) / 8;
- if (if_indextoname(pol->pol_iface, iface) == NULL) {
- log_warnx("%s: unsupported interface %s",
- __func__, iface);
+ if (if_indextoname(pol->pol_iface, iface) == 0) {
+ log_warn("%s: unsupported interface %d",
+ __func__, pol->pol_iface);
return (-1);
}
ifminor = strtonum(iface + strlen("sec"), 0, UINT_MAX, &errstr);