Skip to content

Commit a196fa7

Browse files
lcpborkmann
authored andcommitted
bpfilter: Specify the log level for the kmsg message
Per the kmsg document [0], if we don't specify the log level with a prefix "<N>" in the message string, the default log level will be applied to the message. Since the default level could be warning(4), this would make the log utility such as journalctl treat the message, "Started bpfilter", as a warning. To avoid confusion, this commit adds the prefix "<5>" to make the message always a notice. [0] https://www.kernel.org/doc/Documentation/ABI/testing/dev-kmsg Fixes: 36c4357 ("net: bpfilter: print umh messages to /dev/kmsg") Reported-by: Martin Loviska <[email protected]> Signed-off-by: Gary Lin <[email protected]> Signed-off-by: Daniel Borkmann <[email protected]> Acked-by: Dmitrii Banshchikov <[email protected]> Link: https://lore.kernel.org/bpf/[email protected]
1 parent 0cc84b9 commit a196fa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/bpfilter/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ int main(void)
5757
{
5858
debug_f = fopen("/dev/kmsg", "w");
5959
setvbuf(debug_f, 0, _IOLBF, 0);
60-
fprintf(debug_f, "Started bpfilter\n");
60+
fprintf(debug_f, "<5>Started bpfilter\n");
6161
loop();
6262
fclose(debug_f);
6363
return 0;

0 commit comments

Comments
 (0)