Skip to content

Commit e1b9efe

Browse files
idoschdavem330
authored andcommitted
net: Fix bridge enslavement failure
When a netdev is enslaved to a bridge, its parent identifier is queried. This is done so that packets that were already forwarded in hardware will not be forwarded again by the bridge device between netdevs belonging to the same hardware instance. The operation fails when the netdev is an upper of netdevs with different parent identifiers. Instead of failing the enslavement, have dev_get_port_parent_id() return '-EOPNOTSUPP' which will signal the bridge to skip the query operation. Other callers of the function are not affected by this change. Fixes: 7e1146e ("net: devlink: introduce devlink_compat_switch_id_get() helper") Signed-off-by: Ido Schimmel <[email protected]> Reported-by: Vasundhara Volam <[email protected]> Reviewed-by: Jiri Pirko <[email protected]> Reviewed-by: Nikolay Aleksandrov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9d3b2d3 commit e1b9efe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8647,7 +8647,7 @@ int dev_get_port_parent_id(struct net_device *dev,
86478647
if (!first.id_len)
86488648
first = *ppid;
86498649
else if (memcmp(&first, ppid, sizeof(*ppid)))
8650-
return -ENODATA;
8650+
return -EOPNOTSUPP;
86518651
}
86528652

86538653
return err;

0 commit comments

Comments
 (0)