diff --git a/kernel/tkernel/netatop/netatop.c b/kernel/tkernel/netatop/netatop.c index db88ea94746625c0d95914a33b562764481952fe..1221b96f1327535ed186847b887a379d8576131d 100644 --- a/kernel/tkernel/netatop/netatop.c +++ b/kernel/tkernel/netatop/netatop.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 /* ** This module uses the netfilter interface to maintain statistics ** about the network traffic per task, on level of thread group @@ -81,6 +82,7 @@ ** it under the terms of the GNU General Public License version 2 as ** published by the Free Software Foundation. */ + #include #include #include @@ -970,7 +972,7 @@ get_taskinfo(pid_t id, char type) tip->btime++; #endif - strncpy(tip->command, current->comm, COMLEN); + strscpy(tip->command, current->comm, sizeof(tip->command)); return tip; } @@ -1014,7 +1016,7 @@ garbage_collector(void) ** can be found at the head */ static void -gctaskexit() +gctaskexit(void) { unsigned long flags; struct taskinfo *tip; @@ -1048,7 +1050,7 @@ gctaskexit() ** cleanup sockinfo structures that are connected to finished processes */ static void -gcsockinfo() +gcsockinfo(void) { int i; struct sockinfo *sip, *sipsave; @@ -1258,7 +1260,7 @@ gcsockinfo() ** remove taskinfo structures of finished tasks from hash list */ static void -gctaskinfo() +gctaskinfo(void) { int i; struct taskinfo *tip, *tipsave; @@ -1331,7 +1333,7 @@ gctaskinfo() ** remove all sockinfo structs */ static void -wipesockinfo() +wipesockinfo(void) { struct sockinfo *sip, *sipsave; int i; @@ -1359,7 +1361,7 @@ wipesockinfo() ** remove all taskinfo structs from hash list */ static void -wipetaskinfo() +wipetaskinfo(void) { struct taskinfo *tip, *tipsave; int i; @@ -1387,7 +1389,7 @@ wipetaskinfo() ** remove all taskinfo structs from exit list */ static void -wipetaskexit() +wipetaskexit(void) { gctaskexit(); } @@ -1674,7 +1676,7 @@ static int netatop_thread(void *dummy) ** called when module loaded */ int -init_module() +init_module(void) { int i; @@ -1765,7 +1767,7 @@ init_module() ** called when module unloaded */ void -cleanup_module() +cleanup_module(void) { /* ** tell kernel daemon to stop diff --git a/kernel/tkernel/netatop/netatop.h b/kernel/tkernel/netatop/netatop.h index a14e6fa5db52f8edf4f6e6d5a98ac0591b40f100..6f0c66ab67de0049fc34a92b0ed24e2a2973a291 100644 --- a/kernel/tkernel/netatop/netatop.h +++ b/kernel/tkernel/netatop/netatop.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #define COMLEN 16 struct taskcount { diff --git a/kernel/tkernel/netatop/netatopversion.h b/kernel/tkernel/netatop/netatopversion.h index 593dc6a65769242052df8ff30fea4eabe6a16aa3..5000858fbbd5cc76ece88796276a128554808e2e 100644 --- a/kernel/tkernel/netatop/netatopversion.h +++ b/kernel/tkernel/netatop/netatopversion.h @@ -1,2 +1,3 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #define NETATOPVERSION "0.7" #define NETATOPDATE "2015/10/09 14:26:52"