lkml.org 
[lkml]   [1996]   [Apr]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Hello,

It appears that the latest kernels have a broken ip_build_xmit for outgoing
RAW_SOCK packets. It seems that a small oversight was made for the IP header
allocations if sk->hdrincl is set. The following patch should fix this..
(this is against a 1.3.91 source tree, but the changes are minimal)



Jason Keimig
============
Comments, suggestions:
jkeimig@tisl.ukans.edu


------------------------------------------------------------------------------
diff -r -N -c3 --exclude-from=diff_exclude linux-1.3.91/net/ipv4/ip_output.c linux/net/ipv4/ip_output.c
*** linux-1.3.91/net/ipv4/ip_output.c Thu Apr 18 06:35:34 1996
--- linux/net/ipv4/ip_output.c Tue Apr 23 16:19:11 1996
***************
*** 634,642 ****
* choice RAW frames within 20 bytes of maximum size(rare) to the long path
*/

! length += sizeof(struct iphdr);
! if (!sk->ip_hdrincl && opt)
! length += opt->optlen;

if(length <= dev->mtu && !MULTICAST(daddr) && daddr!=0xFFFFFFFF && daddr!=dev->pa_brdaddr)
{
--- 634,643 ----
* choice RAW frames within 20 bytes of maximum size(rare) to the long path
*/

! if (!sk->ip_hdrincl) {
! length += sizeof(struct iphdr);
! if(opt) length += opt->optlen;
! }

if(length <= dev->mtu && !MULTICAST(daddr) && daddr!=0xFFFFFFFF && daddr!=dev->pa_brdaddr)
{
***************
*** 700,706 ****
getfrag(frag,saddr,((char *)iph)+iph->ihl*4,0, length-iph->ihl*4);
}
else
! getfrag(frag,saddr,(void *)iph,0,length-20);
dev_unlock_list();
#ifdef CONFIG_FIREWALL
if(call_out_firewall(PF_INET, skb->dev, iph)< FW_ACCEPT)
--- 701,707 ----
getfrag(frag,saddr,((char *)iph)+iph->ihl*4,0, length-iph->ihl*4);
}
else
! getfrag(frag,saddr,(void *)iph,0,length);
dev_unlock_list();
#ifdef CONFIG_FIREWALL
if(call_out_firewall(PF_INET, skb->dev, iph)< FW_ACCEPT)



\
 
 \ /
  Last update: 2005-03-22 13:37    [W:0.034 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site