extensions: split assignments and if-exprs

This commit is contained in:
Jan Engelhardt
2020-10-25 15:41:24 +01:00
parent 939d3ee0d3
commit bfb0516c79
8 changed files with 22 additions and 15 deletions

View File

@@ -91,12 +91,11 @@ proto_to_name(uint8_t proto)
static const char *
check_proto(uint16_t pnum, uint8_t invflags)
{
char *proto;
if (invflags & XT_INV_PROTO)
xtables_error(PARAMETER_PROBLEM, PKNOCK "only works with TCP and UDP.");
if ((proto = proto_to_name(pnum)) != NULL)
const char *proto = proto_to_name(pnum);
if (proto != NULL)
return proto;
else if (pnum == 0)
xtables_error(PARAMETER_PROBLEM, PKNOCK "needs `-p tcp' or `-p udp'");