[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260131150212.3292929-1-ingyujang25@korea.ac.kr>
Date: Sun, 1 Feb 2026 00:02:12 +0900
From: Ingyu Jang <ingyujang25@...ea.ac.kr>
To: netdev@...r.kernel.org
Cc: davem@...emloft.net,
dsahern@...nel.org,
edumazet@...gle.com,
Ingyu Jang <ingyujang25@...ea.ac.kr>
Subject: [Question] Dead code in rawv6_mh_filter_register()?
Hi,
I noticed that in net/ipv6/raw.c, the function
rawv6_mh_filter_register() always returns 0.
The function (at line 117) simply performs:
- rcu_assign_pointer(mh_filter, filter)
- return 0
However, in net/ipv6/mip6.c, the function mip6_init() checks the
return value and has error handling (at line 381):
if (rawv6_mh_filter_register(mip6_mh_filter) < 0) {
pr_info("%s: can't add rawv6 mh filter\n", __func__);
goto mip6_rawv6_mh_fail;
}
Since rawv6_mh_filter_register() never fails, this error path
appears to be dead code. The same applies to
rawv6_mh_filter_unregister() in mip6_fini().
Is this intentional defensive coding for potential future changes,
or could this be cleaned up by making these functions return void?
Thanks,
Ingyu Jang
Powered by blists - more mailing lists