conntrack: update manpage with new -A command
Pablo Neira Ayuso
maintainerPATCH 1/3 conntrack: update manpage with new -A command
Extend manpage to document the new -A/--add command.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- conntrack.8 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
conntrack.8 +8 -3
@@ -14,6 +14,8 @@ conntrack \- command line interface for netfilter connection tracking .br .BR "conntrack -I [table] parameters" .br +.BR "conntrack -A [table] parameters" +.br .BR "conntrack -U [table] parameters" .br .BR "conntrack -E [table] [options]"
@@ -88,7 +90,10 @@ Search for and show a particular (matching) entry in the given table. Delete an entry from the given table. .TP .BI "-I, --create " -Create a new entry from the given table. +Create a new entry from the given table, it fails if it already exists. +.TP +.BI "-A, --add " +Add a new entry from the given table. .TP .BI "-U, --update " Update an entry from the given table.
@@ -186,8 +191,8 @@ Use multiple \-l options to specify multiple labels that need to be set. .TP .BI "--label-add " "LABEL" Specify the conntrack label to add to the selected conntracks. -This option is only available in conjunction with "\-I, \-\-create" or -"\-U, \-\-update". +This option is only available in conjunction with "\-I, \-\-create", +"\-A, \-\-add" or "\-U, \-\-update". .TP .BI "--label-del " "[LABEL]" Specify the conntrack label to delete from the selected conntracks.
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 2/3 conntrack: use IPPROTO_RAW
IPPROTO_MPTCP defeats the purpose of IPPROTO_MAX to check for the maximum layer 4 protocol supported in the IP header.
Use IPPROTO_RAW (255) instead.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/conntrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
src/conntrack.c +1 -1
@@ -840,7 +840,7 @@ static int parse_proto_num(const char *str)long val; val =strtol (str, &endptr,0 ); -if (val >=IPPROTO_MAX || +if (val >IPPROTO_RAW || val <0 || endptr == str || *endptr !='\0' )
Signature · 1 line
2.30.2
Pablo Neira Ayuso
maintainerPATCH 3/3 conntrack: slightly simplify parse_proto_num() by using strtoul()
In reply to Pablo Neira AyusoUse strtoul() instead and remove check for negative value.
Signed-off-by Pablo Neira Ayuso <[email protected]>
--- src/conntrack.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
src/conntrack.c +2 -3
@@ -836,12 +836,11 @@ extern struct ctproto_handler ct_proto_unknown;static int parse_proto_num (const char *str) { +unsigned long val;char *endptr; -long val; - val =strtol (str, &endptr,0 ); + val =strtoul (str, &endptr,0 );if (val >IPPROTO_RAW || - val <0 || endptr == str || *endptr !='\0' )return -1 ;
Signature · 1 line
2.30.2