svn commit: r284493 - stable/10/lib/libthr/thread

2015-06-16 Thread Konstantin Belousov
Author: kib
Date: Wed Jun 17 04:18:30 2015
New Revision: 284493
URL: https://svnweb.freebsd.org/changeset/base/284493

Log:
  MFC r284385:
  Fix typo in comment.

Modified:
  stable/10/lib/libthr/thread/thr_sig.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libthr/thread/thr_sig.c
==
--- stable/10/lib/libthr/thread/thr_sig.c   Wed Jun 17 03:23:45 2015
(r284492)
+++ stable/10/lib/libthr/thread/thr_sig.c   Wed Jun 17 04:18:30 2015
(r284493)
@@ -293,8 +293,8 @@ check_cancel(struct pthread *curthread, 
 * 2) because _thr_ast() may be called by
 *THR_CRITICAL_LEAVE() which is used by rtld rwlock
 *and any libthr internal locks, when rtld rwlock
-*is used, it is mostly caused my an unresolved PLT.
-*those routines may clear the TDP_WAKEUP flag by
+*is used, it is mostly caused by an unresolved PLT.
+*Those routines may clear the TDP_WAKEUP flag by
 *invoking some system calls, in those cases, we
 *also should reenable the flag.
 * 3) thread is in sigsuspend(), and the syscall insists
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r284487 - stable/10

2015-06-16 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Wed Jun 17 02:47:30 2015
New Revision: 284487
URL: https://svnweb.freebsd.org/changeset/base/284487

Log:
  MFC: The fix for the issue described in the 20150614 sendmail entry has
   been been committed in revision 284485..

Modified:
  stable/10/UPDATING

Modified: stable/10/UPDATING
==
--- stable/10/UPDATING  Wed Jun 17 02:43:20 2015(r284486)
+++ stable/10/UPDATING  Wed Jun 17 02:47:30 2015(r284487)
@@ -16,6 +16,13 @@ from older versions of FreeBSD, try WITH
 stable/10, and then rebuild without this option. The bootstrap process from
 older version of current is a bit fragile.
 
+20150615:
+   The fix for the issue described in the 20150614 sendmail entry
+   below has been been committed in revision 284485.  The work
+   around described in that entry is no longer needed unless the
+   default setting is overridden by a confDH_PARAMETERS configuration
+   setting of '5' or pointing to a 512 bit DH parameter file.
+
 20150614:
The import of openssl to address the FreeBSD-SA-15:10.openssl
security advisory includes a change which rejects handshakes
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r284485 - stable/10/contrib/sendmail/src

2015-06-16 Thread Gregory Neil Shapiro
Author: gshapiro
Date: Wed Jun 17 02:39:10 2015
New Revision: 284485
URL: https://svnweb.freebsd.org/changeset/base/284485

Log:
  MFC: The import of openssl to address the FreeBSD-SA-15:10.openssl security
   advisory includes a change which rejects handshakes with DH parameters
   below 768 bits.  sendmail releases prior to 8.15.2 (not yet released),
   defaulted to a 512 bit DH parameter setting for client connections.
   This commit chages that default to 1024 bits.  sendmail 8.15.2, when
   released well use a default of 2048 bits.

Modified:
  stable/10/contrib/sendmail/src/tls.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/contrib/sendmail/src/tls.c
==
--- stable/10/contrib/sendmail/src/tls.cWed Jun 17 02:30:12 2015
(r284484)
+++ stable/10/contrib/sendmail/src/tls.cWed Jun 17 02:39:10 2015
(r284485)
@@ -650,7 +650,7 @@ inittls(ctx, req, options, srv, certfile
**  1024generate 1024 bit parameters
**  2048generate 2048 bit parameters
**  /file/name  read parameters from /file/name
-   **  default is: 1024 for server, 512 for client (OK? XXX)
+   **  default is: 1024
*/
 
if (bitset(TLS_I_TRY_DH, req))
@@ -676,8 +676,8 @@ inittls(ctx, req, options, srv, certfile
}
if (dhparam == NULL)
{
-   dhparam = srv ? "1" : "5";
-   req |= (srv ? TLS_I_DH1024 : TLS_I_DH512);
+   dhparam = "1";
+   req |= TLS_I_DH1024;
}
else if (*dhparam == '/')
{
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r284484 - in stable/10: contrib/top usr.bin/top

2015-06-16 Thread Marcel Moolenaar
Author: marcel
Date: Wed Jun 17 02:30:12 2015
New Revision: 284484
URL: https://svnweb.freebsd.org/changeset/base/284484

Log:
  MFC 284165:
  Move contrib/top/top.X to contrib/top/top.xs and move
  contrib/top/top.local.H to contrib/top/top.local.hs.
  Change the makefile accordingly.

Added:
  stable/10/contrib/top/top.local.hs
 - copied unchanged from r284165, head/contrib/top/top.local.hs
  stable/10/contrib/top/top.xs
 - copied unchanged from r284165, head/contrib/top/top.xs
Deleted:
  stable/10/contrib/top/top.X
  stable/10/contrib/top/top.local.H
Modified:
  stable/10/usr.bin/top/Makefile
Directory Properties:
  stable/10/   (props changed)

Copied: stable/10/contrib/top/top.local.hs (from r284165, 
head/contrib/top/top.local.hs)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/contrib/top/top.local.hs  Wed Jun 17 02:30:12 2015
(r284484, copy of r284165, head/contrib/top/top.local.hs)
@@ -0,0 +1,68 @@
+/*
+ *  Top - a top users display for Berkeley Unix
+ *
+ *  Definitions for things that might vary between installations.
+ */
+
+/*
+ *  The space command forces an immediate update.  Sometimes, on loaded
+ *  systems, this update will take a significant period of time (because all
+ *  the output is buffered).  So, if the short-term load average is above
+ *  "LoadMax", then top will put the cursor home immediately after the space
+ *  is pressed before the next update is attempted.  This serves as a visual
+ *  acknowledgement of the command.  On Suns, "LoadMax" will get multiplied by
+ *  "FSCALE" before being compared to avenrun[0].  Therefore, "LoadMax"
+ *  should always be specified as a floating point number.
+ */
+#ifndef LoadMax
+#define LoadMax  %LoadMax%
+#endif
+
+/*
+ *  "Table_size" defines the size of the hash tables used to map uid to
+ *  username.  The number of users in /etc/passwd CANNOT be greater than
+ *  this number.  If the error message "table overflow: too many users"
+ *  is printed by top, then "Table_size" needs to be increased.  Things will
+ *  work best if the number is a prime number that is about twice the number
+ *  of lines in /etc/passwd.
+ */
+#ifndef Table_size
+#define Table_size %TableSize%
+#endif
+
+/*
+ *  "Nominal_TOPN" is used as the default TOPN when Default_TOPN is Infinity
+ *  and the output is a dumb terminal.  If we didn't do this, then
+ *  installations who use a default TOPN of Infinity will get every
+ *  process in the system when running top on a dumb terminal (or redirected
+ *  to a file).  Note that Nominal_TOPN is a default:  it can still be
+ *  overridden on the command line, even with the value "infinity".
+ */
+#ifndef Nominal_TOPN
+#define Nominal_TOPN   %NominalTopn%
+#endif
+
+#ifndef Default_TOPN
+#define Default_TOPN   %topn%
+#endif
+
+#ifndef Default_DELAY
+#define Default_DELAY  %delay%
+#endif
+
+/*
+ *  If the local system's getpwnam interface uses random access to retrieve
+ *  a record (i.e.: 4.3 systems, Sun "yellow pages"), then defining
+ *  RANDOM_PW will take advantage of that fact.  If RANDOM_PW is defined,
+ *  then getpwnam is used and the result is cached.  If not, then getpwent
+ *  is used to read and cache the password entries sequentially until the
+ *  desired one is found.
+ *
+ *  We initially set RANDOM_PW to something which is controllable by the
+ *  Configure script.  Then if its value is 0, we undef it.
+ */
+
+#define RANDOM_PW  %random%
+#if RANDOM_PW == 0
+#undef RANDOM_PW
+#endif

Copied: stable/10/contrib/top/top.xs (from r284165, head/contrib/top/top.xs)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ stable/10/contrib/top/top.xsWed Jun 17 02:30:12 2015
(r284484, copy of r284165, head/contrib/top/top.xs)
@@ -0,0 +1,448 @@
+.\" NOTE:  changes to the manual page for "top" should be made in the
+.\"file "top.X" and NOT in the file "top.1".
+.\" $FreeBSD$
+.nr N %topn%
+.nr D %delay%
+.TH TOP 1 Local
+.UC 4
+.SH NAME
+top \- display and update information about the top cpu processes
+.SH SYNOPSIS
+.B top
+[
+.B \-abCHIijnPqStuvz
+] [
+.BI \-d count
+] [
+.BI \-m io | cpu
+] [
+.BI \-o field
+] [
+.BI \-s time
+] [
+.BI \-J jail
+] [
+.BI \-U username
+] [
+.I number
+]
+.SH DESCRIPTION
+.\" This defines appropriate quote strings for nroff and troff
+.ds lq \&"
+.ds rq \&"
+.if t .ds lq ``
+.if t .ds rq ''
+.\" Just in case these number registers aren't set yet...
+.if \nN==0 .nr N 10
+.if \nD==0 .nr D 2
+.I Top
+displays the top
+.if !\nN==-1 \nN
+processes on the system and periodically updates this information.
+.if \nN==-1 \
+\{\
+If standard output is an intelligent terminal (see below) then
+as many processes as will fit on the terminal screen are displayed
+by default.  Otherwise, a good number of them are shown (around 20).
+.\}
+

svn commit: r284460 - in stable/10: sys/contrib/dev/acpica sys/contrib/dev/acpica/common sys/contrib/dev/acpica/compiler sys/contrib/dev/acpica/components/debugger sys/contrib/dev/acpica/components...

2015-06-16 Thread Jung-uk Kim
Author: jkim
Date: Tue Jun 16 20:00:53 2015
New Revision: 284460
URL: https://svnweb.freebsd.org/changeset/base/284460

Log:
  MFC:  r283092, r283966
  
  Merge ACPICA 20150515.
  
  Relnotes: yes

Added:
  stable/10/sys/contrib/dev/acpica/common/ahtable.c
 - copied unchanged from r283092, 
head/sys/contrib/dev/acpica/common/ahtable.c
  stable/10/sys/contrib/dev/acpica/include/acuuid.h
 - copied, changed from r283092, 
head/sys/contrib/dev/acpica/include/acuuid.h
Modified:
  stable/10/sys/contrib/dev/acpica/changes.txt
  stable/10/sys/contrib/dev/acpica/common/adisasm.c
  stable/10/sys/contrib/dev/acpica/common/ahpredef.c
  stable/10/sys/contrib/dev/acpica/common/ahuuids.c
  stable/10/sys/contrib/dev/acpica/common/dmextern.c
  stable/10/sys/contrib/dev/acpica/common/dmtable.c
  stable/10/sys/contrib/dev/acpica/common/dmtbdump.c
  stable/10/sys/contrib/dev/acpica/common/dmtbinfo.c
  stable/10/sys/contrib/dev/acpica/compiler/aslascii.c
  stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.h
  stable/10/sys/contrib/dev/acpica/compiler/aslcompiler.l
  stable/10/sys/contrib/dev/acpica/compiler/asldefine.h
  stable/10/sys/contrib/dev/acpica/compiler/aslfiles.c
  stable/10/sys/contrib/dev/acpica/compiler/aslmessages.c
  stable/10/sys/contrib/dev/acpica/compiler/aslmessages.h
  stable/10/sys/contrib/dev/acpica/compiler/aslprepkg.c
  stable/10/sys/contrib/dev/acpica/compiler/aslstartup.c
  stable/10/sys/contrib/dev/acpica/compiler/aslutils.c
  stable/10/sys/contrib/dev/acpica/compiler/dtcompile.c
  stable/10/sys/contrib/dev/acpica/compiler/dtcompiler.h
  stable/10/sys/contrib/dev/acpica/compiler/dtio.c
  stable/10/sys/contrib/dev/acpica/compiler/dtsubtable.c
  stable/10/sys/contrib/dev/acpica/compiler/dttable.c
  stable/10/sys/contrib/dev/acpica/compiler/dttemplate.c
  stable/10/sys/contrib/dev/acpica/compiler/dttemplate.h
  stable/10/sys/contrib/dev/acpica/compiler/dtutils.c
  stable/10/sys/contrib/dev/acpica/compiler/preprocess.h
  stable/10/sys/contrib/dev/acpica/compiler/prscan.c
  stable/10/sys/contrib/dev/acpica/compiler/prutils.c
  stable/10/sys/contrib/dev/acpica/components/debugger/dbfileio.c
  stable/10/sys/contrib/dev/acpica/components/debugger/dbinput.c
  stable/10/sys/contrib/dev/acpica/components/dispatcher/dsmethod.c
  stable/10/sys/contrib/dev/acpica/components/hardware/hwpci.c
  stable/10/sys/contrib/dev/acpica/components/namespace/nsprepkg.c
  stable/10/sys/contrib/dev/acpica/components/namespace/nsrepair.c
  stable/10/sys/contrib/dev/acpica/components/parser/psopinfo.c
  stable/10/sys/contrib/dev/acpica/components/utilities/utfileio.c
  stable/10/sys/contrib/dev/acpica/components/utilities/uthex.c
  stable/10/sys/contrib/dev/acpica/components/utilities/utxferror.c
  stable/10/sys/contrib/dev/acpica/include/acdebug.h
  stable/10/sys/contrib/dev/acpica/include/acdisasm.h
  stable/10/sys/contrib/dev/acpica/include/aclocal.h
  stable/10/sys/contrib/dev/acpica/include/acparser.h
  stable/10/sys/contrib/dev/acpica/include/acpixf.h
  stable/10/sys/contrib/dev/acpica/include/acpredef.h
  stable/10/sys/contrib/dev/acpica/include/actbl.h
  stable/10/sys/contrib/dev/acpica/include/actbl1.h
  stable/10/sys/contrib/dev/acpica/include/actbl2.h
  stable/10/sys/contrib/dev/acpica/include/actbl3.h
  stable/10/sys/contrib/dev/acpica/include/actypes.h
  stable/10/sys/contrib/dev/acpica/include/acutils.h
  stable/10/sys/contrib/dev/acpica/include/platform/acenv.h
  stable/10/sys/contrib/dev/acpica/include/platform/acenvex.h
  stable/10/usr.sbin/acpi/acpidb/acpidb.c
  stable/10/usr.sbin/acpi/iasl/Makefile
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/contrib/dev/acpica/changes.txt
==
--- stable/10/sys/contrib/dev/acpica/changes.txtTue Jun 16 19:49:12 
2015(r284459)
+++ stable/10/sys/contrib/dev/acpica/changes.txtTue Jun 16 20:00:53 
2015(r284460)
@@ -1,4 +1,52 @@
 
+08 April 2015. Summary of changes for version 20150515:
+
+This release implements most of ACPI 6.0 as described below.
+
+1) ACPICA kernel-resident subsystem:
+
+Implemented runtime argument checking and return value checking for all 
+new ACPI 6.0 predefined names. This includes: _BTH, _CR3, _DSD, _LPI, 
+_MTL, _PRR, _RDI, _RST, _TFP, _TSN.
+
+Example Code and Data Size: These are the sizes for the OS-independent 
+acpica.lib produced by the Microsoft Visual C++ 9.0 32-bit compiler. The 
+debug version of the code includes the debug output trace mechanism and 
+has a much larger code and data size.
+
+  Current Release:
+Non-Debug Version:  99.9K Code, 27.5K Data, 127.4K Total
+Debug Version: 195.2K Code, 80.8K Data, 276.0K Total
+  Previous Release:
+Non-Debug Version:  99.1K Code, 27.3K Data, 126.4K Total
+Debug Version: 192.8K Code, 79.9K Data, 272.7K Total
+
+
+2) iASL Compiler/Disassembler and Tools:
+
+iASL compiler: Added compile-ti

svn commit: r284455 - stable/10/sys/sparc64/pci

2015-06-16 Thread Ed Maste
Author: emaste
Date: Tue Jun 16 18:39:11 2015
New Revision: 284455
URL: https://svnweb.freebsd.org/changeset/base/284455

Log:
  MFC r281930 by jhb:
  
  Update this driver to not save copies of registers that are no longer
  used after r281874.  While here, also update it to always write the
  parent's PCI bus number to the primary bus register.

Modified:
  stable/10/sys/sparc64/pci/apb.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/sparc64/pci/apb.c
==
--- stable/10/sys/sparc64/pci/apb.c Tue Jun 16 17:55:20 2015
(r284454)
+++ stable/10/sys/sparc64/pci/apb.c Tue Jun 16 18:39:11 2015
(r284455)
@@ -171,20 +171,14 @@ apb_attach(device_t dev)
 * Get current bridge configuration.
 */
sc->sc_bsc.ops_pcib_sc.domain = pci_get_domain(dev);
-   sc->sc_bsc.ops_pcib_sc.secstat =
-   pci_read_config(dev, PCIR_SECSTAT_1, 2);
-   sc->sc_bsc.ops_pcib_sc.command =
-   pci_read_config(dev, PCIR_COMMAND, 2);
-   sc->sc_bsc.ops_pcib_sc.pribus =
-   pci_read_config(dev, PCIR_PRIBUS_1, 1);
+   sc->sc_bsc.ops_pcib_sc.pribus = pci_get_bus(dev);
+   pci_write_config(dev, PCIR_PRIBUS_1, sc->sc_bsc.ops_pcib_sc.pribus, 1);
sc->sc_bsc.ops_pcib_sc.bus.sec =
pci_read_config(dev, PCIR_SECBUS_1, 1);
sc->sc_bsc.ops_pcib_sc.bus.sub =
pci_read_config(dev, PCIR_SUBBUS_1, 1);
sc->sc_bsc.ops_pcib_sc.bridgectl =
pci_read_config(dev, PCIR_BRIDGECTL_1, 2);
-   sc->sc_bsc.ops_pcib_sc.seclat =
-   pci_read_config(dev, PCIR_SECLAT_1, 1);
sc->sc_iomap = pci_read_config(dev, APBR_IOMAP, 1);
sc->sc_memmap = pci_read_config(dev, APBR_MEMMAP, 1);
 
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r284444 - stable/10/sys/dev/e1000

2015-06-16 Thread Sean Bruno
Author: sbruno
Date: Tue Jun 16 12:10:55 2015
New Revision: 28
URL: https://svnweb.freebsd.org/changeset/base/28

Log:
  MFC r283923
  
  Simplify hang detection by stealing the techniques used in ixl(4) and
  applying them to em(4).
  
  Rely on iterations through the local timer, and the tx queue state to
  determine if an actual hang has occurred. Any time a descriptor is used
  (packet sent), the tx queue is flagged as busy. Then when txeof runs, it
  either clears the flag when all is clean, or resets it to 1 if ANY are
  cleaned, if nothing is cleaned it increments the flag.
  
  Local timer simply checks to see if busy ever reaches MAX (10, which
  is compile time configurable), and then sets it as HUNG, at that point
  there is one more timer cycle in which to have any cleans, if not a
  watchdog reset will occur.

Modified:
  stable/10/sys/dev/e1000/if_em.c
  stable/10/sys/dev/e1000/if_em.h
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/e1000/if_em.c
==
--- stable/10/sys/dev/e1000/if_em.c Tue Jun 16 09:52:36 2015
(r284443)
+++ stable/10/sys/dev/e1000/if_em.c Tue Jun 16 12:10:55 2015
(r28)
@@ -1,6 +1,6 @@
 /**
 
-  Copyright (c) 2001-2014, Intel Corporation 
+  Copyright (c) 2001-2015, Intel Corporation 
   All rights reserved.
   
   Redistribution and use in source and binary forms, with or without 
@@ -953,11 +953,9 @@ em_mq_start_locked(struct ifnet *ifp, st
 break;
}
 
-   if (enq > 0) {
-/* Set the watchdog */
-txr->queue_status = EM_QUEUE_WORKING;
-   txr->watchdog_time = ticks;
-   }
+   /* Mark the queue as having work */
+   if ((enq > 0) && (txr->busy == EM_TX_IDLE))
+   txr->busy = EM_TX_BUSY;
 
if (txr->tx_avail < EM_MAX_SCATTER)
em_txeof(txr);
@@ -1042,12 +1040,12 @@ em_start_locked(struct ifnet *ifp, struc
break;
}
 
+   /* Mark the queue as having work */
+   if (txr->busy == EM_TX_IDLE)
+   txr->busy = EM_TX_BUSY;
+
/* Send a copy of the frame to the BPF listener */
ETHER_BPF_MTAP(ifp, m_head);
-
-   /* Set timeout in case hardware has problems transmitting. */
-   txr->watchdog_time = ticks;
-txr->queue_status = EM_QUEUE_WORKING;
}
 
return;
@@ -2114,8 +2112,6 @@ retry:
 */
tx_buffer = &txr->tx_buffers[first];
tx_buffer->next_eop = last;
-   /* Update the watchdog time early and often */
-   txr->watchdog_time = ticks;
 
/*
 * Advance the Transmit Descriptor Tail (TDT), this tells the E1000
@@ -2297,15 +2293,16 @@ em_local_timer(void *arg)
** and the HUNG state will be static if set.
*/
for (int i = 0; i < adapter->num_queues; i++, txr++) {
-   if ((txr->queue_status == EM_QUEUE_HUNG) &&
-   (adapter->pause_frames == 0))
+   /* Last cycle a queue was declared hung */
+   if (txr->busy == EM_TX_HUNG)
goto hung;
+   if (txr->busy >= EM_TX_MAXTRIES)
+   txr->busy = EM_TX_HUNG;
/* Schedule a TX tasklet if needed */
if (txr->tx_avail <= EM_MAX_SCATTER)
taskqueue_enqueue(txr->tq, &txr->tx_task);
}

-   adapter->pause_frames = 0;
callout_reset(&adapter->timer, hz, em_local_timer, adapter);
 #ifndef DEVICE_POLLING
/* Trigger an RX interrupt to guarantee mbuf refresh */
@@ -2324,7 +2321,6 @@ hung:
txr->me, txr->tx_avail, txr->next_to_clean);
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
adapter->watchdog_events++;
-   adapter->pause_frames = 0;
em_init_locked(adapter);
 }
 
@@ -2392,9 +2388,9 @@ em_update_link_status(struct adapter *ad
if (bootverbose)
device_printf(dev, "Link is Down\n");
adapter->link_active = 0;
-   /* Link down, disable watchdog */
+   /* Link down, disable hang detection */
for (int i = 0; i < adapter->num_queues; i++, txr++)
-   txr->queue_status = EM_QUEUE_IDLE;
+   txr->busy = EM_TX_IDLE;
if_link_state_change(ifp, LINK_STATE_DOWN);
}
 }
@@ -2426,10 +2422,10 @@ em_stop(void *arg)
ifp->if_drv_flags &= ~IFF_DRV_RUNNING;
ifp->if_drv_flags |= IFF_DRV_OACTIVE;
 
-/* Unarm watchdog timer. */
+/* Disarm Hang Detection. */
for (int i = 0; i < adapter->num_queues; i++, txr++) {
EM_TX_LOCK(txr);
-   txr->queue_status = EM_QUEUE_IDLE;
+ 

svn commit: r284441 - stable/10/usr.bin/sockstat

2015-06-16 Thread Michael Tuexen
Author: tuexen
Date: Tue Jun 16 08:36:57 2015
New Revision: 284441
URL: https://svnweb.freebsd.org/changeset/base/284441

Log:
  MFC r284351:
  Simplify printaddr(). No functional change.
  
  MFC r284352:
  Allow more than one socket entry for a file descriptor. This is needed
  for supporting 1-to-many style SCTP sockets. For other sochets, there
  is no functional change.
  
  MFC r284353:
  Allow more than one local or remote address per socket. This is needed to
  support SCTP (and MPTCP in the future). No functional change for existing
  protocols.
  
  MFC r284354:
  Add support for SCTP.
  
  MFC r284355:
  When using -L the code skips a socket if the local or foreign
  address is loopback. So it is shown if both are not loopback.
  The man page says that it is shown if the local or foreign
  address is not loopback. Change the man page to reflect the
  code.

Modified:
  stable/10/usr.bin/sockstat/sockstat.1
  stable/10/usr.bin/sockstat/sockstat.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/usr.bin/sockstat/sockstat.1
==
--- stable/10/usr.bin/sockstat/sockstat.1   Tue Jun 16 08:26:33 2015
(r284440)
+++ stable/10/usr.bin/sockstat/sockstat.1   Tue Jun 16 08:36:57 2015
(r284441)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 7, 2015
+.Dd June 13, 2015
 .Dt SOCKSTAT 1
 .Os
 .Sh NAME
@@ -61,7 +61,7 @@ Show connected sockets.
 .It Fl j Ar jid
 Show only sockets belonging to the specified jail ID.
 .It Fl L
-Only show Internet sockets if the local or foreign addresses are not
+Only show Internet sockets if the local and foreign addresses are not
 in the loopback network prefix
 .Li 127.0.0.0/8 ,
 or do not contain the IPv6 loopback address

Modified: stable/10/usr.bin/sockstat/sockstat.c
==
--- stable/10/usr.bin/sockstat/sockstat.c   Tue Jun 16 08:26:33 2015
(r284440)
+++ stable/10/usr.bin/sockstat/sockstat.c   Tue Jun 16 08:36:57 2015
(r284441)
@@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -71,7 +72,7 @@ static int opt_v; /* Verbose mode */
 /*
  * Default protocols to use if no -P was defined.
  */
-static const char *default_protos[] = {"tcp", "udp", "divert" };
+static const char *default_protos[] = {"sctp", "tcp", "udp", "divert" };
 static size_t default_numprotos =
 sizeof(default_protos) / sizeof(default_protos[0]);
 
@@ -84,6 +85,11 @@ static int   *ports;
 #define SET_PORT(p) do { ports[p / INT_BIT] |= 1 << (p % INT_BIT); } while (0)
 #define CHK_PORT(p) (ports[p / INT_BIT] & (1 << (p % INT_BIT)))
 
+struct addr {
+   struct sockaddr_storage address;
+   struct addr *next;
+};
+
 struct sock {
void *socket;
void *pcb;
@@ -92,8 +98,8 @@ struct sock {
int family;
int proto;
const char *protoname;
-   struct sockaddr_storage laddr;
-   struct sockaddr_storage faddr;
+   struct addr *laddr;
+   struct addr *faddr;
struct sock *next;
 };
 
@@ -249,6 +255,241 @@ sockaddr(struct sockaddr_storage *sa, in
 }
 
 static void
+gather_sctp(void)
+{
+   struct sock *sock;
+   struct addr *laddr, *prev_laddr, *faddr, *prev_faddr;
+   struct xsctp_inpcb *xinpcb;
+   struct xsctp_tcb *xstcb;
+   struct xsctp_raddr *xraddr;
+   struct xsctp_laddr *xladdr;
+   const char *varname;
+   size_t len, offset;
+   char *buf;
+   int hash, vflag;
+   int no_stcb, local_all_loopback, foreign_all_loopback;
+
+   vflag = 0;
+   if (opt_4)
+   vflag |= INP_IPV4;
+   if (opt_6)
+   vflag |= INP_IPV6;
+
+   varname = "net.inet.sctp.assoclist";
+   if (sysctlbyname(varname, 0, &len, 0, 0) < 0) {
+   if (errno != ENOENT)
+   err(1, "sysctlbyname()");
+   return;
+   }
+   if ((buf = (char *)malloc(len)) == NULL) {
+   err(1, "malloc()");
+   return;
+   }
+   if (sysctlbyname(varname, buf, &len, 0, 0) < 0) {
+   err(1, "sysctlbyname()");
+   free(buf);
+   return;
+   }
+   xinpcb = (struct xsctp_inpcb *)(void *)buf;
+   offset = sizeof(struct xsctp_inpcb);
+   while ((offset < len) && (xinpcb->last == 0)) {
+   if ((sock = calloc(1, sizeof *sock)) == NULL)
+   err(1, "malloc()");
+   sock->socket = xinpcb->socket;
+   sock->proto = IPPROTO_SCTP;
+   sock->protoname = "sctp";
+   if (xinpcb->flags & SCTP_PCB_FLAGS_BOUND_V6) {
+   sock->family = AF_INET6;
+   sock->vflag = INP_IPV6;
+   } else {
+   sock->family = AF_INET;
+   sock->vflag = INP_IPV4;
+ 

svn commit: r284440 - stable/10/sys/netinet

2015-06-16 Thread Michael Tuexen
Author: tuexen
Date: Tue Jun 16 08:26:33 2015
New Revision: 284440
URL: https://svnweb.freebsd.org/changeset/base/284440

Log:
  MFC r284332:
  
  Fix the reporting of the PMTUD state for specific paths.

Modified:
  stable/10/sys/netinet/sctp_usrreq.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_usrreq.c
==
--- stable/10/sys/netinet/sctp_usrreq.c Tue Jun 16 08:24:08 2015
(r284439)
+++ stable/10/sys/netinet/sctp_usrreq.c Tue Jun 16 08:26:33 2015
(r284440)
@@ -2464,9 +2464,9 @@ flags_out:
}
/* get flags for PMTU */
if (net->dest_state & 
SCTP_ADDR_NO_PMTUD) {
-   paddrp->spp_flags |= 
SPP_PMTUD_ENABLE;
-   } else {
paddrp->spp_flags |= 
SPP_PMTUD_DISABLE;
+   } else {
+   paddrp->spp_flags |= 
SPP_PMTUD_ENABLE;
}
if (net->dscp & 0x01) {
paddrp->spp_dscp = net->dscp & 
0xfc;
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"


svn commit: r284439 - stable/10/sys/netinet

2015-06-16 Thread Michael Tuexen
Author: tuexen
Date: Tue Jun 16 08:24:08 2015
New Revision: 284439
URL: https://svnweb.freebsd.org/changeset/base/284439

Log:
  MFC r284331:
  
  Code cleanup.

Modified:
  stable/10/sys/netinet/sctp_output.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_output.c
==
--- stable/10/sys/netinet/sctp_output.c Tue Jun 16 08:21:58 2015
(r284438)
+++ stable/10/sys/netinet/sctp_output.c Tue Jun 16 08:24:08 2015
(r284439)
@@ -8125,6 +8125,12 @@ again_one_more_time:
 * it is used to do appropriate
 * source address selection.
 */
+   if (*now_filled == 0) {
+   (void)SCTP_GETTIME_TIMEVAL(now);
+   *now_filled = 1;
+   }
+   net->last_sent_time = *now;
+   hbflag = 0;
if ((error = 
sctp_lowlevel_chunk_output(inp, stcb, net,
(struct sockaddr *)&net->ro._l_addr,
outchain, auth_offset, auth,
@@ -8135,21 +8141,18 @@ again_one_more_time:
net->port, NULL,
0, 0,
so_locked))) {
-   if (error == ENOBUFS) {
-   asoc->ifp_had_enobuf = 
1;
-   
SCTP_STAT_INCR(sctps_lowlevelerr);
-   }
+   /*
+* error, we could not
+* output
+*/
+   SCTPDBG(SCTP_DEBUG_OUTPUT3, 
"Gak send error %d\n", error);
if (from_where == 0) {

SCTP_STAT_INCR(sctps_lowlevelerrusr);
}
-   if (*now_filled == 0) {
-   
(void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
-   *now_filled = 1;
-   *now = 
net->last_sent_time;
-   } else {
-   net->last_sent_time = 
*now;
+   if (error == ENOBUFS) {
+   asoc->ifp_had_enobuf = 
1;
+   
SCTP_STAT_INCR(sctps_lowlevelerr);
}
-   hbflag = 0;
/* error, could not output */
if (error == EHOSTUNREACH) {
/*
@@ -8161,16 +8164,9 @@ again_one_more_time:
}
*reason_code = 7;
break;
-   } else
-   asoc->ifp_had_enobuf = 0;
-   if (*now_filled == 0) {
-   
(void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time);
-   *now_filled = 1;
-   *now = net->last_sent_time;
} else {
-   net->last_sent_time = *now;
+   asoc->ifp_had_enobuf = 0;
}
-   hbflag = 0;
/*
 * increase the number we sent, if a
 * cookie is sent we don't tell them
@@ -8403,6 +8399,15 @@ again_one_more_time:

sctp_timer_start(SCTP_TIMER_TYPE_COOKIE, inp, stcb, net);
cookie = 0;
}
+   /* Only HB or ASCONF advances time */
+

svn commit: r284438 - stable/10/sys/netinet

2015-06-16 Thread Michael Tuexen
Author: tuexen
Date: Tue Jun 16 08:21:58 2015
New Revision: 284438
URL: https://svnweb.freebsd.org/changeset/base/284438

Log:
  MFC r284326:
  
  In case of an output error, continue with the next net, don't try to
  continue sending on the same net.
  
  This fixes a bug where an invalid mbuf chain was constructed, if a
  full size frame of control chunks should be sent and there is a
  output error.
  
  Based on a discussion with rrs@, change move to the next net. This fixes
  the bug and improves the behaviour.
  
  Thanks to Irene Ruengeler for spending a lot of time in narrowing this
  problem down.

Modified:
  stable/10/sys/netinet/sctp_output.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/netinet/sctp_output.c
==
--- stable/10/sys/netinet/sctp_output.c Tue Jun 16 03:03:26 2015
(r284437)
+++ stable/10/sys/netinet/sctp_output.c Tue Jun 16 08:21:58 2015
(r284438)
@@ -8001,6 +8001,7 @@ again_one_more_time:
} else {
r_mtu = mtu;
}
+   error = 0;
//
/* ASCONF transmission */
//
@@ -8159,7 +8160,7 @@ again_one_more_time:

sctp_move_chunks_from_net(stcb, net);
}
*reason_code = 7;
-   continue;
+   break;
} else
asoc->ifp_had_enobuf = 0;
if (*now_filled == 0) {
@@ -8202,6 +8203,10 @@ again_one_more_time:
}
}
}
+   if (error != 0) {
+   /* try next net */
+   continue;
+   }
//
/* Control transmission */
//
@@ -8436,7 +8441,7 @@ again_one_more_time:

sctp_move_chunks_from_net(stcb, net);
}
*reason_code = 7;
-   continue;
+   break;
} else
asoc->ifp_had_enobuf = 0;
/* Only HB or ASCONF advances time */
@@ -8482,6 +8487,10 @@ again_one_more_time:
}
}
}
+   if (error != 0) {
+   /* try next net */
+   continue;
+   }
/* JRI: if dest is in PF state, do not send data to it */
if ((asoc->sctp_cmt_on_off > 0) &&
(net != stcb->asoc.alternate) &&
___
svn-src-stable-10@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-stable-10
To unsubscribe, send any mail to "svn-src-stable-10-unsubscr...@freebsd.org"