#536 ipnat can try to print rule as dstlist incorrectly

This commit is contained in:
darrenr 2014-06-29 08:51:01 +00:00
parent 9118f0148c
commit e3b9d7cc54

View File

@ -1,4 +1,4 @@
/* $NetBSD: printnat.c,v 1.2 2012/07/22 14:27:37 darrenr Exp $ */ /* $NetBSD: printnat.c,v 1.3 2014/06/29 08:51:01 darrenr Exp $ */
/* /*
* Copyright (C) 2012 by Darren Reed. * Copyright (C) 2012 by Darren Reed.
@ -153,7 +153,8 @@ printnat(np, opts)
} else if (np->in_redir & NAT_REWRITE) { } else if (np->in_redir & NAT_REWRITE) {
PRINTF(" -> src "); PRINTF(" -> src ");
if (np->in_nsrc.na_type == IPLT_DSTLIST) { if (np->in_nsrc.na_atype == FRI_LOOKUP &&
np->in_nsrc.na_type == IPLT_DSTLIST) {
PRINTF("dstlist/"); PRINTF("dstlist/");
if (np->in_nsrc.na_subtype == 0) if (np->in_nsrc.na_subtype == 0)
PRINTF("%d", np->in_nsrc.na_num); PRINTF("%d", np->in_nsrc.na_num);
@ -174,7 +175,8 @@ printnat(np, opts)
} }
} }
PRINTF(" dst "); PRINTF(" dst ");
if (np->in_ndst.na_type == IPLT_DSTLIST) { if (np->in_ndst.na_atype == FRI_LOOKUP &&
np->in_ndst.na_type == IPLT_DSTLIST) {
PRINTF("dstlist/"); PRINTF("dstlist/");
if (np->in_ndst.na_subtype == 0) if (np->in_ndst.na_subtype == 0)
PRINTF("%d", np->in_nsrc.na_num); PRINTF("%d", np->in_nsrc.na_num);