Skip to contentSkip to conversation

net: Avoid strcmp current->comm with warncomm when warned >= 5

PATCH linmiaohe 1 participant 1 message Aug 19, 2020

Subsystems (2)
lore
Share & tools
lore

linmiaohe

author
#0 lore raw
Quoted 14 lines · David Miller

From: Miaohe Lin <[email protected]>
Date: Tue, 18 Aug 2020 07:41:32 -0400

Review static void sock_warn_obsolete_bsdism(const char · line 423

Quoted 9 lines
(quoted diff) +1 -1
@@ -417,7 +417,7 @@ static void sock_warn_obsolete_bsdism(const char 
 *name)  {
 	static int warned;
 	static char warncomm[TASK_COMM_LEN];
-	if (strcmp(warncomm, current->comm) && warned < 5) {
+	if (warned < 5 && strcmp(warncomm, current->comm)) {
 		strcpy(warncomm,  current->comm);
 		pr_warn("process `%s' is using obsolete %s SO_BSDCOMPAT\n",
 			warncomm, name);

We've been warning about SO_BSDCOMPAT usage for almost 20 years, I think we can remove this code completely now.

Looks sane. Will do. Many thanks.