summaryrefslogtreecommitdiffstats
path: root/src/plugins/acl/acl.c
diff options
context:
space:
mode:
authorSteve Shin <jonshin@cisco.com>2017-10-13 13:13:02 -0700
committerJohn Lo <loj@cisco.com>2017-10-13 23:05:37 +0000
commit69cce166535e138e66d0a95f1cfe6a3591489e10 (patch)
tree1ccf916ce20e519d86c9ad513cf3dc9c3c82591b /src/plugins/acl/acl.c
parentbd187a8272762d64f1cbe12da7c82fc86dcbe2bf (diff)
acl-plugin: display "::" for INADDR6_ANY on ACL output
INADDR6_ANY should be displayed as "::" instead of "0.0.0.0"(ipv4 format). Change-Id: I24ec7b6febbfeca5db7ff894f455ecb73d954334 Signed-off-by: Steve Shin <jonshin@cisco.com>
Diffstat (limited to 'src/plugins/acl/acl.c')
-rw-r--r--src/plugins/acl/acl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/acl/acl.c b/src/plugins/acl/acl.c
index 7af5e9d369e..b9a4ab27134 100644
--- a/src/plugins/acl/acl.c
+++ b/src/plugins/acl/acl.c
@@ -2164,7 +2164,8 @@ my_macip_acl_rule_t_pretty_format (u8 *out, va_list *args)
out = format(out, "%s action %d ip %U/%d mac %U mask %U",
a->is_ipv6 ? "ipv6" : "ipv4", a->is_permit,
- format_ip46_address, &a->src_ip_addr, IP46_TYPE_ANY,
+ format_ip46_address, &a->src_ip_addr,
+ a->is_ipv6 ? IP46_TYPE_IP6: IP46_TYPE_IP4,
a->src_prefixlen,
my_format_mac_address, a->src_mac,
my_format_mac_address, a->src_mac_mask);
@@ -2232,8 +2233,10 @@ u8 *acl_format_acl(u8 *out0, acl_main_t *am, int acl_index)
r = &am->acls[acl_index].rules[j];
out0 = format(out0, " %4d: %s ", j, r->is_ipv6 ? "ipv6" : "ipv4");
out0 = format_acl_action(out0, r->is_permit);
- out0 = format(out0, " src %U/%d", format_ip46_address, &r->src, IP46_TYPE_ANY, r->src_prefixlen);
- out0 = format(out0, " dst %U/%d", format_ip46_address, &r->dst, IP46_TYPE_ANY, r->dst_prefixlen);
+ out0 = format(out0, " src %U/%d", format_ip46_address, &r->src,
+ r->is_ipv6 ? IP46_TYPE_IP6: IP46_TYPE_IP4, r->src_prefixlen);
+ out0 = format(out0, " dst %U/%d", format_ip46_address, &r->dst,
+ r->is_ipv6 ? IP46_TYPE_IP6: IP46_TYPE_IP4, r->dst_prefixlen);
out0 = format(out0, " proto %d", r->proto);
out0 = format(out0, " sport %d", r->src_port_or_type_first);
if (r->src_port_or_type_first != r->src_port_or_type_last) {