summaryrefslogtreecommitdiff
path: root/astraceroute.c
diff options
context:
space:
mode:
authoruno20001 <regisztralo111@gmail.com>2019-10-08 12:43:18 +0200
committerTobias Klauser <tklauser@distanz.ch>2020-10-19 14:25:45 +0200
commit0f4320298fd992cc856134e28dca9ed653b2b15d (patch)
tree9d30ed0e8aba83cb1102cb26b97f81742837173f /astraceroute.c
parent3edc8e2a7417097695854b60680fc965a775233d (diff)
astraceroute: make some panic() messages more verbose
Signed-off-by: uno20001 <regisztralo111@gmail.com> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'astraceroute.c')
-rw-r--r--astraceroute.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/astraceroute.c b/astraceroute.c
index fe72a02..d5711fb 100644
--- a/astraceroute.c
+++ b/astraceroute.c
@@ -984,7 +984,7 @@ static int main_trace(struct ctx *ctx)
ctx->rcvlen = device_mtu(ctx->dev) - sizeof(struct ethhdr);
if (ctx->totlen >= ctx->rcvlen)
- panic("Packet len exceeds device MTU!\n");
+ panic("packet length (%zu) exceeds device MTU (%zu)\n", ctx->totlen, ctx->rcvlen);
pkt_snd = xmalloc(ctx->totlen);
pkt_rcv = xmalloc(ctx->rcvlen);
@@ -1143,11 +1143,11 @@ int main(int argc, char **argv)
case 'X':
case 't':
case 'l':
- panic("Option -%c requires an argument!\n",
+ panic("option -%c requires an argument!\n",
optopt);
default:
if (isprint(optopt))
- printf("Unknown option character `0x%X\'!\n", optopt);
+ printf("unknown option character '0x%X'!\n", optopt);
die();
}
default:
@@ -1160,9 +1160,9 @@ int main(int argc, char **argv)
help();
if (!device_up_and_running(ctx.dev))
- panic("Networking device not up and running!\n");
+ panic("networking device %s is not up and running\n", ctx.dev);
if (device_mtu(ctx.dev) <= ctx.totlen)
- panic("Packet larger than device MTU!\n");
+ panic("packet length (%zu) exceeds device MTU (%zu)\n", ctx.totlen, device_mtu(ctx.dev));
register_signal(SIGHUP, signal_handler);
register_signal(SIGINT, signal_handler);