Date: Mon, 1 Mar 2004 15:56:47 -0800 (PST) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 47943 for review Message-ID: <200403012356.i21NulmC008874@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=47943 Change 47943 by rwatson@rwatson_tislabs on 2004/03/01 15:56:01 Integrate the netperf_socket branch to bring in the changes to the NET_DROP/PICKUP_GIANT() API. Affected files ... .. //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#3 integrate .. //depot/projects/netperf_socket/sys/boot/forth/loader.conf#3 integrate .. //depot/projects/netperf_socket/sys/conf/NOTES#5 integrate .. //depot/projects/netperf_socket/sys/conf/files#5 integrate .. //depot/projects/netperf_socket/sys/dev/acpica/acpi_video.c#1 branch .. //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/ata-disk.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/atapi-cd.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/atapi-fd.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/ata/atapi-tape.c#3 integrate .. //depot/projects/netperf_socket/sys/dev/mlx/mlx.c#3 integrate .. //depot/projects/netperf_socket/sys/geom/concat/g_concat.c#2 integrate .. //depot/projects/netperf_socket/sys/geom/concat/g_concat.h#2 integrate .. //depot/projects/netperf_socket/sys/i386/conf/NOTES#3 integrate .. //depot/projects/netperf_socket/sys/kern/kern_thread.c#3 integrate .. //depot/projects/netperf_socket/sys/modules/acpi/Makefile#2 integrate .. //depot/projects/netperf_socket/sys/modules/acpi/acpi_video/Makefile#1 branch .. //depot/projects/netperf_socket/sys/modules/netgraph/Makefile#3 integrate .. //depot/projects/netperf_socket/sys/modules/netgraph/vlan/Makefile#1 branch .. //depot/projects/netperf_socket/sys/netgraph/ng_vlan.c#1 branch .. //depot/projects/netperf_socket/sys/netgraph/ng_vlan.h#1 branch .. //depot/projects/netperf_socket/sys/netinet/ip_input.c#7 integrate .. //depot/projects/netperf_socket/sys/netinet/tcp_input.c#4 integrate .. //depot/projects/netperf_socket/sys/netinet6/ip6_input.c#3 integrate .. //depot/projects/netperf_socket/sys/sys/eventhandler.h#2 integrate .. //depot/projects/netperf_socket/sys/sys/mutex.h#3 integrate Differences ... ==== //depot/projects/netperf_socket/sys/alpha/alpha/machdep.c#3 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.217 2004/02/27 19:30:46 kensmith Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.218 2004/03/01 19:19:15 kensmith Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -585,22 +585,6 @@ } snprintf(cpu_model, sizeof(cpu_model), "%s", platform.model); - /* - * Initalize the real console, so the the bootstrap console is - * no longer necessary. - */ -#ifndef NO_SIO - if (platform.cons_init) { - platform.cons_init(); - promcndetach(); - } -#else - if (platform.cons_init) - platform.cons_init(); - promcndetach(); - cninit(); -#endif - /* NO MORE FIRMWARE ACCESS ALLOWED */ #ifdef _PMAP_MAY_USE_PROM_CONSOLE /* @@ -892,6 +876,24 @@ } /* + * Initalize the real console, so the the bootstrap console is + * no longer necessary. Note this now involves mutexes as part + * of some operations so needs to be after proc0/thread0/curthread + * become valid. + */ +#ifndef NO_SIO + if (platform.cons_init) { + platform.cons_init(); + promcndetach(); + } +#else + if (platform.cons_init) + platform.cons_init(); + promcndetach(); + cninit(); +#endif + + /* * Check to see if promcons needs to make_dev() now, * doing it before now crashes with kernel stack issues. */ ==== //depot/projects/netperf_socket/sys/boot/forth/loader.conf#3 (text+ko) ==== @@ -6,7 +6,7 @@ # # All arguments must be in double quotes. # -# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.74 2004/02/26 03:53:52 mlaier Exp $ +# $FreeBSD: src/sys/boot/forth/loader.conf,v 1.76 2004/03/01 18:42:16 des Exp $ ############################################################## ### Basic configuration options ############################ @@ -116,6 +116,7 @@ cd9660_load="NO" # ISO 9660 filesystem coda_load="NO" # CODA filesystem fdescfs_load="NO" # Filedescriptors filesystem +linprocfs_load="NO" # Linux compatibility process filesystem msdosfs_load="NO" # FAT-12/16/32 nfs_load="NO" # NFS ntfs_load="NO" # NTFS @@ -320,6 +321,7 @@ acpi_dsdt_type="acpi_dsdt" # Don't change this acpi_dsdt_name="/boot/acpi_dsdt.aml" # Override DSDT in BIOS by this file +acpi_video_load="NO" # Load the ACPI video extension driver ############################################################## ### TrustedBSD MAC settings ################################## ==== //depot/projects/netperf_socket/sys/conf/NOTES#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/NOTES,v 1.1202 2004/03/01 02:34:48 ticso Exp $ +# $FreeBSD: src/sys/conf/NOTES,v 1.1203 2004/03/01 07:51:51 bde Exp $ # # NOTES -- Lines that can be cut/pasted into kernel and hints configs. # @@ -2135,6 +2135,8 @@ # # USB Double Bulk Pipe devices device udbp +# USB Fm Radio +device ufm # Generic USB device driver device ugen # Human Interface Device (anything with buttons and dials) @@ -2155,23 +2157,21 @@ device urio # USB scanners device uscanner +# # USB serial support device ucom +# USB support for Belkin F5U103 and compatible serial adapters +device ubsa +# USB support for BWCT console serial adapters +device ubser # USB support for serial adapters based on the FT8U100AX and FT8U232AM device uftdi # USB support for Prolific PL-2303 serial adapters device uplcom -# USB support for Belkin F5U103 and compatible serial adapters -device ubsa +# USB Visor and Palm devices +device uvisor # USB serial support for DDI pocket's PHS device uvscom -# USB Visor and Palm devices -device uvisor -# USB support for BWCT console serial adapters -device ubser - -# USB Fm Radio -device ufm # # ADMtek USB ethernet. Supports the LinkSys USB100TX, # the Billionton USB100, the Melco LU-ATX, the D-Link DSB-650TX ==== //depot/projects/netperf_socket/sys/conf/files#5 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/conf/files,v 1.870 2004/03/01 02:34:48 ticso Exp $ +# $FreeBSD: src/sys/conf/files,v 1.871 2004/03/01 08:12:55 njl Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -276,6 +276,7 @@ dev/acpica/Osd/OsdStream.c optional acpi dev/acpica/Osd/OsdSynch.c optional acpi dev/acpica/Osd/OsdTable.c optional acpi +dev/acpica/acpi_video.c optional acpi_video acpi dev/adlink/adlink.c optional adlink dev/advansys/adv_eisa.c optional adv eisa dev/advansys/adv_pci.c optional adv pci ==== //depot/projects/netperf_socket/sys/dev/ata/ata-all.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.204 2004/02/21 21:10:41 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-all.c,v 1.205 2004/03/01 13:17:07 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -123,9 +123,6 @@ ch->device[SLAVE].mode = ATA_PIO; ch->dev = dev; ch->state = ATA_IDLE; - bzero(&ch->queue_mtx, sizeof(struct mtx)); - mtx_init(&ch->queue_mtx, "ATA queue lock", MTX_DEF, 0); - TAILQ_INIT(&ch->ata_queue); /* initialise device(s) on this channel */ ch->locking(ch, ATA_LF_LOCK); @@ -159,6 +156,11 @@ if (ch->dma) ch->dma->alloc(ch); + /* initialize queue and associated lock */ + bzero(&ch->queue_mtx, sizeof(struct mtx)); + mtx_init(&ch->queue_mtx, "ATA queue lock", MTX_DEF, 0); + TAILQ_INIT(&ch->ata_queue); + /* do not attach devices if we are in early boot */ if (ata_delayed_attach) return 0; @@ -220,6 +222,7 @@ bus_teardown_intr(dev, ch->r_irq, ch->ih); bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq); ch->r_irq = NULL; + mtx_destroy(&ch->queue_mtx); return 0; } ==== //depot/projects/netperf_socket/sys/dev/ata/ata-disk.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.170 2004/02/18 21:36:51 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/ata-disk.c,v 1.171 2004/03/01 13:17:07 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -169,6 +169,7 @@ mtx_lock(&adp->queue_mtx); bioq_flush(&adp->queue, NULL, ENXIO); mtx_unlock(&adp->queue_mtx); + mtx_destroy(&adp->queue_mtx); disk_destroy(adp->disk); ata_prtdev(atadev, "WARNING - removed from configuration\n"); ata_free_name(atadev); ==== //depot/projects/netperf_socket/sys/dev/ata/atapi-cd.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.163 2004/02/21 18:30:03 sos Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-cd.c,v 1.164 2004/03/01 13:17:07 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -204,6 +204,7 @@ mtx_lock(&cdp->queue_mtx); bioq_flush(&cdp->queue, NULL, ENXIO); mtx_unlock(&cdp->queue_mtx); + mtx_destroy(&cdp->queue_mtx); ata_prtdev(atadev, "WARNING - removed from configuration\n"); ata_free_name(atadev); ata_free_lun(&acd_lun_map, cdp->lun); ==== //depot/projects/netperf_socket/sys/dev/ata/atapi-fd.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.94 2004/02/18 21:36:51 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-fd.c,v 1.95 2004/03/01 13:17:07 sos Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -124,6 +124,7 @@ mtx_lock(&fdp->queue_mtx); bioq_flush(&fdp->queue, NULL, ENXIO); mtx_unlock(&fdp->queue_mtx); + mtx_destroy(&fdp->queue_mtx); disk_destroy(fdp->disk); ata_prtdev(atadev, "WARNING - removed from configuration\n"); ata_free_name(atadev); ==== //depot/projects/netperf_socket/sys/dev/ata/atapi-tape.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.89 2004/02/21 21:10:41 phk Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/ata/atapi-tape.c,v 1.90 2004/03/01 13:17:07 sos Exp $"); #include "opt_ata.h" #include <sys/param.h> @@ -169,6 +169,7 @@ mtx_lock(&stp->queue_mtx); bioq_flush(&stp->queue, NULL, ENXIO); mtx_unlock(&stp->queue_mtx); + mtx_destroy(&stp->queue_mtx); destroy_dev(stp->dev1); destroy_dev(stp->dev2); devstat_remove_entry(stp->stats); ==== //depot/projects/netperf_socket/sys/dev/mlx/mlx.c#3 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/dev/mlx/mlx.c,v 1.44 2004/02/22 09:52:46 cperciva Exp $ + * $FreeBSD: src/sys/dev/mlx/mlx.c,v 1.46 2004/03/01 21:45:49 scottl Exp $ */ /* @@ -1554,9 +1554,9 @@ if ((mc->mc_complete == NULL) && (mc != NULL)) mlx_releasecmd(mc); /* we got an error, and we allocated a result */ - if ((error != 0) && (mc->mc_data != NULL)) { - free(mc->mc_data, M_DEVBUF); - mc->mc_data = NULL; + if ((error != 0) && (result != NULL)) { + free(result, M_DEVBUF); + result = NULL; } return(result); } ==== //depot/projects/netperf_socket/sys/geom/concat/g_concat.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/concat/g_concat.c,v 1.2 2004/02/27 15:34:21 pjd Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/concat/g_concat.c,v 1.3 2004/03/01 17:32:48 pjd Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -286,7 +286,6 @@ disk->d_consumer->provider->mediasize; if (sc->sc_type == G_CONCAT_TYPE_AUTOMATIC) disk->d_end -= disk->d_consumer->provider->sectorsize; - disk->d_length = disk->d_end - disk->d_start; start = disk->d_end; } /* We have sc->sc_disks[sc->sc_ndisks - 1].d_end in 'start'. */ @@ -383,7 +382,6 @@ disk->d_softc = sc; disk->d_start = 0; /* not yet */ disk->d_end = 0; /* not yet */ - disk->d_length = 0; /* not yet */ disk->d_valid = 1; G_CONCAT_DEBUG(0, "Disk %s attached to %s.", pp->name, gp->name); ==== //depot/projects/netperf_socket/sys/geom/concat/g_concat.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/geom/concat/g_concat.h,v 1.2 2004/02/27 15:32:49 pjd Exp $ + * $FreeBSD: src/sys/geom/concat/g_concat.h,v 1.3 2004/03/01 17:33:11 pjd Exp $ */ #ifndef _G_CONCAT_H_ @@ -63,9 +63,7 @@ struct g_concat_softc *d_softc; off_t d_start; off_t d_end; - off_t d_length; boolean_t d_valid; - LIST_ENTRY(g_concat_path) d_next; }; struct g_concat_softc { ==== //depot/projects/netperf_socket/sys/i386/conf/NOTES#3 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1125 2004/02/24 04:18:07 bde Exp $ +# $FreeBSD: src/sys/i386/conf/NOTES,v 1.1126 2004/03/01 08:12:55 njl Exp $ # # @@ -445,7 +445,7 @@ # Note that building ACPI into the kernel is deprecated; the module is # normally loaded automatically by the loader. # -device acpi +device acpi options ACPI_DEBUG options ACPI_MAX_THREADS=1 #!options ACPI_NO_SEMAPHORES @@ -453,7 +453,11 @@ # ACPI Toshiba Extras (LCD backlight/brightness, video output, etc.) # -device acpi_toshiba +device acpi_toshiba + +# ACPI Video Extensions (LCD backlight/brightness, video output, etc.) +# +device acpi_video # DRM options: # mgadrm: AGP Matrox G200, G400, G450, G550 ==== //depot/projects/netperf_socket/sys/kern/kern_thread.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.171 2004/02/27 18:52:43 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.172 2004/03/01 23:07:58 jhb Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -643,7 +643,7 @@ if (ku) { if ((td2 = ku->ku_owner) == NULL) { panic("%s: no owner", __func__); - } else if (TD_ON_SLEEPQ(td2) && + } else if (TD_ON_SLEEPQ(td2) && (td2->td_flags & TDF_SINTR) && ((td2->td_wchan == &kg->kg_completed) || (td2->td_wchan == &p->p_siglist && (ku->ku_mflags & KMF_WAITSIGEVENT)))) { ==== //depot/projects/netperf_socket/sys/modules/acpi/Makefile#2 (text+ko) ==== @@ -1,5 +1,5 @@ -# $FreeBSD: src/sys/modules/acpi/Makefile,v 1.37 2004/01/12 19:30:57 njl Exp $ +# $FreeBSD: src/sys/modules/acpi/Makefile,v 1.38 2004/03/01 08:15:26 njl Exp $ -SUBDIR= acpi acpi_toshiba +SUBDIR= acpi acpi_toshiba acpi_video .include <bsd.subdir.mk> ==== //depot/projects/netperf_socket/sys/modules/netgraph/Makefile#3 (text+ko) ==== @@ -1,5 +1,5 @@ # $Whistle: Makefile,v 1.5 1999/01/24 06:48:37 archie Exp $ -# $FreeBSD: src/sys/modules/netgraph/Makefile,v 1.31 2004/01/28 00:42:51 emax Exp $ +# $FreeBSD: src/sys/modules/netgraph/Makefile,v 1.32 2004/03/01 17:22:15 ru Exp $ SUBDIR= UI \ async \ @@ -35,7 +35,8 @@ sync_sr \ tee \ tty \ - vjc + vjc \ + vlan .if !defined(NOCRYPT) && exists(${.CURDIR}/../../crypto/rc4/rc4.c) _mppc= mppc ==== //depot/projects/netperf_socket/sys/netinet/ip_input.c#7 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/netinet/ip_input.c,v 1.265 2004/02/28 19:50:43 rwatson Exp $ + * $FreeBSD: src/sys/netinet/ip_input.c,v 1.266 2004/03/01 22:37:01 rwatson Exp $ */ #include "opt_bootp.h" ==== //depot/projects/netperf_socket/sys/netinet/tcp_input.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.231 2004/02/28 15:12:20 rwatson Exp $ + * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.232 2004/03/01 19:10:31 ume Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -459,6 +459,7 @@ tcpstat.tcps_rcvtotal++; if (isipv6) { +#ifdef INET6 /* IP6_EXTHDR_CHECK() is already done at tcp6_input() */ ip6 = mtod(m, struct ip6_hdr *); tlen = sizeof(*ip6) + ntohs(ip6->ip6_plen) - off0; @@ -480,6 +481,9 @@ /* XXX stat */ goto drop; } +#else + th = NULL; /* XXX: avoid compiler warning */ +#endif } else { /* * Get IP and TCP header together in first mbuf. @@ -546,9 +550,11 @@ tlen -= off; /* tlen is used instead of ti->ti_len */ if (off > sizeof (struct tcphdr)) { if (isipv6) { +#ifdef INET6 IP6_EXTHDR_CHECK(m, off0, off, ); ip6 = mtod(m, struct ip6_hdr *); th = (struct tcphdr *)((caddr_t)ip6 + off0); +#endif } else { if (m->m_len < sizeof(struct ip) + off) { if ((m = m_pullup(m, sizeof (struct ip) + off)) @@ -624,12 +630,14 @@ 1, m->m_pkthdr.rcvif); } } else { - if (isipv6) + if (isipv6) { +#ifdef INET6 inp = in6_pcblookup_hash(&tcbinfo, &ip6->ip6_src, th->th_sport, &ip6->ip6_dst, th->th_dport, 1, m->m_pkthdr.rcvif); - else +#endif + } else inp = in_pcblookup_hash(&tcbinfo, ip->ip_src, th->th_sport, ip->ip_dst, th->th_dport, @@ -667,12 +675,14 @@ #endif if (isipv6) { +#ifdef INET6 strcpy(dbuf, "["); strcpy(sbuf, "["); strcat(dbuf, ip6_sprintf(&ip6->ip6_dst)); strcat(sbuf, ip6_sprintf(&ip6->ip6_src)); strcat(dbuf, "]"); strcat(sbuf, "]"); +#endif } else { strcpy(dbuf, inet_ntoa(ip->ip_dst)); strcpy(sbuf, inet_ntoa(ip->ip_src)); ==== //depot/projects/netperf_socket/sys/netinet6/ip6_input.c#3 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.68 2004/02/13 14:50:01 ume Exp $ */ +/* $FreeBSD: src/sys/netinet6/ip6_input.c,v 1.69 2004/03/01 15:34:29 ume Exp $ */ /* $KAME: ip6_input.c,v 1.259 2002/01/21 04:58:09 jinmei Exp $ */ /* @@ -244,6 +244,8 @@ u_int32_t rtalert = ~0; int nxt, ours = 0; struct ifnet *deliverifp = NULL; + struct sockaddr_in6 sa6; + u_int32_t srczone, dstzone; #ifdef PFIL_HOOKS struct in6_addr odst; #endif @@ -387,9 +389,14 @@ in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; } - if ((IN6_IS_ADDR_LOOPBACK(&ip6->ip6_src) || - IN6_IS_ADDR_LOOPBACK(&ip6->ip6_dst)) && - (m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { + if (IN6_IS_ADDR_MC_INTFACELOCAL(&ip6->ip6_dst) && + !(m->m_flags & M_LOOP)) { + /* + * In this case, the packet should come from the loopback + * interface. However, we cannot just check the if_flags, + * because ip6_mloopback() passes the "actual" interface + * as the outgoing/incoming interface. + */ ip6stat.ip6s_badscope++; in6_ifstat_inc(m->m_pkthdr.rcvif, ifs6_in_addrerr); goto bad; @@ -429,7 +436,12 @@ } #endif - /* drop packets if interface ID portion is already filled */ + /* + * Drop packets if the link ID portion is already filled. + * XXX: this is technically not a good behavior. But, we internally + * use the field to disambiguate link-local addresses, so we cannot + * be generous against those a bit strange addresses. + */ if ((m->m_pkthdr.rcvif->if_flags & IFF_LOOPBACK) == 0) { if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src) && ip6->ip6_src.s6_addr16[1]) { @@ -444,12 +456,42 @@ } } - if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_src)) - ip6->ip6_src.s6_addr16[1] - = htons(m->m_pkthdr.rcvif->if_index); - if (IN6_IS_SCOPE_LINKLOCAL(&ip6->ip6_dst)) - ip6->ip6_dst.s6_addr16[1] - = htons(m->m_pkthdr.rcvif->if_index); + /* + * construct source and destination address structures with + * disambiguating their scope zones (if there is ambiguity). + * XXX: sin6_family and sin6_len will NOT be referred to, but we fill + * in these fields just in case. + */ + if (in6_addr2zoneid(m->m_pkthdr.rcvif, &ip6->ip6_src, &srczone) || + in6_addr2zoneid(m->m_pkthdr.rcvif, &ip6->ip6_dst, &dstzone)) { + /* + * Note that these generic checks cover cases that src or + * dst are the loopback address and the receiving interface + * is not loopback. + */ + ip6stat.ip6s_badscope++; + goto bad; + } + + bzero(&sa6, sizeof(sa6)); + sa6.sin6_family = AF_INET6; + sa6.sin6_len = sizeof(struct sockaddr_in6); + + sa6.sin6_addr = ip6->ip6_src; + sa6.sin6_scope_id = srczone; + if (in6_embedscope(&ip6->ip6_src, &sa6, NULL, NULL)) { + /* XXX: should not happen */ + ip6stat.ip6s_badscope++; + goto bad; + } + + sa6.sin6_addr = ip6->ip6_dst; + sa6.sin6_scope_id = dstzone; + if (in6_embedscope(&ip6->ip6_dst, &sa6, NULL, NULL)) { + /* XXX: should not happen */ + ip6stat.ip6s_badscope++; + goto bad; + } /* * Multicast check ==== //depot/projects/netperf_socket/sys/sys/eventhandler.h#2 (text+ko) ==== @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/sys/eventhandler.h,v 1.29 2003/03/24 21:24:37 jhb Exp $ + * $FreeBSD: src/sys/sys/eventhandler.h,v 1.30 2004/03/01 22:36:58 phk Exp $ */ #ifndef SYS_EVENTHANDLER_H @@ -89,51 +89,6 @@ EHL_UNLOCK((list)); \ } while (0) - -/* - * Fast handler lists require the eventhandler list be present - * at link time. They don't allow addition of entries to - * unknown eventhandler lists, ie. each list must have an - * "owner". - * - * Fast handler lists must be defined once by the owner - * of the eventhandler list, and the declaration must be in - * scope at any point the list is manipulated. - */ -#define EVENTHANDLER_FAST_DECLARE(name, type) \ -extern struct eventhandler_list Xeventhandler_list_ ## name ; \ -struct eventhandler_entry_ ## name { \ - struct eventhandler_entry ee; \ - type eh_func; \ -}; \ -struct __hack - -#define EVENTHANDLER_FAST_DEFINE(name, type) \ -struct eventhandler_list Xeventhandler_list_ ## name = { #name }; \ -struct __hack - -#define EVENTHANDLER_FAST_INVOKE(name, ...) do { \ - struct eventhandler_list *_el = &Xeventhandler_list_ ## name ; \ - \ - if (_el->el_flags & EHL_INITTED) { \ - EHL_LOCK(_el); \ - _EVENTHANDLER_INVOKE(name, _el , ## __VA_ARGS__); \ - } \ -} while (0) - -#define EVENTHANDLER_FAST_REGISTER(name, func, arg, priority) \ - eventhandler_register(&Xeventhandler_list_ ## name, \ - #name, func, arg, priority) - -#define EVENTHANDLER_FAST_DEREGISTER(name, tag) do { \ - struct eventhandler_list *_el = &Xeventhandler_list_ ## name ; \ - \ - KASSERT(_el->el_flags & EHL_INITTED, \ - ("eventhandler_fast_deregister on un-inited list %s", ## name)); \ - EHL_LOCK(_el); \ - eventhandler_deregister(_el, tag); \ -} while (0) - /* * Slow handlers are entirely dynamic; lists are created * when entries are added to them, and thus have no concept of "owner", @@ -196,13 +151,6 @@ EVENTHANDLER_DECLARE(shutdown_post_sync, shutdown_fn); /* after fs sync */ EVENTHANDLER_DECLARE(shutdown_final, shutdown_fn); -/* Idle process event */ -typedef void (*idle_eventhandler_t)(void *, int); - -#define IDLE_PRI_FIRST EVENTHANDLER_PRI_FIRST -#define IDLE_PRI_LAST EVENTHANDLER_PRI_LAST -EVENTHANDLER_FAST_DECLARE(idle_event, idle_eventhandler_t); - /* Low memory event */ typedef void (*vm_lowmem_handler_t)(void *, int); #define LOWMEM_PRI_DEFAULT EVENTHANDLER_PRI_FIRST ==== //depot/projects/netperf_socket/sys/sys/mutex.h#3 (text+ko) ==== @@ -26,7 +26,7 @@ * SUCH DAMAGE. * * from BSDI $Id: mutex.h,v 2.7.2.35 2000/04/27 03:10:26 cp Exp $ - * $FreeBSD: src/sys/sys/mutex.h,v 1.68 2003/11/05 23:42:50 sam Exp $ + * $FreeBSD: src/sys/sys/mutex.h,v 1.69 2004/03/01 22:37:01 rwatson Exp $ */ #ifndef _SYS_MUTEX_H_ @@ -345,7 +345,9 @@ * input path and protocols that require Giant must collect it * on entry. When 0 Giant is grabbed in the network interface * ISR's and in the netisr path and there is no need to grab - * the Giant lock. + * the Giant lock. Note that, unlike GIANT_PICKUP() and + * GIANT_DROP(), these macros directly wrap mutex operations + * without special recursion handling. * * This mechanism is intended as temporary until everything of * importance is properly locked. Note: the semantics for @@ -354,14 +356,18 @@ * without a recursion counter. */ extern int debug_mpsafenet; /* defined in net/netisr.c */ -#define NET_PICKUP_GIANT() do { \ +#define NET_LOCK_GIANT() do { \ if (debug_mpsafenet) \ mtx_lock(&Giant); \ } while (0) -#define NET_DROP_GIANT() do { \ +#define NET_UNLOCK_GIANT() do { \ if (debug_mpsafenet) \ mtx_unlock(&Giant); \ } while (0) +#define NET_ASSERT_GIANT() do { \ + if (debug_mpsafenet) \ + mtx_assert(&Giant, MA_OWNED); \ +} while (0) #define UGAR(rval) do { \ int _val = (rval); \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200403012356.i21NulmC008874>