LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 04-16-2010, 06:37 PM   #1
zman2245
LQ Newbie
 
Registered: Mar 2009
Location: San Francisco, CA
Posts: 26

Rep: Reputation: 15
Need to add proprietary headers on outgoing packets


Using a kernel module that sits between the kernel stack and the network driver, I need to put extra headers on all packets going out of Linux. Note this will result in "frames" that are not really Ethernet frames and the network driver HW is being used more as a DMA engine than an Ethernet device.

The headers are larger that any headroom left on the packets. I would like to avoid using skb_realloc_headroom() for performance reasons; is there any way to do this? I originally thought changing NET_SKB_PAD would help, but apparently that is only for Rx packets.

Maybe changing MAX_HEADER will help? It isn't clear though whether this would help for many cases or not....

Thanks,
Zack

Last edited by zman2245; 04-16-2010 at 06:47 PM.
 
Old 05-10-2010, 03:55 PM   #2
sharat_chandra
LQ Newbie
 
Registered: Jun 2008
Posts: 4

Rep: Reputation: 0
Hi Zack,

I am in the exact same situation, have you found a good way to do this ?

I know tcp uses sk->sk_prot->max_header to do this, but not sure if this would be application to all transport protocols. I was not able to confirm this for udp or icmp.

Please let me know if you have concluded anything.

Thanks.
 
Old 05-10-2010, 11:19 PM   #3
zman2245
LQ Newbie
 
Registered: Mar 2009
Location: San Francisco, CA
Posts: 26

Original Poster
Rep: Reputation: 15
Yea, try setting netdev->hard_header_len in the driver to whatever length you need reserved.
 
  


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
Is there a way to capture outgoing packets only? homer_3 Linux - Networking 1 06-11-2009 11:02 AM
Must the source IP in SA (used for outgoing packets) be the sender's IP? arrowheart Linux - Security 2 02-25-2009 12:16 AM
check incoming or outgoing packets ilnli Programming 1 07-24-2007 03:08 PM
how to add & register filter for intercepting the packets outgoing on port 80? jayashri Programming 2 11-08-2004 01:30 PM
drop incoming/outgoing packets using iptables doshiaj Linux - Security 1 06-08-2004 10:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 10:59 PM.

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