MINOR: config: Add support for ARGT_MSK6

This commit adds support for ARGT_MSK6 to make_arg_list().
This commit is contained in:
Tim Duesterhus 2018-01-25 16:24:50 +01:00 committed by Willy Tarreau
parent 471851713a
commit b814da6c5c
2 changed files with 16 additions and 2 deletions

View File

@ -206,8 +206,15 @@ int make_arg_list(const char *in, int len, uint64_t mask, struct arg **argp,
goto parse_err;
break;
case ARGT_MSK6: /* not yet implemented */
goto not_impl;
case ARGT_MSK6:
if (in == beg) // empty mask
goto empty_err;
if (!str2mask6(word, &arg->data.ipv6))
goto parse_err;
arg->type = ARGT_IPV6;
break;
case ARGT_TIME:
if (in == beg) // empty time

View File

@ -704,6 +704,13 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp,
break;
case ARGT_MSK6:
memcpy(trash.str, argp[idx].data.str.str, argp[idx].data.str.len);
trash.str[argp[idx].data.str.len] = 0;
if (!str2mask6(trash.str, &argp[idx].data.ipv6))
WILL_LJMP(luaL_argerror(L, first + idx, "invalid IPv6 mask"));
argp[idx].type = ARGT_MSK6;
break;
case ARGT_MAP:
case ARGT_REG:
case ARGT_USR: