summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
8ea2982)
No functional change, just a little bit of consistency with src / dest
specifiers where '*' means 'any' or 'all'. To follow the principle of
least surprise, allow the some for family and protocol options.
option proto '*' is equivalent to option proto 'all'
option family '*' is equivalent to option family 'any'
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
bool
fw3_parse_family(void *ptr, const char *val, bool is_list)
{
bool
fw3_parse_family(void *ptr, const char *val, bool is_list)
{
- if (!strcmp(val, "any"))
+ if (!strcmp(val, "any") || !strcmp(val, "*"))
*((enum fw3_family *)ptr) = FW3_FAMILY_ANY;
else if (!strcmp(val, "inet") || strrchr(val, '4'))
*((enum fw3_family *)ptr) = FW3_FAMILY_V4;
*((enum fw3_family *)ptr) = FW3_FAMILY_ANY;
else if (!strcmp(val, "inet") || strrchr(val, '4'))
*((enum fw3_family *)ptr) = FW3_FAMILY_V4;
while (isspace(*++val));
}
while (isspace(*++val));
}
- if (!strcmp(val, "all"))
+ if (!strcmp(val, "all") || !strcmp(val, "any") || !strcmp(val, "*"))
{
proto.any = true;
put_value(ptr, &proto, sizeof(proto), is_list);
{
proto.any = true;
put_value(ptr, &proto, sizeof(proto), is_list);