Re: [PATCH net-next 03/10] ibmveth: do not assume mac header is set in ibmveth_start_xmit()
From: mingming cao <hidden>
Date: 2026-09-07 05:20:11
On 9/1/26 5:33 PM, Eric Dumazet wrote:
quoted hunk ↗ jump to hunk
We should not assume mac header is set in output path. Use skb_eth_hdr() instead of eth_hdr() to fix the issue. Signed-off-by: Eric Dumazet <edumazet@google.com> --- drivers/net/ethernet/ibm/ibmveth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c index 73e051d26b9d8887cfed1c4168684ae199bd3108..88e8bdfbcd11293d2cc0a36ebea6dfffa50bcedd 100644 --- a/drivers/net/ethernet/ibm/ibmveth.c +++ b/drivers/net/ethernet/ibm/ibmveth.c@@ -1218,7 +1218,7 @@ static int ibmveth_is_packet_unsupported(struct sk_buff *skb, struct ethhdr *ether_header; int ret = 0; - ether_header = eth_hdr(skb); + ether_header = skb_eth_hdr(skb); if (ether_addr_equal(ether_header->h_dest, netdev->dev_addr)) { netdev_dbg(netdev, "veth doesn't support loopback packets, dropping packet.\n");
Correct. mac_header is not guaranteed to be set on entry to ndo_start_xmit; skb->data is the stable anchor in the TX path. The RX poll path already reads the IP header check through skb->data after eth_type_trans(), so no parallel fix is needed there. ibmvnic has a similar issue in its TX path: build_hdr_descs_arr(), called from ibmvnic_xmit(), passes skb_mac_header(skb) to create_hdr_descs(). Is that covered in a later batch, or shall I send a fix? Reviewed-by: Mingming Cao <redacted>