detect/firewall: address HTTP/1 policies as http1

AppProtoToString(ALPROTO_HTTP1) returns "http", so an HTTP/1 policy had to
be written as `http:` while its rule hooks were already spelled `http1:`.
Use the same name in both places.

Ticket: 8712
pull/16039/head
Lukas Sismis 3 months ago committed by Victor Julien
parent 3adbd677e8
commit 04c9fd9e22

@ -62,7 +62,7 @@ Application layer tables
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
If applayer is available, rules from the following tables apply. The tables for the If applayer is available, rules from the following tables apply. The tables for the
application layer are per app layer protocol and per protocol state. e.g. ``http:request_line``. application layer are per app layer protocol and per protocol state. e.g. ``http1:request_line``.
.. table:: .. table::

@ -67,7 +67,7 @@ In the example below: the config auto accepts various hooks, leaving just ``http
firewall: firewall:
policies: policies:
http: http1:
request-started: request-started:
- "accept:hook" - "accept:hook"
request-line: request-line:

@ -4176,7 +4176,7 @@ static int DoParseAppSubStatePolicy(const char *prefix, const AppProto app_proto
nname[i] = '-'; nname[i] = '-';
} }
const char *app_name = AppProtoToString(app_proto); const char *app_name = AppProtoToStringRaw(app_proto);
int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s.%s", prefix, app_name, int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s.%s", prefix, app_name,
sub_state_name, nname); sub_state_name, nname);
SCLogDebug("policy_name %s", policy_name); SCLogDebug("policy_name %s", policy_name);
@ -4245,7 +4245,7 @@ static int DoParseAppPolicy(const char *prefix, const AppProto app_proto, const
nname[i] = '-'; nname[i] = '-';
} }
const char *app_name = AppProtoToString(app_proto); const char *app_name = AppProtoToStringRaw(app_proto);
int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s", prefix, app_name, nname); int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s", prefix, app_name, nname);
SCFree(nname); SCFree(nname);
if (r < 0 || (size_t)r >= sizeof(policy_name)) { if (r < 0 || (size_t)r >= sizeof(policy_name)) {

Loading…
Cancel
Save