[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.87.2.5 and 1.87.2.6

version 1.87.2.5, 2007/08/20 21:27:55 version 1.87.2.6, 2007/10/09 13:44:43
Line 258  rtflushall(int family)
Line 258  rtflushall(int family)
 void  void
 rtflush(struct route *ro)  rtflush(struct route *ro)
 {  {
           int s = splnet();
         KASSERT(ro->ro_rt != NULL);          KASSERT(ro->ro_rt != NULL);
         KASSERT(rtcache_getdst(ro) != NULL);          KASSERT(rtcache_getdst(ro) != NULL);
   
Line 265  rtflush(struct route *ro)
Line 266  rtflush(struct route *ro)
         ro->ro_rt = NULL;          ro->ro_rt = NULL;
   
         LIST_REMOVE(ro, ro_rtcache_next);          LIST_REMOVE(ro, ro_rtcache_next);
           splx(s);
   
 #if 0  #if 0
         if (rtcache_debug()) {          if (rtcache_debug()) {
Line 277  rtflush(struct route *ro)
Line 279  rtflush(struct route *ro)
 void  void
 rtcache(struct route *ro)  rtcache(struct route *ro)
 {  {
           int s;
         struct domain *dom;          struct domain *dom;
   
         KASSERT(ro->ro_rt != NULL);          KASSERT(ro->ro_rt != NULL);
Line 285  rtcache(struct route *ro)
Line 288  rtcache(struct route *ro)
         if ((dom = pffinddomain(rtcache_getdst(ro)->sa_family)) == NULL)          if ((dom = pffinddomain(rtcache_getdst(ro)->sa_family)) == NULL)
                 return;                  return;
   
           s = splnet();
         LIST_INSERT_HEAD(&dom->dom_rtcache, ro, ro_rtcache_next);          LIST_INSERT_HEAD(&dom->dom_rtcache, ro, ro_rtcache_next);
           splx(s);
 }  }
   
 /*  /*
Line 756  rtrequest1(int req, struct rt_addrinfo *
Line 761  rtrequest1(int req, struct rt_addrinfo *
                 LIST_INIT(&rt->rt_timer);                  LIST_INIT(&rt->rt_timer);
                 RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__, __LINE__,                  RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__, __LINE__,
                     (void *)rt->_rt_key);                      (void *)rt->_rt_key);
                 if (rt_setkey(rt, dst, PR_NOWAIT) == NULL ||                  if (rt_setkey(rt, dst, M_NOWAIT) == NULL ||
                     rt_setgate(rt, gateway) != 0) {                      rt_setgate(rt, gateway) != 0) {
                         pool_put(&rtentry_pool, rt);                          pool_put(&rtentry_pool, rt);
                         senderr(ENOBUFS);                          senderr(ENOBUFS);
Line 766  rtrequest1(int req, struct rt_addrinfo *
Line 771  rtrequest1(int req, struct rt_addrinfo *
                 if (netmask) {                  if (netmask) {
                         rt_maskedcopy(dst, (struct sockaddr *)&maskeddst,                          rt_maskedcopy(dst, (struct sockaddr *)&maskeddst,
                             netmask);                              netmask);
                         rt_setkey(rt, (struct sockaddr *)&maskeddst, PR_NOWAIT);                          rt_setkey(rt, (struct sockaddr *)&maskeddst, M_NOWAIT);
                         RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,                          RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,
                             __LINE__, (void *)rt->_rt_key);                              __LINE__, (void *)rt->_rt_key);
                 } else {                  } else {
                         rt_setkey(rt, dst, PR_NOWAIT);                          rt_setkey(rt, dst, M_NOWAIT);
                         RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,                          RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,
                             __LINE__, (void *)rt->_rt_key);                              __LINE__, (void *)rt->_rt_key);
                 }                  }
Line 870  rt_setgate(struct rtentry *rt, const str
Line 875  rt_setgate(struct rtentry *rt, const str
         KASSERT(rt->_rt_key != NULL);          KASSERT(rt->_rt_key != NULL);
         RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,          RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,
             __LINE__, (void *)rt->_rt_key);              __LINE__, (void *)rt->_rt_key);
         if ((rt->rt_gateway = sockaddr_dup(gate, PR_NOWAIT)) == NULL)          if ((rt->rt_gateway = sockaddr_dup(gate, M_NOWAIT)) == NULL)
                 return ENOMEM;                  return ENOMEM;
         KASSERT(rt->_rt_key != NULL);          KASSERT(rt->_rt_key != NULL);
         RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,          RT_DPRINTF("%s l.%d: rt->_rt_key = %p\n", __func__,
Line 1370  rtcache_setdst(struct route *ro, const s
Line 1375  rtcache_setdst(struct route *ro, const s
   
         if (ro->ro_sa != NULL && ro->ro_sa->sa_family == sa->sa_family) {          if (ro->ro_sa != NULL && ro->ro_sa->sa_family == sa->sa_family) {
                 rtcache_clear(ro);                  rtcache_clear(ro);
                 sockaddr_copy(ro->ro_sa, sa);                  if (sockaddr_copy(ro->ro_sa, ro->ro_sa->sa_len, sa) != NULL)
                 return 0;                          return 0;
                   sockaddr_free(ro->ro_sa);
         } else if (ro->ro_sa != NULL)          } else if (ro->ro_sa != NULL)
                 rtcache_free(ro);       /* free ro_sa, wrong family */                  rtcache_free(ro);       /* free ro_sa, wrong family */
   
         if ((ro->ro_sa = sockaddr_dup(sa, PR_NOWAIT)) == NULL)          if ((ro->ro_sa = sockaddr_dup(sa, M_NOWAIT)) == NULL)
                 return ENOMEM;                  return ENOMEM;
         return 0;          return 0;
 }  }

Legend:
Removed from v.1.87.2.5  
changed lines
  Added in v.1.87.2.6

CVSweb <webmaster@jp.NetBSD.org>