]> git.proxmox.com Git - mirror_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>
Tue, 24 Jul 2018 10:17:57 +0000 (12:17 +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 35d808abea33f3582e536728f4f1e23341d77262..e2217a5d2b562dc73310efd849e46e460adf3b19 100644 (file)
@@ -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",