提交 13405468 编写于 作者: J Jakub Kicinski 提交者: David S. Miller

bpfilter: don't pass O_CREAT when opening console for debug

Passing O_CREAT (00000100) to open means we should also pass file
mode as the third parameter.  Creating /dev/console as a regular
file may not be helpful anyway, so simply drop the flag when
opening debug_fd.

Fixes: d2ba09c1 ("net: add skeleton of bpfilter kernel module")
Signed-off-by: NJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: NDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 61a552eb
......@@ -55,7 +55,7 @@ static void loop(void)
int main(void)
{
debug_fd = open("/dev/console", 00000002 | 00000100);
debug_fd = open("/dev/console", 00000002);
dprintf(debug_fd, "Started bpfilter\n");
loop();
close(debug_fd);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册