mirror of
https://github.com/torvalds/linux.git
synced 2026-11-06 21:58:01 +01:00
veth: keep carrier off when resizing channels with a down peer
veth_set_channels() temporarily turns carrier off while reconfiguring a
running interface. It then turns carrier on for both ends without
checking whether the peer is administratively up. If only one end is up,
changing its channel counts therefore reports LOWER_UP even though the
peer remains down.
For example, after creating a pair with two RX and TX queues per end:
ip link set vca up
ethtool -L vca rx 1 tx 1
vca incorrectly reports LOWER_UP while vcb is still down.
Only restore carrier when the peer has IFF_UP, matching veth_open().
The local interface is already known to be running at this point.
Found during LLM-assisted source review and reproduced with a veth pair
in network namespaces, without kernel instrumentation or error injection.
The companion veth.sh test reproduces the two mixed up/down failures
before the fix and passes after it.
Fixes: 4752eeb3d8 ("veth: implement support for set_channel ethtool op")
Cc: stable@vger.kernel.org
Reviewed-by: Hangbin Liu <liuhangbin@kylinos.cn>
Signed-off-by: Xia Yan <yana06070@163.com>
Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Link: https://patch.msgid.link/20261029024259.3700-1-yana06070@163.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
parent
631c3b1859
commit
2d02191779
|
|
@ -1377,9 +1377,10 @@ static int veth_set_channels(struct net_device *dev,
|
|||
* to identify the range we have to disable
|
||||
*/
|
||||
veth_disable_range_safe(dev, new_rx_count, old_rx_count);
|
||||
netif_carrier_on(dev);
|
||||
if (peer)
|
||||
if (peer && (peer->flags & IFF_UP)) {
|
||||
netif_carrier_on(dev);
|
||||
netif_carrier_on(peer);
|
||||
}
|
||||
}
|
||||
|
||||
/* update XDP supported features */
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user