[email protected]
[Top] [All Lists]

PERFORCE change 115057 for review

Subject: PERFORCE change 115057 for review
From: Michael Bushkov
Date: Mon, 26 Feb 2007 12:10:46 GMT
http://perforce.freebsd.org/chv.cgi?CH=115057

Change 115057 by [email protected]_nss_ldap_cached on 2007/02/26 12:10:36

        IFC

Affected files ...

.. //depot/projects/soc2006/nss_ldap_cached/src/etc/defaults/rc.conf#13 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/devd.conf#3 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/network.subr#6 integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/etc/periodic/security/800.loginfail#3
 integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/etc/periodic/weekly/310.locate#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/dhclient#6 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/hostname#2 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/netif#4 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/include/Makefile#8 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getcap.3#3 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/tls.c#5 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/Makefile.inc#9 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_bindx.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_connectx.3#1 
branch
.. 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_freepaddrs.3#1 
branch
.. 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_getaddrlen.3#1 
branch
.. 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_getassocid.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_getpaddrs.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_opt_info.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_recvmsg.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_send.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_sendmsg.3#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_sys_calls.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/stdlib/malloc.c#9 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/Makefile.inc#3 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/kse.2#4 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/ntp_adjtime.2#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/sctp_generic_recvmsg.2#1
 branch
.. 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/sctp_generic_sendmsg.2#1
 branch
.. //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/sctp_peeloff.2#1 
branch
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/gzip/Makefile#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/gzip/zgrep#2 delete
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/gzip/zgrep.1#2 delete
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/ktrace/ktrace.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/netstat/inet6.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/netstat/mcast.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/netstat/mroute.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/netstat/mroute6.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/netstat/route.c#3 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/quota/quota.1#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/quota/quota.c#4 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.bin/setchannel/setchannel.1#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.bin/setchannel/setchannel.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/tar/tree.c#3 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/tar/write.c#3 integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.bin/tip/tip/value.c#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/bluetooth/sdpd/server.c#3 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/pkg_install/info/show.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/pstat/pstat.c#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/rpc.ypupdated/update.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/setfmac/setfmac.c#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/sysinstall/cdrom.c#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/sysinstall/install.cfg#2 
integrate
.. 
//depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/sysinstall/sysinstall.8#2 
integrate
.. //depot/projects/soc2006/nss_ldap_cached/src/usr.sbin/sysinstall/system.c#2 
integrate

Differences ...

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/defaults/rc.conf#13 
(text+ko) ====

@@ -15,7 +15,7 @@
 # For a more detailed explanation of all the rc.conf variables, please
 # refer to the rc.conf(5) manual page.
 #
-# $FreeBSD: src/etc/defaults/rc.conf,v 1.303 2007/01/20 04:24:19 mpp Exp $
+# $FreeBSD: src/etc/defaults/rc.conf,v 1.304 2007/02/09 12:11:27 flz Exp $
 
 ##############################################################
 ###  Important initial Boot-time options  ####################
@@ -178,11 +178,15 @@
 sppp_interfaces=""             # List of sppp interfaces.
 #sppp_interfaces="isp0"                # example: sppp over ISDN
 #spppconfig_isp0="authproto=chap myauthname=foo myauthsecret='top secret' 
hisauthname=some-gw hisauthsecret='another secret'"
-gif_interfaces="NO"            # List of GIF tunnels (or "NO").
+gif_interfaces=""              # List of GIF tunnels.
 #gif_interfaces="gif0 gif1"    # Examples typically for a router.
                                # Choose correct tunnel addrs.
 #gifconfig_gif0="10.1.1.1 10.1.2.1"    # Examples typically for a router.
 #gifconfig_gif1="10.1.1.2 10.1.2.2"    # Examples typically for a router.
+fec_interfaces=""              # List of Fast EtherChannels.
+#fec_interfaces="fec0 fec1"
+#fecconfig_fec0="fxp0 dc0"     # Examples typically for two NICs
+#fecconfig_fec1="em0 em1 bge0 bge1"    # Examples typically for four NICs
 
 # User ppp configuration.
 ppp_enable="NO"                # Start user-ppp (or NO).

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/devd.conf#3 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/devd.conf,v 1.33 2006/06/01 00:41:07 thompsa Exp $
+# $FreeBSD: src/etc/devd.conf,v 1.35 2007/02/15 16:38:10 imp Exp $
 #
 # Refer to devd.conf(5) and devd(8) man pages for the details on how to
 # run and configure devd.
@@ -155,11 +155,42 @@
 
 # Don't even try to second guess what to do about drivers that don't
 # match here.  Instead, pass it off to syslog.  Commented out for the
-# moment, as pnpinfo isn't set in devd yet.
+# moment, as the pnpinfo variable isn't set in devd yet.  Individual
+# variables within the bus supplied pnpinfo are set.
 nomatch 0 {
 #      action "logger Unknown device: $pnpinfo $location $bus";
 };
 
+# Various logging of unknown devices.
+nomatch 10 {
+       match "bus" "uhub[0-9]+";
+       action "logger Unknown USB device: vendor $vendor product $product \
+               bus $bus";
+};
+
+# Some PC-CARDs don't offer numerical manufacturer/product IDs, just
+# show the CIS info there.
+nomatch 20 {
+       match "bus" "pccard[0-9]+";
+       match "manufacturer" "0xffffffff";
+       match "product" "0xffffffff";
+       action "logger Unknown PCCARD device: CISproduct $cisproduct \
+               CIS-vendor $cisvendor bus $bus";
+};
+
+nomatch 10 {
+       match "bus" "pccard[0-9]+";
+       action "logger Unknown PCCARD device: manufacturer $manufacturer \
+               product $product CISproduct $cisproduct CIS-vendor \
+               $cisvendor bus $bus";
+};
+
+nomatch 10 {
+       match "bus" "cardbus[0-9]+";
+       action "logger Unknown Cardbus device: device $device class $class \
+               vendor $vendor bus $bus";
+};
+
 # Switch power profiles when the AC line state changes.
 notify 10 {
        match "system"          "ACPI";

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/network.subr#6 (text+ko) 
====

@@ -22,7 +22,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/network.subr,v 1.176 2006/10/29 13:29:49 mlaier Exp $
+# $FreeBSD: src/etc/network.subr,v 1.177 2007/02/09 12:11:26 flz Exp $
 #
 
 #
@@ -455,26 +455,89 @@
        debug "Destroyed clones: ${_list}"
 }
 
+# Create netgraph nodes.
+#
+ng_mkpeer() {
+       ngctl -f - 2> /dev/null <<EOF
+mkpeer $*
+msg dummy nodeinfo
+EOF
+}
+
+ng_create_one() {
+       ng_mkpeer $* | while read line; do
+               t=`expr "${line}" : '.* name="\([a-z]*[0-9]*\)" .*'`
+               if [ -n "${t}" ]; then
+                       echo ${t}
+                       return
+               fi
+       done
+}
+
 gif_up() {
+       # The following must be removed once RELENG_7 is branched.
        case ${gif_interfaces} in
-       [Nn][Oo] | '')
+       [Nn][Oo])
+               warn "gif_interfaces=\"NO\" is deprecated, use 
gif_interfaces=\"\" instead."
+               gif_interfaces=""
                ;;
-       *)
-               for i in ${gif_interfaces}; do
-                       peers=`get_if_var $i gifconfig_IF`
-                       case ${peers} in
+       esac
+
+       for i in ${gif_interfaces}; do
+               peers=`get_if_var $i gifconfig_IF`
+               case ${peers} in
+               '')
+                       continue
+                       ;;
+               *)
+                       ifconfig $i create >/dev/null 2>&1
+                       ifconfig $i tunnel ${peers}
+                       ifconfig $i up
+                       ;;
+               esac
+       done
+}
+
+# ng_fec_create ifn
+# Configure Fast EtherChannel for interface $ifn. Returns 0 if FEC
+# arguments were found and configured; returns !0 otherwise.
+ng_fec_create() {
+        local req_iface iface bogus
+        req_iface="$1"
+
+        ngctl shutdown ${req_iface}: > /dev/null 2>&1
+
+        bogus=""
+        while true; do
+                iface=`ng_create_one fec dummy fec`
+                if [ -z "${iface}" ]; then
+                        exit 2
+                fi
+                if [ "${iface}" = "${req_iface}" ]; then
+                        break
+                fi
+                bogus="${bogus} ${iface}"
+        done
+
+        for iface in ${bogus}; do
+                ngctl shutdown ${iface}:
+        done
+}
+
+fec_up() {
+       for i in ${fec_interfaces}; do
+               ng_fec_create $i
+               for j in `get_if_var $i fecconfig_IF`; do
+                       case ${j} in
                        '')
                                continue
                                ;;
                        *)
-                               ifconfig $i create >/dev/null 2>&1
-                               ifconfig $i tunnel ${peers}
-                               ifconfig $i up
+                               ngctl msg ${i}: add_iface "\"${j}\""
                                ;;
                        esac
                done
-               ;;
-       esac
+       done
 }
 
 #

==== 
//depot/projects/soc2006/nss_ldap_cached/src/etc/periodic/security/800.loginfail#3
 (text+ko) ====

@@ -24,7 +24,7 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.7 2007/02/05 16:36:25 
jdp Exp $
+# $FreeBSD: src/etc/periodic/security/800.loginfail,v 1.8 2007/02/23 21:42:54 
remko Exp $
 #
 
 # Show login failures
@@ -59,7 +59,7 @@
     [Yy][Ee][Ss])
        echo ""
        echo "${host} login failures:"
-       n=$(catmsgs | egrep -ia "^$yesterday.*(fail|invalid|bad|illegal)" |
+       n=$(catmsgs | egrep -ia "^$yesterday.*: .* (fail|invalid|bad|illegal)" |
            tee /dev/stderr | wc -l)
        [ $n -gt 0 ] && rc=1 || rc=0;;
     *) rc=0;;

==== 
//depot/projects/soc2006/nss_ldap_cached/src/etc/periodic/weekly/310.locate#2 
(text+ko) ====

@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-# $FreeBSD: src/etc/periodic/weekly/310.locate,v 1.6 2000/09/14 17:19:13 brian 
Exp $
+# $FreeBSD: src/etc/periodic/weekly/310.locate,v 1.7 2007/02/23 18:44:20 remko 
Exp $
 #
 
 # If there is a global system configuration file, suck it in.
@@ -23,7 +23,7 @@
        chmod 644 $locdb || rc=3
 
        cd /
-       echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody || rc=3
+       echo /usr/libexec/locate.updatedb | nice -n 5 su -fm nobody || rc=3
        chmod 444 $locdb || rc=3;;
 
     *)  rc=0;;

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/dhclient#6 (text+ko) 
====

@@ -1,7 +1,7 @@
 #!/bin/sh
 #
 # $NetBSD: dhclient,v 1.8 2002/03/22 04:33:58 thorpej Exp $
-# $FreeBSD: src/etc/rc.d/dhclient,v 1.25 2006/10/02 18:50:58 brooks Exp $
+# $FreeBSD: src/etc/rc.d/dhclient,v 1.26 2007/02/15 06:51:31 yar Exp $
 #
 
 # PROVIDE: dhclient
@@ -19,9 +19,9 @@
 dhclient_start()
 {
        # prevent unnecessary restarts
-       # XXX: should use a pidfile
-       if [ -x /usr/bin/pgrep ]; then
-               pids=`/usr/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
+       # XXX: dhclient had better create a pidfile
+       if [ -x /bin/pgrep ]; then
+               pids=`/bin/pgrep -f "dhclient: $ifn(\$| .*)"`
                if [ -n "$pids" ]; then
                        exit 0
                fi

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/hostname#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/etc/rc.d/hostname,v 1.8 2004/10/07 13:55:25 mtm Exp $
+# $FreeBSD: src/etc/rc.d/hostname,v 1.11 2007/02/15 06:46:33 yar Exp $
 #
 
 # PROVIDE: hostname
@@ -31,6 +31,7 @@
 # BEFORE:  netif
 
 . /etc/rc.subr
+. /etc/network.subr
 
 name="hostname"
 start_cmd="hostname_start"
@@ -58,8 +59,21 @@
                fi
        fi
 
-       /bin/hostname ${hostname}
-       echo "Setting hostname: `hostname`."
+       # Have we got a hostname yet?
+       #
+       if [ -z "${hostname}" ]; then
+               # Null hostname is probably OK if DHCP is in use.
+               #
+               if [ -z "`list_net_interfaces dhcp`" ]; then
+                       warn "\$hostname is not set -- see ${rcvar_manpage}."
+               fi
+               return
+       fi
+
+       # All right, it is safe to invoke hostname(1) now.
+       #
+       echo "Setting hostname: ${hostname}."
+       /bin/hostname "${hostname}"
 }
 
 load_rc_config $name

==== //depot/projects/soc2006/nss_ldap_cached/src/etc/rc.d/netif#4 (text+ko) 
====

@@ -22,7 +22,7 @@
 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
-# $FreeBSD: src/etc/rc.d/netif,v 1.21 2006/12/30 22:53:20 yar Exp $
+# $FreeBSD: src/etc/rc.d/netif,v 1.22 2007/02/09 12:11:26 flz Exp $
 #
 
 # PROVIDE: netif
@@ -57,6 +57,9 @@
                # Create cloned interfaces
                clone_up
 
+               # Create Fast EtherChannel interfaces
+               fec_up
+
                # Create IPv6<-->IPv4 tunnels
                gif_up
 

==== //depot/projects/soc2006/nss_ldap_cached/src/include/Makefile#8 (text+ko) 
====

@@ -1,5 +1,5 @@
 #      @(#)Makefile    8.2 (Berkeley) 1/4/94
-# $FreeBSD: src/include/Makefile,v 1.267 2007/01/25 22:38:04 peter Exp $
+# $FreeBSD: src/include/Makefile,v 1.268 2007/02/11 14:01:32 rodrigc Exp $
 #
 # Doing a "make install" builds /usr/include.
 
@@ -47,7 +47,6 @@
        fs/unionfs \
        geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \
        geom/mirror geom/nop geom/raid3 geom/shsec geom/stripe \
-       isofs/cd9660 \
        netatm/ipatm netatm/sigpvc netatm/spans netatm/uni \
        netgraph/atm netgraph/netflow \
        security/audit \
@@ -163,6 +162,9 @@
        cd ${.CURDIR}/../sys/contrib/altq/altq; \
        ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
            ${DESTDIR}${INCLUDEDIR}/altq
+       cd ${.CURDIR}/../sys/fs/cd9660/; \
+       ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
+           ${DESTDIR}${INCLUDEDIR}/isofs/cd9660
 .if ${MK_IPFILTER} != "no"
        cd ${.CURDIR}/../sys/contrib/ipfilter/netinet; \
        ${INSTALL} -C -o ${BINOWN} -g ${BINGRP} -m 444 *.h \
@@ -287,3 +289,8 @@
        done
 .endif
 .endif
+       cd ${.CURDIR}/../sys/fs/cd9660; \
+       for h in *.h; do \
+               ln -fs ../../../../sys/fs/cd9660/$$h \
+                   ${DESTDIR}${INCLUDEDIR}/isofs/cd9660; \
+       done

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/getcap.3#3 
(text+ko) ====

@@ -29,7 +29,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"    @(#)getcap.3    8.4 (Berkeley) 5/13/94
-.\" $FreeBSD: src/lib/libc/gen/getcap.3,v 1.29 2007/01/09 00:27:53 imp Exp $
+.\" $FreeBSD: src/lib/libc/gen/getcap.3,v 1.30 2007/02/11 18:14:49 maxim Exp $
 .\"
 .Dd March 22, 2002
 .Dt GETCAP 3
@@ -527,7 +527,7 @@
 The
 .Fn cgetent ,
 and
-.Fn cgetseq
+.Fn cgetset
 functions may fail and set
 .Va errno
 for any of the errors specified for the library functions:

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/gen/tls.c#5 
(text+ko) ====

@@ -23,7 +23,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- *     $FreeBSD: src/lib/libc/gen/tls.c,v 1.13 2006/10/08 02:50:33 kmacy Exp $
+ *     $FreeBSD: src/lib/libc/gen/tls.c,v 1.14 2007/02/25 21:23:50 kientzle 
Exp $
  */
 
 /*
@@ -36,7 +36,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <elf.h>
-#include <assert.h>
 
 #include "libc_private.h"
 
@@ -207,7 +206,8 @@
 
        size = round(tls_static_space, tcbalign);
 
-       assert(tcbsize >= 2*sizeof(Elf_Addr));
+       if (tcbsize < 2 * sizeof(Elf_Addr))
+               tcbsize = 2 * sizeof(Elf_Addr);
        tls = calloc(1, size + tcbsize);
        dtv = malloc(3 * sizeof(Elf_Addr));
 

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/Makefile.inc#9 
(text+ko) ====

@@ -1,5 +1,5 @@
 #      from @(#)Makefile.inc   8.2 (Berkeley) 9/5/93
-# $FreeBSD: src/lib/libc/net/Makefile.inc,v 1.63 2006/12/15 12:01:50 rrs Exp $
+# $FreeBSD: src/lib/libc/net/Makefile.inc,v 1.64 2007/02/22 14:32:38 rrs Exp $
 
 # machine-independent net sources
 .PATH: ${.CURDIR}/net
@@ -49,7 +49,10 @@
        inet.3 inet_net.3 \
        inet6_opt_init.3 inet6_option_space.3 inet6_rth_space.3 \
        inet6_rthdr_space.3 linkaddr.3 \
-       nsdispatch.3 rcmd.3 rcmdsh.3 resolver.3 sockatmark.3
+       nsdispatch.3 rcmd.3 rcmdsh.3 resolver.3 sockatmark.3 \
+        sctp_bindx.3 sctp_connectx.3 sctp_freepaddrs.3 \
+        sctp_getaddrlen.3 sctp_getassocid.3 sctp_getpaddrs.3 \
+        sctp_opt_info.3 sctp_recvmsg.3 sctp_send.3 sctp_sendmsg.3 \
 
 MLINKS+=addr2ascii.3 ascii2addr.3
 MLINKS+=byteorder.3 htonl.3 byteorder.3 htons.3 byteorder.3 ntohl.3 \
@@ -79,6 +82,10 @@
        inet.3 inet_network.3 inet.3 inet_ntoa.3 \
        inet.3 inet_ntop.3 inet.3 inet_pton.3 \
        inet.3 network.3 inet.3 ntoa.3 
+MLINKS+= sctp_send.3 sctp_sendx.3
+MLINKS+= sctp_sendmsg.3 sctp_sendmsgx.3
+MLINKS+= sctp_freepaddrs.3 sctp_freeladdrs.3
+MLINKS+= sctp_getpaddrs.3 sctp_getladdrs.3
 MLINKS+=inet_net.3 inet_net_ntop.3 inet_net.3 inet_net_pton.3
 MLINKS+=inet6_opt_init.3 inet6_opt_append.3 \
        inet6_opt_init.3 inet6_opt_find.3 \

==== 
//depot/projects/soc2006/nss_ldap_cached/src/lib/libc/net/sctp_sys_calls.c#2 
(text+ko) ====

@@ -29,7 +29,7 @@
  * SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/net/sctp_sys_calls.c,v 1.2 2006/12/16 
06:03:43 rodrigc Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/net/sctp_sys_calls.c,v 1.5 2007/02/22 
14:48:12 rrs Exp $");
 #include <stdio.h>
 #include <string.h>
 #include <errno.h>
@@ -54,14 +54,20 @@
         (*(const u_int32_t *)(const void *)(&(a)->s6_addr[8]) == 
ntohl(0x0000ffff)))
 #endif
 
+
 #define SCTP_CONTROL_VEC_SIZE_SND   8192
 #define SCTP_CONTROL_VEC_SIZE_RCV  16384
+#define SCTP_STACK_BUF_SIZE         2048
+#define SCTP_SMALL_IOVEC_SIZE          2
 
 #ifdef SCTP_DEBUG_PRINT_ADDRESS
+
+#define SCTP_STRING_BUF_SZ 256
+
 static void
 SCTPPrintAnAddress(struct sockaddr *a)
 {
-       char stringToPrint[256];
+       char stringToPrint[SCTP_STRING_BUF_SZ];
        u_short prt;
        char *srcaddr, *txt;
 
@@ -79,8 +85,8 @@
                txt = "IPv6 Address: ";
        } else if (a->sa_family == AF_LINK) {
                int i;
-               char tbuf[200];
-               u_char adbuf[200];
+               char tbuf[SCTP_STRING_BUF_SZ];
+               u_char adbuf[SCTP_STRING_BUF_SZ];
                struct sockaddr_dl *dl;
 
                dl = (struct sockaddr_dl *)a;
@@ -101,10 +107,6 @@
                                printf(":");
                }
                printf("\n");
-               /*
-                * u_short      sdl_route[16]; *//* source routing
-                * information
-                */
                return;
        } else {
                return;
@@ -164,7 +166,7 @@
 int
 sctp_connectx(int sd, const struct sockaddr *addrs, int addrcnt)
 {
-       char buf[2048];
+       char buf[SCTP_STACK_BUF_SIZE];
        int i, ret, cnt, *aa;
        char *cpto;
        const struct sockaddr *at;
@@ -298,14 +300,14 @@
        asoc = id;
        siz = sizeof(sctp_assoc_t);
        if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_REMOTE_ADDR_SIZE,
-           &asoc, &siz) != 0) {
+           &asoc,  &siz) != 0) {
                errno = ENOMEM;
                return (-1);
        }
        /* size required is returned in 'asoc' */
-       siz = (uint32_t) asoc;
+       siz = (size_t)asoc;
        siz += sizeof(struct sctp_getaddresses);
-       addrs = calloc((unsigned long)1, (unsigned long)siz);
+       addrs = calloc(1, siz);
        if (addrs == NULL) {
                errno = ENOMEM;
                return (-1);
@@ -314,7 +316,7 @@
        addrs->sget_assoc_id = id;
        /* Now lets get the array of addresses */
        if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_PEER_ADDRESSES,
-           addrs, (socklen_t *) & siz) != 0) {
+           addrs,  &siz) != 0) {
                free(addrs);
                errno = ENOMEM;
                return (-1);
@@ -370,7 +372,7 @@
        }
        siz = size_of_addresses + sizeof(struct sockaddr_storage);
        siz += sizeof(struct sctp_getaddresses);
-       addrs = calloc((unsigned long)1, (unsigned long)siz);
+       addrs = calloc(1, siz);
        if (addrs == NULL) {
                errno = ENOMEM;
                return (-1);
@@ -379,7 +381,7 @@
        addrs->sget_assoc_id = id;
        /* Now lets get the array of addresses */
        if (getsockopt(sd, IPPROTO_SCTP, SCTP_GET_LOCAL_ADDRESSES, addrs,
-           (socklen_t *) & siz) != 0) {
+           &siz) != 0) {
                free(addrs);
                errno = ENOMEM;
                return (-1);
@@ -436,7 +438,7 @@
        ssize_t sz;
        struct msghdr msg;
        struct sctp_sndrcvinfo *s_info;
-       struct iovec iov[2];
+       struct iovec iov[SCTP_SMALL_IOVEC_SIZE];
        char controlVector[SCTP_CONTROL_VEC_SIZE_RCV];
        struct cmsghdr *cmsg;
        struct sockaddr *who = NULL;
@@ -547,7 +549,7 @@
 #else
        ssize_t sz;
        struct msghdr msg;
-       struct iovec iov[2];
+       struct iovec iov[SCTP_SMALL_IOVEC_SIZE];
        struct sctp_sndrcvinfo *s_info;
        char controlVector[SCTP_CONTROL_VEC_SIZE_SND];
        struct cmsghdr *cmsg;
@@ -595,6 +597,20 @@
        int add_len, len, no_end_cx = 0;
        struct sockaddr *at;
 
+
+#ifdef SYS_sctp_generic_sendmsg
+       if (addrcnt < SCTP_SMALL_IOVEC_SIZE) {
+               socklen_t l;
+
+               /*
+                * Quick way, we don't need to do a connectx so lets use the
+                * syscall directly.
+                */
+               l = addrs->sa_len;
+               return (syscall(SYS_sctp_generic_sendmsg, sd,
+                   msg, msg_len, addrs, l, sinfo, flags));
+       }
+#endif
        len = sizeof(int);
        at = addrs;
        cnt = 0;
@@ -617,10 +633,6 @@
                errno = EINVAL;
                return (-1);
        }
-       if (len > 2048) {
-               /* Never enough memory */
-               return (E2BIG);
-       }
        buf = malloc(len);
        if (buf == NULL) {
                return (ENOMEM);
@@ -693,7 +705,7 @@
 {
 
 #ifdef SYS_sctp_generic_recvmsg
-       struct iovec iov[2];
+       struct iovec iov[SCTP_SMALL_IOVEC_SIZE];
 
        iov[0].iov_base = dbuf;
        iov[0].iov_len = len;
@@ -704,7 +716,7 @@
        ssize_t sz;
        int sinfo_found = 0;
        struct msghdr msg;
-       struct iovec iov[2];
+       struct iovec iov[SCTP_SMALL_IOVEC_SIZE];
        char controlVector[SCTP_CONTROL_VEC_SIZE_RCV];
        struct cmsghdr *cmsg;
 
@@ -826,3 +838,9 @@
 }
 
 #endif
+
+
+#undef SCTP_CONTROL_VEC_SIZE_SND
+#undef SCTP_CONTROL_VEC_SIZE_RCV
+#undef SCTP_STACK_BUF_SIZE
+#undef SCTP_SMALL_IOVEC_SIZE

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/stdlib/malloc.c#9 
(text+ko) ====

@@ -185,7 +185,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.139 2007/01/31 22:54:19 
jasone Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdlib/malloc.c,v 1.140 2007/02/22 19:10:30 
jasone Exp $");
 
 #include "libc_private.h"
 #ifdef MALLOC_DEBUG
@@ -1029,8 +1029,8 @@
                                malloc_mutex_unlock(&brk_mtx);
                                base_chunk = brk_cur;
                                base_next_addr = base_chunk;
-                               base_past_addr = (void *)((uintptr_t)base_chunk 
+
-                                   incr);
+                               base_past_addr = (void *)((uintptr_t)base_chunk
+                                   + incr);
 #ifdef MALLOC_STATS
                                base_total += incr;
 #endif
@@ -1042,8 +1042,8 @@
 #endif
 
        /*
-        * Don't worry about chunk alignment here, since base_chunk doesn't 
really
-        * need to be aligned.
+        * Don't worry about chunk alignment here, since base_chunk doesn't
+        * really need to be aligned.
         */
        base_chunk = pages_map(NULL, chunk_size);
        if (base_chunk == NULL)
@@ -1067,8 +1067,12 @@
 
        malloc_mutex_lock(&base_mtx);
 
-       /* Make sure there's enough space for the allocation. */
-       if ((uintptr_t)base_next_addr + csize > (uintptr_t)base_past_addr) {
+       /*
+        * Make sure there's enough space for the allocation.
+        * base_chunk_alloc() does not guarantee that a newly allocated chunk
+        * is >= size, so loop here, rather than only trying once.
+        */
+       while ((uintptr_t)base_next_addr + csize > (uintptr_t)base_past_addr) {
                if (base_chunk_alloc(csize)) {
                        ret = NULL;
                        goto RETURN;
@@ -1299,6 +1303,36 @@
                }
        }
 
+       /*
+        * Try to over-allocate, but allow the OS to place the allocation
+        * anywhere.  Beware of size_t wrap-around.
+        */
+       if (size + chunk_size > size) {
+               if ((ret = pages_map(NULL, size + chunk_size)) != NULL) {
+                       size_t offset = CHUNK_ADDR2OFFSET(ret);
+
+                       /*
+                        * Success.  Clean up unneeded leading/trailing space.
+                        */
+                       if (offset != 0) {
+                               /* Leading space. */
+                               pages_unmap(ret, chunk_size - offset);
+
+                               ret = (void *)((uintptr_t)ret + (chunk_size -
+                                   offset));
+
+                               /* Trailing space. */
+                               pages_unmap((void *)((uintptr_t)ret + size),
+                                   offset);
+                       } else {
+                               /* Trailing space only. */
+                               pages_unmap((void *)((uintptr_t)ret + size),
+                                   chunk_size);
+                       }
+                       goto RETURN;
+               }
+       }
+
 #ifdef USE_BRK
        /*
         * Try to create allocations in brk, in order to make full use of
@@ -1342,36 +1376,6 @@
        }
 #endif
 
-       /*
-        * Try to over-allocate, but allow the OS to place the allocation
-        * anywhere.  Beware of size_t wrap-around.
-        */
-       if (size + chunk_size > size) {
-               if ((ret = pages_map(NULL, size + chunk_size)) != NULL) {
-                       size_t offset = CHUNK_ADDR2OFFSET(ret);
-
-                       /*
-                        * Success.  Clean up unneeded leading/trailing space.
-                        */
-                       if (offset != 0) {
-                               /* Leading space. */
-                               pages_unmap(ret, chunk_size - offset);
-
-                               ret = (void *)((uintptr_t)ret + (chunk_size -
-                                   offset));
-
-                               /* Trailing space. */
-                               pages_unmap((void *)((uintptr_t)ret + size),
-                                   offset);
-                       } else {
-                               /* Trailing space only. */
-                               pages_unmap((void *)((uintptr_t)ret + size),
-                                   chunk_size);
-                       }
-                       goto RETURN;
-               }
-       }
-
        /* All strategies for allocation failed. */
        ret = NULL;
 RETURN:

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/Makefile.inc#3 
(text+ko) ====

@@ -1,5 +1,5 @@
 #      @(#)Makefile.inc        8.3 (Berkeley) 10/24/94
-# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.122 2006/10/12 13:46:33 ru Exp $
+# $FreeBSD: src/lib/libc/sys/Makefile.inc,v 1.123 2007/02/22 14:32:38 rrs Exp $
 
 # sys sources
 .PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys
@@ -84,6 +84,7 @@
        sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigqueue.2 \
        sigreturn.2 sigstack.2 sigsuspend.2 sigwait.2 sigwaitinfo.2 \
        socket.2 socketpair.2 stat.2 statfs.2 \
+        sctp_generic_recvmsg.2  sctp_generic_sendmsg.2  sctp_peeloff.2 \
        swapon.2 symlink.2 sync.2 sysarch.2 syscall.2 \
        timer_create.2 timer_delete.2 timer_settime.2 \
        truncate.2 umask.2 undelete.2 \

==== //depot/projects/soc2006/nss_ldap_cached/src/lib/libc/sys/kse.2#4 
(text+ko) ====

@@ -33,9 +33,9 @@
 .\" THE USE OF THIS SOFTWARE, EVEN IF PACKET DESIGN IS ADVISED OF
 .\" THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/sys/kse.2,v 1.19 2006/12/12 08:13:02 julian Exp $
+.\" $FreeBSD: src/lib/libc/sys/kse.2,v 1.22 2007/02/14 07:38:39 brueffer Exp $
 .\"
-.Dd July 12, 2004
+.Dd February 13, 2007
 .Dt KSE 2
 .Os
 .Sh NAME
@@ -47,7 +47,7 @@
 .In sys/types.h
 .In sys/kse.h
 .Ft int
-.Fn kse_create "struct kse_mailbox *mbx" "int newgroup"
+.Fn kse_create "struct kse_mailbox *mbx" "int sys-scope"
 .Ft int
 .Fn kse_exit void
 .Ft int
@@ -103,9 +103,6 @@
 .It
 All operations that block in the kernel become asynchronous, allowing
 the user process to schedule another thread when any thread blocks.
-.It
-Multiple thread schedulers within the same process are possible, and they
-may operate independently of each other.
 .El
 .\"
 .Ss Definitions
@@ -124,6 +121,8 @@
 The KSE is said to be
 .Sy assigned
 to the thread.
+KSEs (a user abstraction) are implemented on top
+of kernel threads using an 'upcall' entity.
 .Pp
 The KSE becomes
 .Sy unassigned ,
@@ -160,22 +159,13 @@
 KSEs always complete as much work as possible in the kernel before
 becoming unassigned.
 .Pp
-A
-.Sy "KSE group"
-is a collection of KSEs that are scheduled uniformly and which share
-access to the same pool of threads, which are associated with the KSE group.
-A KSE group is the smallest entity to which a kernel scheduling
-priority may be assigned.
-For the purposes of process scheduling and accounting, each
-KSE group
-counts similarly to a traditional unthreaded process.
-Individual KSEs within a KSE group are effectively indistinguishable,
-and any KSE in a KSE group may be assigned by the kernel to any runnable
-(in the kernel) thread associated with that KSE group.
+Individual KSEs within a process are effectively indistinguishable,
+and any KSE in a process may be assigned by the kernel to any runnable
+(in the kernel) thread associated with that process.
 In practice, the kernel attempts to preserve the affinity between threads
 and actual CPUs to optimize cache behavior, but this is invisible to the
 user process.
-(Affinity is not yet implemented.)
+(Affinity is not yet fully implemented.)
 .Pp
 Each KSE has a unique
 .Sy "KSE mailbox"
@@ -199,17 +189,17 @@
 This pointer is saved when the thread blocks in the kernel.
 .Pp
 Whenever a thread blocked in the kernel is ready to return to user space,
-it is added to the KSE group's list of
+it is added to the process's list of
 .Sy completed
 threads.
 This list is presented to the user code at the next upcall as a linked list
 of thread mailboxes.
 .Pp
-There is a kernel-imposed limit on the number of threads in a KSE group
+There is a kernel-imposed limit on the number of threads in a process
 that may be simultaneously blocked in the kernel (this number is not
 currently visible to the user).
 When this limit is reached, upcalls are blocked and no work is performed
-for the KSE group until one of the threads completes (or a signal is
+for the process until one of the threads completes (or a signal is
 received).
 .\"
 .Ss Managing KSEs
@@ -223,27 +213,32 @@
 The KSE will be associated with the mailbox pointed to by
 .Fa mbx .
 If
-.Fa newgroup
-is non-zero, a new KSE group is also created containing the KSE.
-Otherwise, the new KSE is added to the current KSE group.
-Newly created KSEs are initially unassigned; therefore,
-they will upcall immediately.
+.Fa sys_scope
+is non-zero, then the new thread will be counted as a system scope
+thread. Other things must be done as well to make a system scope thread
+so this is not sufficient (yet).
+System scope variables are not covered
+in detail in this manual page yet, but briefly, they never perform
+upcalls and do not return to the user thread scheduler.
+Once launched they run autonomously.
+The pthreads library knows how to make system
+scope threads and users are encouraged to use the library interface.
 .Pp
-Each process initially has a single KSE in a single KSE group executing
-a single user thread.
+Each process initially has a single KSE executing a single user thread.
 Since the KSE does not have an associated mailbox, it must remain assigned
 to the thread and does not perform any upcalls.
+(It is by definition a system scope thread).
 The result is the traditional, unthreaded mode of operation.
 Therefore, as a special case, the first call to
 .Fn kse_create
 by this initial thread with
-.Fa newgroup
+.Fa sys_scope
 equal to zero does not create a new KSE; instead, it simply associates the
 current KSE with the supplied KSE mailbox, and no immediate upcall results.
 However, an upcall will be triggered the next time the thread blocks and
 the required conditions are met.
 .Pp
-The kernel does not allow more KSEs to exist in a KSE group than the
+The kernel does not allow more KSEs to exist in a process than the
 number of physical CPUs in the system (this number is available as the
 .Xr sysctl 3
 variable
@@ -261,8 +256,8 @@
 .Fn kse_exit
 system call
 causes the KSE assigned to the currently running thread to be destroyed.
-If this KSE is the last one in the KSE group, there must be no remaining
-threads associated with the KSE group blocked in the kernel.
+If this KSE is the last one in the process, there must be no remaining
+threads associated with that process blocked in the kernel.
 This system call does not return unless there is an error.
 Calling
 .Fn kse_exit
@@ -309,7 +304,7 @@
 may be
 .Dv NULL
 to specify
-.Dq "any KSE in the current KSE group" .
+.Dq "any KSE in the current process" .
 .Pp
 The
 .Fn kse_thr_interrupt
@@ -460,7 +455,7 @@
 in the kernel since the last upcall.
 The user thread scheduler should put these threads back into its
 own runnable queue.
-Each thread in a KSE group that completes a kernel operation
+Each thread in a process that completes a kernel operation
 (synchronous or asynchronous) that results in an upcall is guaranteed to be
 linked into exactly one KSE's

>>> TRUNCATED FOR MAIL (1000 lines) <<<
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/p4-projects
To unsubscribe, send any mail to "[email protected]"

<Prev in Thread] Current Thread [Next in Thread>
  • PERFORCE change 115057 for review, Michael Bushkov <=