On  3 Feb 03 at 20:31, [EMAIL PROTECTED] wrote:

> Hi
> 
> Newbie alert!
> 
> I've been trying to get fastroute to work on NetBSD 1.6 but although 
> ipfstat shows fastroute success there appeared to be nothing reaching 
> the destination. After failing to find any syntax that worked I 
> checked with netstat at destination and could then see traceroute 
> packets had arrived ok but been dropped. On NetBSD, tcpdump showed 
> these to have 'udp checksum error', or with Win98 pc as destination, 
> netstat lists 'Received Header Errors'. 
> 
> With pass all rules there's no problems and the same box has been in 
> use with ipf as firewall for ppp dialup since late December.
> 
> I now believe solution to problem I was trying to solve by use of 
> fastroute lies elsewhere so this excercise is more out of interest 
> than neccessity.
> 
> IP Filter: v3.4.27
> 
> NetBSD 1.6: custom kernel as only 8 MB ram so I could have left out 
> something that's not obviously required from a diff vs GENERIC but 
> same results with GENERIC_TINY.
> 
> 486dlc33 with 2 x DE-220PCT ISA NE2000
> 
> ip-forwarding is on
> 
> ruleset tried:
>  pass  in  quick on lo0 all
>  pass  out quick on lo0 all
>  block in  quick on ne0 fastroute proto udp from 192.168.1.1 to \
>  192.168.2.1 
>  pass  in  quick on ne0 all
>  block in  quick on ne1 fastroute proto udp from 192.168.2.1 to \ 
>  192.168.1.1
>  pass in quick on ne1 all
>  pass out quick on ne0 all
>  pass out quick on ne1 all
> 
> also as above with:
>     /32 appended to the dotted quads
>     'ne0 fastroute' replaced by 'ne0 to ne1' 
>     'ne0 fastroute' replaced by 'ne0 to ne1:192.168.2.1' 
 
Hi again

Looking back through the mailing list there were patches 
mentioned for earlier versions of ipfilter. Although the 
code appeared to have changed it appeared to me that the 
patches might still be valid and indeed a traceroute now
doesn't show the presence of the router which otherwise
still appears to be functional. Possibly someone familiar
with the ipfilter code as well as NetBSD could take this 
up. My tampering as per following code is most likely to 
have broken something. 

David

NetBSD 1.6
Kernel: IP Filter: v3.4.27              

*** /sys/netinet/ip_fil.c   Mon Feb 17 17:28:38 2003
--- /sys/netinet/ip_fil.c.org   Thu May  2 17:13:28 2002
***************
*** 1645,1653 ****
  
    if (ro->ro_rt->rt_flags & RTF_GATEWAY) {
  #if BSD >= 199306
-       dst = (struct sockaddr_in *)&ro->ro_rt->rt_gateway;
- #else
        dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
  #endif
    }
    ro->ro_rt->rt_use++;
--- 1645,1653 ----
  
    if (ro->ro_rt->rt_flags & RTF_GATEWAY) {
  #if BSD >= 199306
        dst = (struct sockaddr_in *)ro->ro_rt->rt_gateway;
+ #else
+       dst = (struct sockaddr_in *)&ro->ro_rt->rt_gateway;
  #endif
    }
    ro->ro_rt->rt_use++;
***************
*** 1670,1676 ****
            (void) fr_checkstate(ip, fin);
        (void) ip_natout(ip, fin);
        fin->fin_ifp = sifp;
-       ip->ip_sum = 0;
    } else
        ip->ip_sum = 0;
    /*
--- 1670,1675 ----
***************
*** 1678,1684 ****
     */
    if (ip->ip_len <= ifp->if_mtu) {
  # ifndef sparc
! #  if !(_BSDI_VERSION >= 199510)
        ip->ip_id = htons(ip->ip_id);
  #  endif
        ip->ip_len = htons(ip->ip_len);
--- 1677,1683 ----
     */
    if (ip->ip_len <= ifp->if_mtu) {
  # ifndef sparc
! #  if (!defined(__FreeBSD__) && !(_BSDI_VERSION >= 199510))
        ip->ip_id = htons(ip->ip_id);
  #  endif
        ip->ip_len = htons(ip->ip_len);
***************
*** 1703,1712 ****
  # if  (BSD >= 199306) || (defined(IRIX) && (IRIX >= 605))
        error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst,
                      ro->ro_rt);
- # if !(_BSDI_VERSION >= 199510)
-           ip->ip_id = ntohs(ip->ip_id);
-           ip->ip_len = ntohs(ip->ip_len);
-           ip->ip_off = ntohs(ip->ip_off);
  # else
        error = (*ifp->if_output)(ifp, m, (struct sockaddr *)dst);
  # endif
--- 1702,1707 ----
***************
*** 1799,1805 ****
  # if (BSD >= 199306) || (defined(IRIX) && (IRIX >= 605))
            error = (*ifp->if_output)(ifp, m,
                (struct sockaddr *)dst, ro->ro_rt);
- # endif
  # else
            error = (*ifp->if_output)(ifp, m,
                (struct sockaddr *)dst);
--- 1794,1799 ----

Taken from posts:
2001-11-06 5:40:26, Song Bo Run,
"Re: some patches (fwd)"

2001-11-06 13:48:49, jonas.bulow,
"Fix for fastroute problem. PATCHES for BSD/OS."

Reply via email to