Skip to content

Commit

Permalink
bpfilter: don't pass O_CREAT when opening console for debug
Browse files Browse the repository at this point in the history
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: d2ba09c ("net: add skeleton of bpfilter kernel module")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed May 24, 2018
1 parent 61a552e commit 1340546
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/bpfilter/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 1340546

Please sign in to comment.