Re: Problems in 1.3.93

Jason Keimig (jkeimig@tisl.ukans.edu)
Tue, 23 Apr 1996 17:42:41 -0700 (PDT)


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)