From mboxrd@z Thu Jan 1 00:00:00 1970 From: Emanuele Subject: Re: dev_loopback_xmit parameters Date: Tue, 24 Apr 2018 01:11:03 +0200 Message-ID: <8540fdf9-4aba-28e9-9347-fd061997fba1@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Cc: Linux Kernel Network Developers To: Eric Dumazet Return-path: Received: from mail-wr0-f178.google.com ([209.85.128.178]:41142 "EHLO mail-wr0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932601AbeDWXLO (ORCPT ); Mon, 23 Apr 2018 19:11:14 -0400 Received: by mail-wr0-f178.google.com with SMTP id g21-v6so18101199wrb.8 for ; Mon, 23 Apr 2018 16:11:13 -0700 (PDT) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Ok, clear now. Even though I don't understand what to set to avoid triggering the WARN_ON(!skb_dst(skb)); inside dev_loopback_xmit. I just would like to send the skb in loopback, i.e. moving the packet from the sending to the receiving queue of a certain struct net_device. On 24/04/2018 00:36, Eric Dumazet wrote: > > On 04/23/2018 02:40 PM, Emanuele wrote: >> Hello, >> >> I don't know if this is the right place where to ask, but I was wondering why the dev_loopback_xmit function defined in /net/core/dev.c takes struct net * and struct sock * as parameters. They are never used, so I believe passing only the struct sk_buff * should be enough. >> > Look at net/ipv6/ip6_output.c where NF_HOOK() uses dev_loopback_xmit(). > >> In addition, it would like to know where I can read what is and how to set a skb dst_entry, since I don't really understand it. >> >> Thanks a lot, >> >> Emanuele >>