The only place in ipset where ipset_parse_elem is called is src/ipset.c. The
second parameter to the function call is type->last_elem_optional, which is of
type bool, but ipset_parse_elem is defined in lib/parse.c with the second
parameter having type enum ipset_opt.
The use in lib/parse.c is clearly as a bool.
extern int ipset_parse_ignored(struct ipset_session *session,
enum ipset_opt opt, const char *str);
extern int ipset_parse_elem(struct ipset_session *session,
- enum ipset_opt opt, const char *str);
+ bool optional, const char *str);
extern int ipset_call_parser(struct ipset_session *session,
const struct ipset_arg *arg,
const char *str);
*/
int
ipset_parse_elem(struct ipset_session *session,
- enum ipset_opt optional, const char *str)
+ bool optional, const char *str)
{
const struct ipset_type *type;
char *a = NULL, *b = NULL, *tmp, *saved;