From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Jason@zx2c4.com Received: from krantz.zx2c4.com (localhost [127.0.0.1]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id f988d66d for ; Tue, 29 May 2018 23:59:04 +0000 (UTC) Received: from frisell.zx2c4.com (frisell.zx2c4.com [192.95.5.64]) by krantz.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 967476e0 for ; Tue, 29 May 2018 23:59:04 +0000 (UTC) Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTP id 5bb6c83e for ; Tue, 29 May 2018 23:57:51 +0000 (UTC) Received: by frisell.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 47b3f57c (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128:NO) for ; Tue, 29 May 2018 23:57:51 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id 11-v6so14723022ois.8 for ; Tue, 29 May 2018 17:01:06 -0700 (PDT) MIME-Version: 1.0 From: "Jason A. Donenfeld" Date: Wed, 30 May 2018 02:01:05 +0200 Message-ID: Subject: Missing skb->dst with flow offloading To: Pablo Neira Ayuso Content-Type: text/plain; charset="UTF-8" Cc: Netdev , netfilter-devel@vger.kernel.org, Jaap Buurman , openwrt-devel@lists.openwrt.org, WireGuard mailing list , Felix Fietkau List-Id: Development discussion of WireGuard List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Hey Pablo, Some OpenWRT people have reported to me that there's a crash when enabling flow offloading, because I rely on skb_dst(skb) being non-null in ndo_start_xmit. The fix in my code for this is very simple: - mtu = dst_mtu(skb_dst(skb)); + dst = skb_dst(skb); + mtu = dst ? dst_mtu(dst) : dev->mtu; I can make this change, but I wanted to be certain first that omitting the dst in the skb is intentional on your part. (If so, there might be other drivers to fix as well.) In tracing this, it looks like a packet that's forwarded from a flow offloaded interface to a virtual interface gets diverted immediately via neigh_xmit, where it is then passed to a virtual interface via dev_queue_xmit. I can't see anywhere along this path a call to skb_dst_set. Perhaps this is intended, as flow offloading is supposed to skip the routing table? Or is there an oversight in the new flow offloading code? I'd appreciate your input, so that I can make the appropriate change -- or not -- to my code. Regards, Jason