]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: add information about which port is monitored
authorPhilippe Guibert <philippe.guibert@6wind.com>
Fri, 6 Jul 2018 11:09:13 +0000 (13:09 +0200)
committerPhilippe Guibert <philippe.guibert@6wind.com>
Mon, 20 Aug 2018 16:33:38 +0000 (18:33 +0200)
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 <philippe.guibert@6wind.com>
zebra/zebra_pbr.c

index 36081732343d15079deecb60b881c10395015aa8..6b7106b0edfa0144d048ad9a9fcee4db4df48816 100644 (file)
@@ -1069,6 +1069,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",