filter = &mfilter->u.zfilter;
- if (filter->prefix.family == AF_ETHERNET) {
- return prefix_match(&filter->prefix, p);
- }
-
- if (filter->prefix.family == AF_INET
- || filter->prefix.family == AF_INET6) {
-
- if (filter->prefix.family == p->family) {
- if (filter->exact) {
- if (filter->prefix.prefixlen == p->prefixlen)
- return prefix_match(&filter->prefix, p);
- else
- return 0;
- } else
+ if (filter->prefix.family == p->family) {
+ if (filter->exact) {
+ if (filter->prefix.prefixlen == p->prefixlen)
return prefix_match(&filter->prefix, p);
+ else
+ return 0;
} else
- return 0;
- }
-
- return 0;
+ return prefix_match(&filter->prefix, p);
+ } else
+ return 0;
}
/* Allocate new access list structure. */
: "Standard")
: "Zebra",
(afi == AFI_IP)
- ? ("")
- : ((afi == AFI_IP6) ? ("ipv6 ")
- : ("mac ")),
+ ? ("IP")
+ : ((afi == AFI_IP6) ? ("IPv6 ")
+ : ("MAC ")),
access->name);
write = 0;
}
: "Standard")
: "Zebra",
(afi == AFI_IP)
- ? ("")
- : ((afi == AFI_IP6) ? ("ipv6 ")
- : ("mac ")),
+ ? ("IP")
+ : ((afi == AFI_IP6) ? ("IPv6 ")
+ : ("MAC ")),
access->name);
write = 0;
}
inet_ntop(p->family, &p->u.prefix, buf, BUFSIZ),
p->prefixlen, filter->exact ? " exact-match" : "");
else if (p->family == AF_ETHERNET) {
- if (is_zero_mac(&(p->u.prefix_eth)))
+ if (p->prefixlen == 0)
vty_out(vty, " any");
else
vty_out(vty, " %s", prefix_mac2str(&(p->u.prefix_eth),
#define MASKBIT(offset) ((0xff << (PNBBY - (offset))) & 0xff)
-int is_zero_mac(const struct ethaddr *mac)
+static int is_zero_mac(const struct ethaddr *mac)
{
int i = 0;
int i;
bool slash = false;
+ if (!strcmp(str, "any")) {
+ memset(p, 0, sizeof(*p));
+ p->family = AF_ETHERNET;
+ return 1;
+ }
+
/* Find slash inside string. */
pnt = strchr(str, '/');