All of lore.kernel.org
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: Claude Robitaille <clauder@accedian.com>
Cc: netdev@vger.kernel.org
Subject: Re: sk_buff handling in packet handler
Date: Sun, 17 May 2009 00:19:49 +0400	[thread overview]
Message-ID: <20090516201949.GA3408@ioremap.net> (raw)
In-Reply-To: <4A0EEA60.6090702@accedian.com>

On Sat, May 16, 2009 at 12:31:28PM -0400, Claude Robitaille (clauder@accedian.com) wrote:
> I suspect that the handler needs to do something with the sk_buff but I 
> am not sure what. I printed the content of the sk_buff and found that 
> the skb_buff is not cloned (looking on the web I had found that the 
> sk_buff should have been cloned) and that he number of users is 1.
> 
> Should I simply do a dev_kfree_skb? What are the rules governing the use 
> of the sk_buff in a packet handler? Should I clone the sk_buff?
> 
> Also, a related question, the packet handler is expected to return an 
> int. What should be returned?

Use packet socket code as the best documentation, in particular
packet_rcv, but 0 is ok, although in theory it should match NET_RX_*
constants.

-- 
	Evgeniy Polyakov

  reply	other threads:[~2009-05-16 20:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-16 16:31 sk_buff handling in packet handler Claude Robitaille
2009-05-16 20:19 ` Evgeniy Polyakov [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-05-17  0:55 Mark Smith
2009-05-17 17:23 ` Claude Robitaille
2009-05-18  5:38   ` Stephen Hemminger
2009-05-19 22:41 ` Claude Robitaille

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090516201949.GA3408@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=clauder@accedian.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.