From 783a47ed95e5f512479b66804a38bc309a86997d Mon Sep 17 00:00:00 2001 From: Henning Brauer Date: Sat, 7 Jun 2003 21:10:48 +0000 Subject: in print_host(), don't set the mask blindly to /128 but adhere to the address family. fixes the ipv4/128:port output in pfctl -ss. --- sbin/pfctl/pf_print_state.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sbin/pfctl/pf_print_state.c') diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index 2fe474e7a4e..59609e0902e 100644 --- a/sbin/pfctl/pf_print_state.c +++ b/sbin/pfctl/pf_print_state.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_print_state.c,v 1.28 2003/05/19 20:22:53 henning Exp $ */ +/* $OpenBSD: pf_print_state.c,v 1.29 2003/06/07 21:10:47 henning Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -138,7 +138,10 @@ print_host(struct pf_state_host *h, sa_family_t af, int opts) memset(&aw, 0, sizeof(aw)); aw.v.a.addr = h->addr; - memset(&aw.v.a.mask, 0xff, sizeof(aw.v.a.mask)); + if (af == AF_INET) + aw.v.a.mask.addr32[0] = 0xffffffff; + else + memset(&aw.v.a.mask, 0xff, sizeof(aw.v.a.mask)); print_addr(&aw, af, opts & PF_OPT_VERBOSE2); } -- cgit v1.2.3