Skip to content

Commit 5ef9f28

Browse files
ianwdavem330
authored andcommitted
OVS: Ignore negative headroom value
net_device->ndo_set_rx_headroom (introduced in 871b642) says "Setting a negtaive value reset the rx headroom to the default value". It seems that the OVS implementation in 3a927bc overlooked this and sets dev->needed_headroom unconditionally. This doesn't have an immediate effect, but can mess up later LL_RESERVED_SPACE calculations, such as done in net/ipv6/mcast.c:mld_newpack. For reference, this issue was found from a skb_panic raised there after the length calculations had given the wrong result. Note the other current users of this interface (drivers/net/tun.c:tun_set_headroom and drivers/net/veth.c:veth_set_rx_headroom) are both checking this correctly thus need no modification. Thanks to Ben for some pointers from the crash dumps! Cc: Benjamin Poirier <[email protected]> Cc: Paolo Abeni <[email protected]> Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1361414 Signed-off-by: Ian Wienand <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7cf210d commit 5ef9f28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/openvswitch/vport-internal_dev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ internal_get_stats(struct net_device *dev, struct rtnl_link_stats64 *stats)
140140

141141
static void internal_set_rx_headroom(struct net_device *dev, int new_hr)
142142
{
143-
dev->needed_headroom = new_hr;
143+
dev->needed_headroom = new_hr < 0 ? 0 : new_hr;
144144
}
145145

146146
static const struct net_device_ops internal_dev_netdev_ops = {

0 commit comments

Comments
 (0)