home *** CD-ROM | disk | FTP | other *** search
/ PC-Online 1998 February / PCOnline_02_1998.iso / linux / kernel-2.1.33.dial_on_demand_patch next >
Text File  |  1998-01-06  |  1KB  |  47 lines

  1. --- linux/net/ipv4/route.c.orig    Sun Apr 13 18:58:49 1997
  2. +++ linux/net/ipv4/route.c    Sun Apr 13 23:43:02 1997
  3. @@ -77,6 +77,9 @@
  4.  #include <linux/skbuff.h>
  5.  #include <net/sock.h>
  6.  #include <net/icmp.h>
  7. +#ifdef CONFIG_KERNELD
  8. +#include <linux/kerneld.h>
  9. +#endif
  10.  #include <linux/net_alias.h>
  11.  
  12.  /* Compile time configuretion flags */
  13. @@ -1315,6 +1318,7 @@
  14.  int ip_route_output(struct rtable **rp, u32 daddr, u32 saddr, u8 tos, struct device *dev_out)
  15.  {
  16.      unsigned hash;
  17. +    int ipsl;
  18.      struct rtable *rth;
  19.  
  20.      hash = rt_hash_code(daddr, dev_out ? saddr^(dev_out->ifindex<<5)
  21. @@ -1337,7 +1341,24 @@
  22.      }
  23.      end_bh_atomic();
  24.  
  25. -    return ip_route_output_slow(rp, daddr, saddr, tos, dev_out);
  26. +    ipsl=ip_route_output_slow(rp, daddr, saddr, tos, dev_out);
  27. +#ifdef CONFIG_KERNELD
  28. +    if ( ipsl == -ENETUNREACH )
  29. +      {
  30. +        char wanted_route[20];
  31. +        union ippp_u
  32. +          {
  33. +        long ipaddr;
  34. +        unsigned char caddr[4];
  35. +          } ippp;
  36. +        ippp.ipaddr = ntohl(daddr);
  37. +        sprintf(wanted_route,"%d.%d.%d.%d",ippp.caddr[3],
  38. +        ippp.caddr[2],ippp.caddr[1],ippp.caddr[0]);
  39. +        kerneld_route(wanted_route);
  40. +        ipsl=ip_route_output_slow(rp, daddr, saddr, tos, dev_out);
  41. +      }
  42. +#endif
  43. +    return ipsl;
  44.  }
  45.  
  46.  int ip_route_output_dev(struct rtable **rp, u32 daddr, u32 saddr, u8 tos, int ifindex)
  47.