🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Haon KIM Sat, 24 Oct 2026 17:57
[PATCH] net: l3mdev: Set OIF flag only when an L3 master exists
#7102
Author: Haon KIM
Date: Sat, 24 Oct 2026 17:57
30 lines
9459 bytes
l3mdev_master_ifindex_rcu() may return 0 when the device is not
associated with an L3 master. In that case, l3mdev_update_flow()
currently sets FLOWI_FLAG_L3MDEV_OIF even though flowi_l3mdev
remains 0.

Set FLOWI_FLAG_L3MDEV_OIF only when a non-zero L3 master ifindex
is returned, keeping the flag consistent with flowi_l3mdev.

Signed-off-by: Haon KIM <akrn112@naver.com>
---
 net/l3mdev/l3mdev.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/l3mdev/l3mdev.c b/net/l3mdev/l3mdev.c
index 5432a5f2dfc8..92b48d6a4301 100644
--- a/net/l3mdev/l3mdev.c
+++ b/net/l3mdev/l3mdev.c
@@ -279,7 +279,8 @@ void l3mdev_update_flow(struct net *net, struct flowi *fl)
 		if (dev) {
 			if (!fl->flowi_l3mdev) {
 				fl->flowi_l3mdev = l3mdev_master_ifindex_rcu(dev);
-				fl->flowi_flags |= FLOWI_FLAG_L3MDEV_OIF;
+				if (fl->flowi_l3mdev)
+					fl->flowi_flags |= FLOWI_FLAG_L3MDEV_OIF;
 			}
 
 			/* oif set to L3mdev directs lookup to its table;
-- 
2.37.0
Re: [PATCH] net: l3mdev: Set OIF flag only when an L3 master exists
#8273
Author: David Ahern
Date: Wed, 28 Oct 2026 14:50
35 lines
8979 bytes
On 10/26/26 2:30 AM, Daniel Machon wrote:
> Hi Haon,
> 
>> l3mdev_master_ifindex_rcu() may return 0 when the device is not
>> associated with an L3 master. In that case, l3mdev_update_flow()
>> currently sets FLOWI_FLAG_L3MDEV_OIF even though flowi_l3mdev
>> remains 0.
>>
>> Set FLOWI_FLAG_L3MDEV_OIF only when a non-zero L3 master ifindex
>> is returned, keeping the flag consistent with flowi_l3mdev.
>>
>> Signed-off-by: Haon KIM <akrn112@naver.com>
>> ---
>>  net/l3mdev/l3mdev.c | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/net/l3mdev/l3mdev.c b/net/l3mdev/l3mdev.c
>> index 5432a5f2dfc8..92b48d6a4301 100644
>> --- a/net/l3mdev/l3mdev.c
>> +++ b/net/l3mdev/l3mdev.c
>> @@ -279,7 +279,8 @@ void l3mdev_update_flow(struct net *net, struct flowi *fl)
>>  		if (dev) {
>>  			if (!fl->flowi_l3mdev) {
>>  				fl->flowi_l3mdev = l3mdev_master_ifindex_rcu(dev);
>> -				fl->flowi_flags |= FLOWI_FLAG_L3MDEV_OIF;
>> +				if (fl->flowi_l3mdev)
>> +					fl->flowi_flags |= FLOWI_FLAG_L3MDEV_OIF;
> 
> Looking at the readers of this flag, it does not look like this does much, so if
> anything this is a no-functional clean-up for net-next, I guess. The commit
> description could be more specific about this. Also, the target tree is missing.
> 

Example of a failing use case?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads