LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Question about IPv4 packet checking in br_nf_pre_routing() function (https://www.linuxquestions.org/questions/linux-newbie-8/question-about-ipv4-packet-checking-in-br_nf_pre_routing-function-4175560281/)

alancc_wu 12-01-2015 01:32 AM

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);


All times are GMT -5. The time now is 11:33 AM.