Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/userguide/firewall/firewall-design.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Application layer tables
~~~~~~~~~~~~~~~~~~~~~~~~

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``.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be confirmed, but if we already have stuff backported where http is an alias to http1, should we keep it that way? (or do we change in 9, and document?)



.. table::
Expand Down
2 changes: 1 addition & 1 deletion doc/userguide/firewall/firewall-example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ In the example below: the config auto accepts various hooks, leaving just ``http

firewall:
policies:
http:
http1:
request-started:
- "accept:hook"
request-line:
Expand Down
4 changes: 2 additions & 2 deletions src/detect-parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -4178,7 +4178,7 @@ static int DoParseAppSubStatePolicy(const char *prefix, const AppProto app_proto
nname[i] = '-';
}

const char *app_name = AppProtoToString(app_proto);
const char *app_name = (app_proto == ALPROTO_HTTP1) ? "http1" : AppProtoToString(app_proto);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe time to have another function than AppProtoToString that does this

And use it in DetectRegisterAppLayerHookLists and DetectEngineAppHookToSmlist where we already do this

int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s.%s", prefix, app_name,
sub_state_name, nname);
SCLogDebug("policy_name %s", policy_name);
Expand Down Expand Up @@ -4247,7 +4247,7 @@ static int DoParseAppPolicy(const char *prefix, const AppProto app_proto, const
nname[i] = '-';
}

const char *app_name = AppProtoToString(app_proto);
const char *app_name = (app_proto == ALPROTO_HTTP1) ? "http1" : AppProtoToString(app_proto);
int r = snprintf(policy_name, sizeof(policy_name), "%s.%s.%s", prefix, app_name, nname);
SCFree(nname);
if (r < 0 || (size_t)r >= sizeof(policy_name)) {
Expand Down