From 6baf639a9c14f8673ff621f8be1eed672d1fc44e Mon Sep 17 00:00:00 2001 From: Matthias Cramer Date: Thu, 3 Apr 2025 17:09:25 +0200 Subject: [PATCH] error when interface is not specified --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 1f0e6a3..58b454d 100644 --- a/main.c +++ b/main.c @@ -206,6 +206,12 @@ int main(int argc, char *argv[]) { return 1; } + // Check if the interface is specified + if (dev_name == NULL) { + fprintf(stderr, "Error: Interface must be specified\n"); + return 1; + } + // Resolve the destination address memset(&hints, 0, sizeof(hints)); hints.ai_family = AF_UNSPEC; // Allow IPv4 or IPv6