diff options
Diffstat (limited to 'sbin/pfctl/pf_print_state.c')
-rw-r--r-- | sbin/pfctl/pf_print_state.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sbin/pfctl/pf_print_state.c b/sbin/pfctl/pf_print_state.c index d10c674f1cc..133f7afa28a 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.54 2009/03/19 01:00:16 bluhm Exp $ */ +/* $OpenBSD: pf_print_state.c,v 1.55 2009/11/03 10:59:04 claudio Exp $ */ /* * Copyright (c) 2001 Daniel Hartmeier @@ -165,8 +165,12 @@ print_name(struct pf_addr *addr, sa_family_t af) } void -print_host(struct pf_addr *addr, u_int16_t port, sa_family_t af, int opts) +print_host(struct pf_addr *addr, u_int16_t port, sa_family_t af, int rdom, + int opts) { + if (rdom) + printf("(%d) ", rdom); + if (opts & PF_OPT_USEDNS) print_name(addr, af); else { @@ -231,22 +235,24 @@ print_state(struct pfsync_state *s, int opts) else printf("%u ", s->proto); - print_host(&nk->addr[1], nk->port[1], s->af, opts); + print_host(&nk->addr[1], nk->port[1], s->af, nk->rdomain, opts); if (PF_ANEQ(&nk->addr[1], &sk->addr[1], s->af) || - nk->port[1] != sk->port[1]) { + nk->port[1] != sk->port[1] || + nk->rdomain != sk->rdomain) { printf(" ("); - print_host(&sk->addr[1], sk->port[1], s->af, opts); + print_host(&sk->addr[1], sk->port[1], s->af, sk->rdomain, opts); printf(")"); } if (s->direction == PF_OUT) printf(" -> "); else printf(" <- "); - print_host(&nk->addr[0], nk->port[0], s->af, opts); + print_host(&nk->addr[0], nk->port[0], s->af, nk->rdomain, opts); if (PF_ANEQ(&nk->addr[0], &sk->addr[0], s->af) || - nk->port[0] != sk->port[0]) { + nk->port[0] != sk->port[0] || + nk->rdomain != sk->rdomain) { printf(" ("); - print_host(&sk->addr[0], sk->port[0], s->af, opts); + print_host(&sk->addr[0], sk->port[0], s->af, sk->rdomain, opts); printf(")"); } |