summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorKenjiro Cho <kjc@cvs.openbsd.org>2002-11-07 09:33:22 +0000
committerKenjiro Cho <kjc@cvs.openbsd.org>2002-11-07 09:33:22 +0000
commitb466b0fac26918371761aa5bfbf7e16c92a1c4d1 (patch)
treec8942e68d5aa5ba302dc4e0eb6f7b35290a0b4fa /usr.sbin
parent9a4ae08dbefcdade7f3c1c871fc0134f7ddf732e (diff)
check (server == NULL) to not crash "altqstat -s -i lo0"
when altqd is not running. report and fix by Chad Loder <cloder@loder.us>
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/altq/altqstat/quip_client.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/altq/altqstat/quip_client.c b/usr.sbin/altq/altqstat/quip_client.c
index e8c3a4f301c..aa8052539b0 100644
--- a/usr.sbin/altq/altqstat/quip_client.c
+++ b/usr.sbin/altq/altqstat/quip_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quip_client.c,v 1.5 2002/02/13 08:17:09 kjc Exp $ */
+/* $OpenBSD: quip_client.c,v 1.6 2002/11/07 09:33:21 kjc Exp $ */
/* $KAME: quip_client.c,v 1.4 2001/08/16 07:43:15 itojun Exp $ */
/*
* Copyright (C) 1999-2000
@@ -424,6 +424,11 @@ quip_printfilter(const char *ifname, const u_long handle)
char buf[BODY_MAXSIZE], req[REQ_MAXSIZE], *cp;
int result_code, len;
+ if (server == NULL) {
+ printf("No server available!\n");
+ return;
+ }
+
/* get qdisc info from the server */
snprintf(req, sizeof(req), "GET filter?%s::%#lx\n", ifname, handle);
quip_sendrequest(server, req);
@@ -462,6 +467,11 @@ quip_printconfig(void)
enum nametype type;
u_long handle;
+ if (server == NULL) {
+ printf("No server available!\n");
+ return;
+ }
+
/* get a total list from the server */
quip_sendrequest(server, "GET list\n");