提交 a196fa78 编写于 作者: G Gary Lin 提交者: Daniel Borkmann

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: 36c4357c ("net: bpfilter: print umh messages to /dev/kmsg")
Reported-by: NMartin Loviska <mloviska@suse.com>
Signed-off-by: NGary Lin <glin@suse.com>
Signed-off-by: NDaniel Borkmann <daniel@iogearbox.net>
Acked-by: NDmitrii Banshchikov <me@ubique.spb.ru>
Link: https://lore.kernel.org/bpf/20210623040918.8683-1-glin@suse.com
上级 0cc84b9a
无相关合并请求
......@@ -57,7 +57,7 @@ int main(void)
{
debug_f = fopen("/dev/kmsg", "w");
setvbuf(debug_f, 0, _IOLBF, 0);
fprintf(debug_f, "Started bpfilter\n");
fprintf(debug_f, "<5>Started bpfilter\n");
loop();
fclose(debug_f);
return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册
反馈
建议
客服 返回
顶部