Path: blob/main/website/static/security/patches/EN-06:02/net.patch
18096 views
Index: sys/netinet/ip_output.c1===================================================================2RCS file: /home/cvs/src/sys/netinet/ip_output.c,v3retrieving revision 1.242.2.84diff -u -r1.242.2.8 ip_output.c5--- sys/netinet/ip_output.c 31 Jan 2006 16:06:05 -0000 1.242.2.86+++ sys/netinet/ip_output.c 25 Aug 2006 15:07:44 -00007@@ -1162,6 +1162,9 @@8return (EINVAL);9}1011+ if (inp == NULL)12+ return (EINVAL);13+14switch (sopt->sopt_dir) {15case SOPT_SET:16switch (sopt->sopt_name) {17Index: sys/netinet6/in6.c18===================================================================19RCS file: /home/cvs/src/sys/netinet6/in6.c,v20retrieving revision 1.51.2.821diff -u -r1.51.2.8 in6.c22--- sys/netinet6/in6.c 9 Mar 2006 11:59:03 -0000 1.51.2.823+++ sys/netinet6/in6.c 25 Aug 2006 15:07:56 -000024@@ -1720,20 +1720,55 @@2526/* we could do in(6)_socktrim here, but just omit it at this moment. */2728+ if (newhost && nd6_need_cache(ifp) != 0) {29+ /* set the rtrequest function to create llinfo */30+ ia->ia_ifa.ifa_rtrequest = nd6_rtrequest;31+ }32+33/*34* Special case:35* If a new destination address is specified for a point-to-point36* interface, install a route to the destination as an interface37- * direct route.38+ * direct route. In addition, if the link is expected to have neighbor39+ * cache entries, specify RTF_LLINFO so that a cache entry for the40+ * destination address will be created.41+ * created42* XXX: the logic below rejects assigning multiple addresses on a p2p43- * interface that share a same destination.44+ * interface that share the same destination.45*/46plen = in6_mask2len(&ia->ia_prefixmask.sin6_addr, NULL); /* XXX */47if (!(ia->ia_flags & IFA_ROUTE) && plen == 128 &&48ia->ia_dstaddr.sin6_family == AF_INET6) {49- if ((error = rtinit(&(ia->ia_ifa), (int)RTM_ADD,50- RTF_UP | RTF_HOST)) != 0)51+ int rtflags = RTF_UP | RTF_HOST;52+ struct rtentry *rt = NULL, **rtp = NULL;53+54+ if (nd6_need_cache(ifp) != 0) {55+ rtflags |= RTF_LLINFO;56+ rtp = &rt;57+ }58+59+ error = rtrequest(RTM_ADD, (struct sockaddr *)&ia->ia_dstaddr,60+ (struct sockaddr *)&ia->ia_addr,61+ (struct sockaddr *)&ia->ia_prefixmask,62+ ia->ia_flags | rtflags, rtp);63+ if (error != 0)64return (error);65+ if (rt != NULL) {66+ struct llinfo_nd6 *ln;67+68+ RT_LOCK(rt);69+ ln = (struct llinfo_nd6 *)rt->rt_llinfo;70+ if (ln != NULL) {71+ /*72+ * Set the state to STALE because we don't73+ * have to perform address resolution on this74+ * link.75+ */76+ ln->ln_state = ND6_LLINFO_STALE;77+ }78+ RT_REMREF(rt);79+ RT_UNLOCK(rt);80+ }81ia->ia_flags |= IFA_ROUTE;82}83if (plen < 128) {84@@ -1744,11 +1779,8 @@85}8687/* Add ownaddr as loopback rtentry, if necessary (ex. on p2p link). */88- if (newhost) {89- /* set the rtrequest function to create llinfo */90- ia->ia_ifa.ifa_rtrequest = nd6_rtrequest;91+ if (newhost)92in6_ifaddloop(&(ia->ia_ifa));93- }9495return (error);96}97Index: sys/netinet6/nd6.c98===================================================================99RCS file: /home/cvs/src/sys/netinet6/nd6.c,v100retrieving revision 1.48.2.12101diff -u -r1.48.2.12 nd6.c102--- sys/netinet6/nd6.c 29 Mar 2006 21:05:11 -0000 1.48.2.12103+++ sys/netinet6/nd6.c 25 Aug 2006 15:08:02 -0000104@@ -512,6 +512,19 @@105ln->ln_asked++;106nd6_llinfo_settimer(ln, (long)ndi->retrans * hz / 1000);107nd6_ns_output(ifp, dst, dst, ln, 0);108+ } else if (rt->rt_ifa != NULL &&109+ rt->rt_ifa->ifa_addr->sa_family == AF_INET6 &&110+ (((struct in6_ifaddr *)rt->rt_ifa)->ia_flags & IFA_ROUTE)) {111+ /*112+ * This is an unreachable neighbor whose address is113+ * specified as the destination of a p2p interface114+ * (see in6_ifinit()). We should not free the entry115+ * since this is sort of a "static" entry generated116+ * via interface address configuration.117+ */118+ ln->ln_asked = 0;119+ ln->ln_expire = 0; /* make it permanent */120+ ln->ln_state = ND6_LLINFO_STALE;121} else {122(void)nd6_free(rt, 0);123ln = NULL;124Index: sys/vm/uma_core.c125===================================================================126RCS file: /home/cvs/src/sys/vm/uma_core.c,v127retrieving revision 1.119.2.15128diff -u -r1.119.2.15 uma_core.c129--- sys/vm/uma_core.c 14 Feb 2006 03:37:58 -0000 1.119.2.15130+++ sys/vm/uma_core.c 25 Aug 2006 15:08:12 -0000131@@ -2417,8 +2417,7 @@132* If nothing else caught this, we'll just do an internal free.133*/134zfree_internal:135- uma_zfree_internal(zone, item, udata, SKIP_DTOR, ZFREE_STATFAIL |136- ZFREE_STATFREE);137+ uma_zfree_internal(zone, item, udata, SKIP_DTOR, ZFREE_STATFREE);138139return;140}141142143