From 6eec3af9fe869e9fe5dc59af1f4e963b73efa5b1 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Mon, 19 Mar 2001 08:51:56 +0000 Subject: [PATCH] Add an example of a novel technique to the IPv6 code. This technique seems to have been developed after the IPv6 code was written, it's called "checking for error returns". Now netstat at least doesnt't go beserk in jails. --- usr.bin/netstat/inet6.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/netstat/inet6.c b/usr.bin/netstat/inet6.c index 0dd9e4e62f8d..50d57e192c06 100644 --- a/usr.bin/netstat/inet6.c +++ b/usr.bin/netstat/inet6.c @@ -348,7 +348,8 @@ ip6_stats(off, name) if (off == 0) return; - kread(off, (char *)&ip6stat, sizeof (ip6stat)); + if (kread(off, (char *)&ip6stat, sizeof (ip6stat))) + return; printf("%s:\n", name); #define p(f, m) if (ip6stat.f || sflag <= 1) \