Fail explicitly on unexptected imsg->hdr_type. Otherwise the following
authortobhe <tobhe@openbsd.org>
Sun, 14 Jul 2024 13:13:33 +0000 (13:13 +0000)
committertobhe <tobhe@openbsd.org>
Sun, 14 Jul 2024 13:13:33 +0000 (13:13 +0000)
comparison is undefined.

sbin/iked/vroute.c

index 5ef892d..1e05d36 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vroute.c,v 1.19 2023/06/13 12:34:12 tb Exp $  */
+/*     $OpenBSD: vroute.c,v 1.20 2024/07/14 13:13:33 tobhe Exp $       */
 
 /*
  * Copyright (c) 2021 Tobias Heider <tobhe@openbsd.org>
@@ -631,6 +631,8 @@ vroute_getroute(struct iked *env, struct imsg *imsg)
        case IMSG_VROUTE_DEL:
                type = RTM_DELETE;
                break;
+       default:
+               return (-1);
        }
 
        if (type == RTM_ADD)