From 0b328d3fdbaae081436ac7fb96ff700da4856799 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 6 Jul 2018 13:09:13 +0200 Subject: [PATCH] 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 --- zebra/zebra_pbr.c | 9 +++++++++ 1 file changed, 9 insertions(+) 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", -- 2.39.5