[BACK]Return to route.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / net

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/net/route.c between version 1.43 and 1.43.4.1

version 1.43, 2001/02/21 05:45:11 version 1.43.4.1, 2001/08/03 04:13:53
Line 203  rtalloc1(dst, report)
Line 203  rtalloc1(dst, report)
                                 goto miss;                                  goto miss;
                         }                          }
                         /* Inform listeners of the new route */                          /* Inform listeners of the new route */
                         bzero(&info, sizeof(info));                          memset(&info, 0, sizeof(info));
                         info.rti_info[RTAX_DST] = rt_key(rt);                          info.rti_info[RTAX_DST] = rt_key(rt);
                         info.rti_info[RTAX_NETMASK] = rt_mask(rt);                          info.rti_info[RTAX_NETMASK] = rt_mask(rt);
                         info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;                          info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
Line 218  rtalloc1(dst, report)
Line 218  rtalloc1(dst, report)
         } else {          } else {
                 rtstat.rts_unreach++;                  rtstat.rts_unreach++;
         miss:   if (report) {          miss:   if (report) {
                         bzero((caddr_t)&info, sizeof(info));                          memset((caddr_t)&info, 0, sizeof(info));
                         info.rti_info[RTAX_DST] = dst;                          info.rti_info[RTAX_DST] = dst;
                         rt_missmsg(msgtype, &info, 0, err);                          rt_missmsg(msgtype, &info, 0, err);
                 }                  }
Line 301  rtredirect(dst, gateway, netmask, flags,
Line 301  rtredirect(dst, gateway, netmask, flags,
          * we have a routing loop, perhaps as a result of an interface           * we have a routing loop, perhaps as a result of an interface
          * going down recently.           * going down recently.
          */           */
 #define equal(a1, a2) (bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)  #define equal(a1, a2) \
           ((a1)->sa_len == (a2)->sa_len && \
            bcmp((caddr_t)(a1), (caddr_t)(a2), (a1)->sa_len) == 0)
         if (!(flags & RTF_DONE) && rt &&          if (!(flags & RTF_DONE) && rt &&
              (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))               (!equal(src, rt->rt_gateway) || rt->rt_ifa != ifa))
                 error = EINVAL;                  error = EINVAL;
Line 365  out:
Line 367  out:
                 rtstat.rts_badredirect++;                  rtstat.rts_badredirect++;
         else if (stat != NULL)          else if (stat != NULL)
                 (*stat)++;                  (*stat)++;
         bzero((caddr_t)&info, sizeof(info));          memset((caddr_t)&info, 0, sizeof(info));
         info.rti_info[RTAX_DST] = dst;          info.rti_info[RTAX_DST] = dst;
         info.rti_info[RTAX_GATEWAY] = gateway;          info.rti_info[RTAX_GATEWAY] = gateway;
         info.rti_info[RTAX_NETMASK] = netmask;          info.rti_info[RTAX_NETMASK] = netmask;
Line 388  rtdeletemsg(rt)
Line 390  rtdeletemsg(rt)
          * deleted.  That will allow the information being reported to           * deleted.  That will allow the information being reported to
          * be accurate (and consistent with route_output()).           * be accurate (and consistent with route_output()).
          */           */
         bzero((caddr_t)&info, sizeof(info));          memset((caddr_t)&info, 0, sizeof(info));
         info.rti_info[RTAX_DST] = rt_key(rt);          info.rti_info[RTAX_DST] = rt_key(rt);
         info.rti_info[RTAX_NETMASK] = rt_mask(rt);          info.rti_info[RTAX_NETMASK] = rt_mask(rt);
         info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;          info.rti_info[RTAX_GATEWAY] = rt->rt_gateway;
Line 502  rtrequest(req, dst, gateway, netmask, fl
Line 504  rtrequest(req, dst, gateway, netmask, fl
 {  {
         struct rt_addrinfo info;          struct rt_addrinfo info;
   
         bzero(&info, sizeof(info));          memset(&info, 0, sizeof(info));
         info.rti_flags = flags;          info.rti_flags = flags;
         info.rti_info[RTAX_DST] = dst;          info.rti_info[RTAX_DST] = dst;
         info.rti_info[RTAX_GATEWAY] = gateway;          info.rti_info[RTAX_GATEWAY] = gateway;
Line 646  rtrequest1(req, info, ret_nrt)
Line 648  rtrequest1(req, info, ret_nrt)
                         rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */                          rt->rt_rmx = (*ret_nrt)->rt_rmx; /* copy metrics */
                         rt->rt_parent = *ret_nrt;                          rt->rt_parent = *ret_nrt;
                         rt->rt_parent->rt_refcnt++;                          rt->rt_parent->rt_refcnt++;
                 } else if (rt->rt_rmx.rmx_mtu == 0  
                             && !(rt->rt_rmx.rmx_locks & RTV_MTU)) { /* XXX */  
                         if (rt->rt_gwroute != NULL) {  
                                 rt->rt_rmx.rmx_mtu = rt->rt_gwroute->rt_rmx.rmx_mtu;  
                         } else {  
                                 rt->rt_rmx.rmx_mtu = ifa->ifa_ifp->if_mtu;  
                         }  
                 }                  }
                 rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,                  rn = rnh->rnh_addaddr((caddr_t)ndst, (caddr_t)netmask,
                     rnh, rt->rt_nodes);                      rnh, rt->rt_nodes);
Line 732  rt_setgate(rt0, dst, gate)
Line 727  rt_setgate(rt0, dst, gate)
                 rt->rt_gwroute = rtalloc1(gate, 1);                  rt->rt_gwroute = rtalloc1(gate, 1);
                 /*                  /*
                  * If we switched gateways, grab the MTU from the new                   * If we switched gateways, grab the MTU from the new
                  * gateway route if the current MTU is 0 or greater                   * gateway route if the current MTU, if the current MTU is
                  * than the MTU of gateway.                   * greater than the MTU of gateway.
                    * Note that, if the MTU of gateway is 0, we will reset the
                    * MTU of the route to run PMTUD again from scratch. XXX
                  */                   */
                 if (rt->rt_gwroute                  if (rt->rt_gwroute
                     && !(rt->rt_rmx.rmx_locks & RTV_MTU)                      && !(rt->rt_rmx.rmx_locks & RTV_MTU)
                     && (rt->rt_rmx.rmx_mtu == 0                      && rt->rt_rmx.rmx_mtu
                     || rt->rt_rmx.rmx_mtu > rt->rt_gwroute->rt_rmx.rmx_mtu)) { /* XXX */                      && rt->rt_rmx.rmx_mtu > rt->rt_gwroute->rt_rmx.rmx_mtu) {
                         rt->rt_rmx.rmx_mtu = rt->rt_gwroute->rt_rmx.rmx_mtu;                          rt->rt_rmx.rmx_mtu = rt->rt_gwroute->rt_rmx.rmx_mtu;
                 }                  }
         }          }
Line 762  rt_maskedcopy(src, dst, netmask)
Line 759  rt_maskedcopy(src, dst, netmask)
         while (cp2 < cplim)          while (cp2 < cplim)
                 *cp2++ = *cp1++ & *cp3++;                  *cp2++ = *cp1++ & *cp3++;
         if (cp2 < cplim2)          if (cp2 < cplim2)
                 bzero((caddr_t)cp2, (unsigned)(cplim2 - cp2));                  memset((caddr_t)cp2, 0, (unsigned)(cplim2 - cp2));
 }  }
   
 /*  /*
Line 796  rtinit(ifa, cmd, flags)
Line 793  rtinit(ifa, cmd, flags)
                                                         : ENETUNREACH);                                                          : ENETUNREACH);
                 }                  }
         }          }
         bzero(&info, sizeof(info));          memset(&info, 0, sizeof(info));
         info.rti_ifa = ifa;          info.rti_ifa = ifa;
         info.rti_flags = flags | ifa->ifa_flags;          info.rti_flags = flags | ifa->ifa_flags;
         info.rti_info[RTAX_DST] = dst;          info.rti_info[RTAX_DST] = dst;
Line 826  rtinit(ifa, cmd, flags)
Line 823  rtinit(ifa, cmd, flags)
                         IFAFREE(rt->rt_ifa);                          IFAFREE(rt->rt_ifa);
                         rt->rt_ifa = ifa;                          rt->rt_ifa = ifa;
                         rt->rt_ifp = ifa->ifa_ifp;                          rt->rt_ifp = ifa->ifa_ifp;
                         rt->rt_rmx.rmx_mtu = ifa->ifa_ifp->if_mtu;      /*XXX*/  
                         IFAREF(ifa);                          IFAREF(ifa);
                         if (ifa->ifa_rtrequest)                          if (ifa->ifa_rtrequest)
                                 ifa->ifa_rtrequest(RTM_ADD, rt, NULL);                                  ifa->ifa_rtrequest(RTM_ADD, rt, NULL);

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.43.4.1

CVSweb <webmaster@jp.NetBSD.org>