LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-01-2015, 01:32 AM   #1
alancc_wu
LQ Newbie
 
Registered: Nov 2015
Posts: 1

Rep: Reputation: Disabled
Question about IPv4 packet checking in br_nf_pre_routing() function


Hello everyone,
I am working on Linux bridge netfilter. And to meet a special request, I would need to remove the pskb_trim_rcsum() in bridge netfilter processing for IPv4 packet.
Will be there any side effect if I removed this IPv4 check method pskb_trim_rcsum() used in br_nf_pre_routing() function?

Thanks.

The kernel code is as following:
...
if (!pskb_may_pull(skb, sizeof(struct iphdr)))
goto inhdr_error;

iph = ip_hdr(skb);
if (iph->ihl < 5 || iph->version != 4)
goto inhdr_error;

if (!pskb_may_pull(skb, 4 * iph->ihl))
goto inhdr_error;

iph = ip_hdr(skb);
if (ip_fast_csum((__u8 *) iph, iph->ihl) != 0)
goto inhdr_error;

len = ntohs(iph->tot_len);
if (skb->len < len || len < 4 * iph->ihl)
goto inhdr_error;

pskb_trim_rcsum(skb, len);
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
receive a ipv4 packet and send it back to the source kikilinux Programming 2 07-07-2014 05:45 AM
Disabling IPv4 packet forwarding: net.ipv4.ip_forward = 0 (CentOS 5.5) troiwulful Red Hat 3 11-22-2010 11:04 AM
packet filtering function sunhui Linux - Networking 1 11-24-2006 05:10 AM
how to program IP checking of packet for its delivery cranium2004 Programming 0 05-08-2005 01:46 AM
stop forwarding packet after checking the message sent from PC 1 to PC 3 through PC@ becky_starr Programming 3 02-14-2004 11:02 PM

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

All times are GMT -5. The time now is 08:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration