LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-18-2021, 11:23 AM   #1
slipknothoudini
LQ Newbie
 
Registered: Jun 2021
Posts: 2
Blog Entries: 1

Rep: Reputation: Disabled
skb_buff manipulation


I have a couple of questions in respect to skb_buff manipulation:

1) when you call skb_copy in a nf_hookfn
a) when is kfree_skb supposed to be called
b) if you wanted that skb_copy to replace the buffer that is passed into a nf_hookfn would you return NF_DROP in your hook_fn

2) If I wanted to store data and associate it with the skb_buff so I could retrieve said data (ideally on a separate endpoint) what would be the best method. All I could find was using skb_put to write the data and then doing some pointer math to find and read the data; for some reason skb_buff->tail - data_length and reading from that memory address will not work and so I do something akin to (skb_buff->data + skb_buff->len) - data_length and read from there which seems to work. Also this seems error prone considering other filters could put their own data into the data section and mess this up.

Last edited by slipknothoudini; 07-18-2021 at 11:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Authentication Token Manipulation Error manfernandez Linux - Security 10 06-06-2008 11:49 AM
LXer: jQuery Table Manipulation Tutorial LXer Syndicated Linux News 0 08-15-2007 10:20 PM
Video manipulation etc bolta Linux - General 11 08-30-2003 02:34 AM
tcp window manipulation? N_A_J_M Linux - Networking 10 05-09-2003 08:18 AM
perl and date manipulation Syncrm Programming 5 10-28-2002 02:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:25 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration