From: Philippe Guibert Date: Fri, 6 Jul 2018 11:09:13 +0000 (+0200) Subject: zebra: add information about which port is monitored X-Git-Tag: frr-6.1-dev~135^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=0b328d3fdbaae081436ac7fb96ff700da4856799;p=matthieu%2Ffrr.git zebra: add information about which port is monitored Each ipset with port value monitors either src port or dst port. The information is added to show pbr iptable commmand. Signed-off-by: Philippe Guibert --- diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 35d808abea..e2217a5d2b 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -1072,6 +1072,15 @@ static void zebra_pbr_show_iptable_unit(struct zebra_pbr_iptable *iptable, vty_out(vty, "IPtable %s action %s (%u)\n", iptable->ipset_name, iptable->action == ZEBRA_IPTABLES_DROP ? "drop" : "redirect", iptable->unique); + if (iptable->type == IPSET_NET_PORT || + iptable->type == IPSET_NET_PORT_NET) { + if (!(iptable->filter_bm & MATCH_ICMP_SET)) { + if (iptable->filter_bm & PBR_FILTER_DST_PORT) + vty_out(vty, "\t lookup dst port\n"); + else if (iptable->filter_bm & PBR_FILTER_SRC_PORT) + vty_out(vty, "\t lookup src port\n"); + } + } if (iptable->pkt_len_min || iptable->pkt_len_max) { if (!iptable->pkt_len_max) vty_out(vty, "\t pkt len %u\n",