svn commit: r267635 - head/share/misc

2014-06-18 Thread Bartek Rutkowski
Author: robak (ports committer)
Date: Thu Jun 19 06:31:27 2014
New Revision: 267635
URL: http://svnweb.freebsd.org/changeset/base/267635

Log:
  Add Bartek Rutkowski (myself) to committers-ports.dot file with swills and 
marino as mentors.
  
  Approved by:  swills (mentor)

Modified:
  head/share/misc/committers-ports.dot

Modified: head/share/misc/committers-ports.dot
==
--- head/share/misc/committers-ports.dotThu Jun 19 05:45:17 2014
(r267634)
+++ head/share/misc/committers-ports.dotThu Jun 19 06:31:27 2014
(r267635)
@@ -183,6 +183,7 @@ rene [label="Rene Ladan\nr...@freebsd.or
 riggs [label="Thomas Zander\nri...@freebsd.org\n2014/01/09"]
 rm [label="Ruslan Makhmatkhanov\n...@freebsd.org\n2011/11/06"]
 rnoland [label="Robert Noland\nrnol...@freebsd.org\n2008/07/21"]
+robak [label="Bartek Rutkowski\ro...@freebsd.org\n2014/06/10"]
 rodrigo [label="Rodrigo Osorio\nrodr...@freebsd.org\n2014/01/15"]
 romain [label="Romain Tartiere\nrom...@freebsd.org\n2010/01/24"]
 sahil [label="Sahil Tandon\nsa...@freebsd.org\n2010/04/11"]
@@ -416,6 +417,8 @@ marcus -> bland
 marcus -> eik
 marcus -> jmallett
 
+marino -> robak
+
 makc -> bf
 makc -> jhale
 makc -> rakuco
@@ -524,6 +527,7 @@ steve -> netchild
 swills -> feld
 swills -> milki
 swills -> pclin
+swills -> robak
 swills -> xmj
 
 tabthorpe -> ashish
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267634 - head/sys/contrib/ipfilter/netinet

2014-06-18 Thread Cy Schubert
Author: cy
Date: Thu Jun 19 05:45:17 2014
New Revision: 267634
URL: http://svnweb.freebsd.org/changeset/base/267634

Log:
  Fix case where fastroute or "to interface" is used with incorrect FIB.
  
  PR:   183065
  Submitted by: p-freebsd-b...@ziemba.us
  Approved by:  glebius
  MFC after:1 week

Modified:
  head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c

Modified: head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c
==
--- head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c  Thu Jun 19 05:28:42 
2014(r267633)
+++ head/sys/contrib/ipfilter/netinet/ip_fil_freebsd.c  Thu Jun 19 05:45:17 
2014(r267634)
@@ -787,7 +787,7 @@ ipf_fastroute(m0, mpp, fin, fdp)
dst->sin_addr = fdp->fd_ip;
 
dst->sin_len = sizeof(*dst);
-   in_rtalloc(ro, 0);
+   in_rtalloc(ro, M_GETFIB(m0));
 
if ((ifp == NULL) && (ro->ro_rt != NULL))
ifp = ro->ro_rt->rt_ifp;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267633 - head/sys/sys

2014-06-18 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun 19 05:28:42 2014
New Revision: 267633
URL: http://svnweb.freebsd.org/changeset/base/267633

Log:
  Initialize sysctl OID structure by record.
  
  MFC after:2 weeks

Modified:
  head/sys/sys/sysctl.h

Modified: head/sys/sys/sysctl.h
==
--- head/sys/sys/sysctl.h   Thu Jun 19 05:10:03 2014(r267632)
+++ head/sys/sys/sysctl.h   Thu Jun 19 05:28:42 2014(r267633)
@@ -278,19 +278,16 @@ SYSCTL_ALLOWED_TYPES(UINT64, uint64_t *a
 /* This constructs a "raw" MIB oid. */
 #defineSYSCTL_OID(parent, nbr, name, kind, a1, a2, handler, fmt, 
descr)\
static struct sysctl_oid sysctl__##parent##_##name = {  \
-   &sysctl_##parent##_children,\
-   { NULL },   \
-   nbr,\
-   kind,   \
-   a1, \
-   a2, \
-   #name,  \
-   handler,\
-   fmt,\
-   0,  \
-   0,  \
-   __DESCR(descr)  \
-   };  \
+   .oid_parent = &sysctl_##parent##_children,  \
+   .oid_number = (nbr),\
+   .oid_kind = (kind), \
+   .oid_arg1 = (a1),   \
+   .oid_arg2 = (a2),   \
+   .oid_name = #name,  \
+   .oid_handler = (handler),   \
+   .oid_fmt = (fmt),   \
+   .oid_descr = __DESCR(descr) \
+   };  \
DATA_SET(sysctl_set, sysctl__##parent##_##name)
 
 #defineSYSCTL_ADD_OID(ctx, parent, nbr, name, kind, a1, a2, handler, 
fmt, descr) \
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267632 - head/sys/dev/vmware/vmxnet3

2014-06-18 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun 19 05:10:03 2014
New Revision: 267632
URL: http://svnweb.freebsd.org/changeset/base/267632

Log:
  Fix GCC compile warning: Variable(s) can be used uninitialized.

Modified:
  head/sys/dev/vmware/vmxnet3/if_vmx.c

Modified: head/sys/dev/vmware/vmxnet3/if_vmx.c
==
--- head/sys/dev/vmware/vmxnet3/if_vmx.cThu Jun 19 05:06:24 2014
(r267631)
+++ head/sys/dev/vmware/vmxnet3/if_vmx.cThu Jun 19 05:10:03 2014
(r267632)
@@ -2607,10 +2607,12 @@ vmxnet3_txq_offload_ctx(struct vmxnet3_t
struct ether_vlan_header *evh;
int offset;
 #if defined(INET)
-   struct ip *ip, iphdr;
+   struct ip *ip = NULL;
+   struct ip iphdr;
 #endif
 #if defined(INET6)
-   struct ip6_hdr *ip6, ip6hdr;
+   struct ip6_hdr *ip6 = NULL;
+   struct ip6_hdr ip6hdr;
 #endif
 
evh = mtod(m, struct ether_vlan_header *);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267631 - head/sys/x86/xen

2014-06-18 Thread Hans Petter Selasky
Author: hselasky
Date: Thu Jun 19 05:06:24 2014
New Revision: 267631
URL: http://svnweb.freebsd.org/changeset/base/267631

Log:
  Fix compile warning: Remove duplicate external declaration.

Modified:
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/x86/xen/xen_apic.c
==
--- head/sys/x86/xen/xen_apic.c Thu Jun 19 05:00:39 2014(r267630)
+++ head/sys/x86/xen/xen_apic.c Thu Jun 19 05:06:24 2014(r267631)
@@ -84,8 +84,6 @@ extern void pmap_lazyfix_action(void);
 extern int pmap_pcid_enabled;
 #endif
 
-extern int xen_vector_callback_enabled;
-
 /*-- Macros 
--*/
 #defineIPI_TO_IDX(ipi) ((ipi) - APIC_IPI_INTS)
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267630 - in head: lib/libc/sys sys/sys sys/vm

2014-06-18 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 19 05:00:39 2014
New Revision: 267630
URL: http://svnweb.freebsd.org/changeset/base/267630

Log:
  Add MAP_EXCL flag for mmap(2).  It should be combined with MAP_FIXED,
  and prevents the request from deleting existing mappings in the
  region, failing instead.
  
  Reviewed by:  alc
  Discussed with:   jhb
  Tested by:markj, pho (previous version, as part of the bigger patch)
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libc/sys/mmap.2
  head/sys/sys/mman.h
  head/sys/vm/vm_map.c
  head/sys/vm/vm_map.h
  head/sys/vm/vm_mmap.c

Modified: head/lib/libc/sys/mmap.2
==
--- head/lib/libc/sys/mmap.2Thu Jun 19 04:55:00 2014(r267629)
+++ head/lib/libc/sys/mmap.2Thu Jun 19 05:00:39 2014(r267630)
@@ -28,7 +28,7 @@
 .\"@(#)mmap.2  8.4 (Berkeley) 5/11/95
 .\" $FreeBSD$
 .\"
-.Dd September 9, 2013
+.Dd June 19, 2014
 .Dt MMAP 2
 .Os
 .Sh NAME
@@ -141,6 +141,12 @@ argument must be 0.
 This flag is identical to
 .Dv MAP_ANON
 and is provided for compatibility.
+.It Dv MAP_EXCL
+This flag can only be used in combination with
+.Dv MAP_FIXED .
+Please see the definition of
+.Dv MAP_FIXED
+for the description of its effect.
 .It Dv MAP_FIXED
 Do not permit the system to select a different address than the one
 specified.
@@ -152,17 +158,21 @@ If
 is specified,
 .Fa addr
 must be a multiple of the pagesize.
-If a
+If
+.Dv MAP_EXCL
+is not specified, a successfull
 .Dv MAP_FIXED
-request is successful, the mapping established by
-.Fn mmap
-replaces any previous mappings for the process' pages in the range from
+request replaces any previous mappings for the process'
+pages in the range from
 .Fa addr
 to
 .Fa addr
 +
 .Fa len .
-Use of this option is discouraged.
+In contrast, if
+.Dv MAP_EXCL
+is specified, the request will fail if a mapping
+already exists within the range.
 .It Dv MAP_HASSEMAPHORE
 Notify the kernel that the region may contain semaphores and that special
 handling may be necessary.
@@ -393,6 +403,17 @@ argument was not -1.
 was specified and the
 .Fa offset
 argument was not 0.
+.It Bq Er EINVAL
+Both
+.Dv MAP_FIXED
+and
+.Dv MAP_EXCL
+were specified, but the requested region is already used by a mapping.
+.It Bq Er EINVAL
+.Dv MAP_EXCL
+was specified, but
+.Dv MAP_FIXED
+was not.
 .It Bq Er ENODEV
 .Dv MAP_ANON
 has not been specified and

Modified: head/sys/sys/mman.h
==
--- head/sys/sys/mman.h Thu Jun 19 04:55:00 2014(r267629)
+++ head/sys/sys/mman.h Thu Jun 19 05:00:39 2014(r267630)
@@ -89,6 +89,7 @@
 /*
  * Extended flags
  */
+#defineMAP_EXCL 0x4000 /* for MAP_FIXED, fail if address 
is used */
 #defineMAP_NOCORE   0x0002 /* dont include these pages in a 
coredump */
 #defineMAP_PREFAULT_READ 0x0004 /* prefault mapping for reading */
 #ifdef __LP64__

Modified: head/sys/vm/vm_map.c
==
--- head/sys/vm/vm_map.cThu Jun 19 04:55:00 2014(r267629)
+++ head/sys/vm/vm_map.cThu Jun 19 05:00:39 2014(r267630)
@@ -1393,7 +1393,8 @@ vm_map_fixed(vm_map_t map, vm_object_t o
("vm_map_fixed: non-NULL backing object for stack"));
vm_map_lock(map);
VM_MAP_RANGE_CHECK(map, start, end);
-   (void) vm_map_delete(map, start, end);
+   if ((cow & MAP_CHECK_EXCL) == 0)
+   vm_map_delete(map, start, end);
if ((cow & (MAP_STACK_GROWS_DOWN | MAP_STACK_GROWS_UP)) != 0) {
result = vm_map_stack_locked(map, start, length, sgrowsiz,
prot, max, cow);

Modified: head/sys/vm/vm_map.h
==
--- head/sys/vm/vm_map.hThu Jun 19 04:55:00 2014(r267629)
+++ head/sys/vm/vm_map.hThu Jun 19 05:00:39 2014(r267630)
@@ -315,6 +315,7 @@ long vmspace_resident_count(struct vmspa
 #define MAP_PREFAULT   0x0008
 #define MAP_PREFAULT_PARTIAL   0x0010
 #define MAP_DISABLE_SYNCER 0x0020
+#defineMAP_CHECK_EXCL  0x0040
 #define MAP_DISABLE_COREDUMP   0x0100
 #define MAP_PREFAULT_MADVISE   0x0200  /* from (user) madvise request */
 #defineMAP_VN_WRITECOUNT   0x0400

Modified: head/sys/vm/vm_mmap.c
==
--- head/sys/vm/vm_mmap.c   Thu Jun 19 04:55:00 2014(r267629)
+++ head/sys/vm/vm_mmap.c   Thu Jun 19 05:00:39 2014(r267630)
@@ -245,6 +245,8 @@ sys_mmap(td, uap)
flags |= MAP_ANON;
pos = 0;
}
+   if ((flags & (MAP_EXCL | MAP_FIXED)) == MAP_EXCL)
+   return (EINVAL);
 
/*
 * Align the file position to a page boundary,
@@ -1626,6 +1628,8 @@ vm

svn commit: r267629 - head/lib/libc/sys

2014-06-18 Thread Konstantin Belousov
Author: kib
Date: Thu Jun 19 04:55:00 2014
New Revision: 267629
URL: http://svnweb.freebsd.org/changeset/base/267629

Log:
  The time come to remove the wrapper, most likely, but tidy up it code
  instead for now.  Remove spurious blank line, use C89 definition, wrap
  long line.
  
  Sponsored by: The FreeBSD Foundation
  MFC after:1 week

Modified:
  head/lib/libc/sys/mmap.c

Modified: head/lib/libc/sys/mmap.c
==
--- head/lib/libc/sys/mmap.cThu Jun 19 03:59:52 2014(r267628)
+++ head/lib/libc/sys/mmap.cThu Jun 19 04:55:00 2014(r267629)
@@ -44,18 +44,13 @@ __FBSDID("$FreeBSD$");
  * is not supplied by GCC 1.X but is supplied by GCC 2.X.
  */
 void *
-mmap(addr, len, prot, flags, fd, offset)
-   void *  addr;
-   size_t  len;
-   int prot;
-   int flags;
-   int fd;
-   off_t   offset;
+mmap(void *addr, size_t len, int prot, int flags, int fd, off_t offset)
 {
 
-   if (__getosreldate() >= 700051)
+   if (__getosreldate() >= 700051) {
return (__sys_mmap(addr, len, prot, flags, fd, offset));
-   else
-
-   return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0, 
offset));
+   } else {
+   return (__sys_freebsd6_mmap(addr, len, prot, flags, fd, 0,
+   offset));
+   }
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267628 - in stable/9/release/doc: en_US.ISO8859-1/relnotes share/xml

2014-06-18 Thread Glen Barber
Author: gjb
Date: Thu Jun 19 03:59:52 2014
New Revision: 267628
URL: http://svnweb.freebsd.org/changeset/base/267628

Log:
  MFC r265590, r265594, r265595, r265599 [1], r265601 [1],
  r265602 [1], r265603 [1], r265605 [1], r265607 [1],
  r267554 [1], r267595:
  
  r265590:
Modify release.xsl to allow proper attribution for
sponsored and/or contributed works.
  
  r265594:
Add two new entity files in followup to r265590,
sponsor.ent and vendor.ent, which will be used for
sponsor/vendor names and URLs.
  
  r265595:
Add references to sponsor.ent and vendor.ent in
relnotes/article.xml and share/xml/catalog.xml.
  
  r265599:
Add DARPA, AFRL to sponsor.ent.
  
  r265601:
Add LSI and Spectra Logic to sponsor.ent.
  
  r265602:
Add Netgate to sponsor.ent.
  
  r265603:
Add a note to keep the entity lists sorted alphabetically.
  
  r265605:
Add Google to the sponsor.ent file.
  
  r265607:
Separate &darpa; entity and create &darpa_afrl to
avoid confusion.
  
  r267554:
Add &citrix; and &citrix.rd; macros.
  
  r267595:
Remove 'Inc.' for consistency.
  
  [1] - Partial, entity addition only.
  
  Approved by:  re (hrs)
  Sponsored by: The FreeBSD Foundation

Added:
  stable/9/release/doc/share/xml/sponsor.ent
 - copied, changed from r265594, head/release/doc/share/xml/sponsor.ent
  stable/9/release/doc/share/xml/vendor.ent
 - copied, changed from r265594, head/release/doc/share/xml/vendor.ent
Modified:
  stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml
  stable/9/release/doc/share/xml/catalog.xml
  stable/9/release/doc/share/xml/release.xsl
Directory Properties:
  stable/9/release/   (props changed)
  stable/9/release/doc/   (props changed)

Modified: stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml
==
--- stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml   Wed Jun 18 
23:34:48 2014(r267627)
+++ stable/9/release/doc/en_US.ISO8859-1/relnotes/article.xml   Thu Jun 19 
03:59:52 2014(r267628)
@@ -3,6 +3,10 @@
"../../../share/xml/freebsd50.dtd" [
 
%release;
+
+ %sponsor;
+
+ %vendor;
 ]>
 http://docbook.org/ns/docbook"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; version="5.0">
   

Modified: stable/9/release/doc/share/xml/catalog.xml
==
--- stable/9/release/doc/share/xml/catalog.xml  Wed Jun 18 23:34:48 2014
(r267627)
+++ stable/9/release/doc/share/xml/catalog.xml  Thu Jun 19 03:59:52 2014
(r267628)
@@ -7,5 +7,7 @@
   rewritePrefix="../../"/>
 
   
+  
+  
   
 

Modified: stable/9/release/doc/share/xml/release.xsl
==
--- stable/9/release/doc/share/xml/release.xsl  Wed Jun 18 23:34:48 2014
(r267627)
+++ stable/9/release/doc/share/xml/release.xsl  Thu Jun 19 03:59:52 2014
(r267628)
@@ -43,6 +43,51 @@

  

+   
+ 
+   
+ 
+   
+   
+ 
+   
+ (Sponsored by
+ 
+   
+ 
+   
+ 
+   
+   
+ 
+   
+   
+ 
+   
+ 
+   
+ 
+ 
+   
+ (Contributed / provided by
+ 
+   
+ 
+   
+ 
+   
+   
+ 
+   
+   
+ 
+   
+ 
+   
+ 
+   
+ 
+   

  
 

Copied and modified: stable/9/release/doc/share/xml/sponsor.ent (from r265594, 
head/release/doc/share/xml/sponsor.ent)
==
--- head/release/doc/share/xml/sponsor.ent  Wed May  7 19:43:23 2014
(r265594, copy source)
+++ stable/9/release/doc/share/xml/sponsor.ent  Thu Jun 19 03:59:52 2014
(r267628)
@@ -4,7 +4,25 @@
 
  Sponsors of various works.
 
+ Please keep the entity list sorted alphabetically.
+
 -->
 
+
+
+
+
+
+
+
+
 
 https://www.FreeBSDFoundation.org/";>
+
+
+
+
+
+
+
+

Copied and modified: stable/9/release/doc/share/xml/vendor.ent (from r265594, 
head/release/doc/share/xml/vendor.ent)
==
--- head/release/doc/share/xml/vendor.ent   Wed May  7 19:43:23 2014
(r265594, copy source)
+++ stable/9/release/doc/share/xml/vendor.ent   Thu Jun 19 03:59:52 2014
(r267628)
@@ -4,4 +4,6 @@
 
  Vendo

svn commit: r267627 - head/lib/libc/stdtime

2014-06-18 Thread Pedro F. Giffuni
Author: pfg
Date: Wed Jun 18 23:34:48 2014
New Revision: 267627
URL: http://svnweb.freebsd.org/changeset/base/267627

Log:
  strptime: add support for %t and %n
  
  Posix strptime() requires support for %t and %n, which were added
  to the illumos port.  Curiously we were skipping white spaces by
  default in most other cases making %t meaningless.
  
  We now skip spaces in the case of the %e specifier as strftime(3)
  explicitly adds a space for the single digit case.
  
  Reference:
  http://pubs.opengroup.org/onlinepubs/009695399/functions/strptime.html
  
  Obtained from:Illumos (Rev. a11c1571b6942161b0186d0588609448066892c2)
  MFC after:3 weeks

Modified:
  head/lib/libc/stdtime/strptime.c

Modified: head/lib/libc/stdtime/strptime.c
==
--- head/lib/libc/stdtime/strptime.cWed Jun 18 22:30:22 2014
(r267626)
+++ head/lib/libc/stdtime/strptime.cWed Jun 18 23:34:48 2014
(r267627)
@@ -1,4 +1,6 @@
 /*-
+ * Copyright (c) 2014 Gary Mills
+ * Copyright 2011, Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1994 Powerdog Industries.  All rights reserved.
  *
  * Copyright (c) 2011 The FreeBSD Foundation
@@ -224,11 +226,6 @@ label:
tm->tm_sec = i;
}
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
case 'H':
@@ -261,11 +258,6 @@ label:
 
tm->tm_hour = i;
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
case 'p':
@@ -335,11 +327,6 @@ label:
if (i > 53)
return (NULL);
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
case 'w':
@@ -352,18 +339,22 @@ label:
 
tm->tm_wday = i;
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
-   case 'd':
case 'e':
/*
-* The %e specifier is explicitly documented as not
-* being zero-padded but there is no harm in allowing
+* With %e format, our strftime(3) adds a blank space
+* before single digits.
+*/
+   if (*buf != 0 &&
+   isspace_l((unsigned char)*buf, locale))
+  buf++;
+   /* FALLTHROUGH */
+   case 'd':
+   /*
+* The %e specifier was once explicitly documented as
+* not being zero-padded but was later changed to
+* equivalent to %d.  There is no harm in allowing
 * such padding.
 *
 * XXX The %e specifier may gobble one too many
@@ -384,11 +375,6 @@ label:
 
tm->tm_mday = i;
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
case 'B':
@@ -445,11 +431,6 @@ label:
 
tm->tm_mon = i - 1;
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-   while (*ptr != 0 &&
-  !isspace_l((unsigned char)*ptr, locale))
-   ptr++;
break;
 
case 's':
@@ -498,11 +479,6 @@ label:
 
tm->tm_year = i;
 
-   if (*buf != 0 &&
-   isspace_l((unsigned char)*buf, locale))
-

svn commit: r267626 - head/sys/dev/vt

2014-06-18 Thread Aleksandr Rybalko
Author: ray
Date: Wed Jun 18 22:30:22 2014
New Revision: 267626
URL: http://svnweb.freebsd.org/changeset/base/267626

Log:
  Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt_consolectl.c
  head/sys/dev/vt/vt_core.c
  head/sys/dev/vt/vt_sysmouse.c

Modified: head/sys/dev/vt/vt_consolectl.c
==
--- head/sys/dev/vt/vt_consolectl.c Wed Jun 18 22:23:10 2014
(r267625)
+++ head/sys/dev/vt/vt_consolectl.c Wed Jun 18 22:30:22 2014
(r267626)
@@ -73,6 +73,8 @@ static void
 consolectl_drvinit(void *unused)
 {
 
+   if (getenv("kern.vt.disable"))
+   return;
make_dev(&consolectl_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
"consolectl");
 }

Modified: head/sys/dev/vt/vt_core.c
==
--- head/sys/dev/vt/vt_core.c   Wed Jun 18 22:23:10 2014(r267625)
+++ head/sys/dev/vt/vt_core.c   Wed Jun 18 22:30:22 2014(r267626)
@@ -215,6 +215,8 @@ static void
 vt_update_static(void *dummy)
 {
 
+   if (getenv("kern.vt.disable"))
+   return;
if (main_vd->vd_driver != NULL)
printf("VT: running with driver \"%s\".\n",
main_vd->vd_driver->vd_name);
@@ -957,6 +959,9 @@ vtterm_cnprobe(struct terminal *tm, stru
struct vt_device *vd = vw->vw_device;
struct winsize wsz;
 
+   if (getenv("kern.vt.disable"))
+   return;
+
if (vd->vd_flags & VDF_INITIALIZED)
/* Initialization already done. */
return;
@@ -1991,6 +1996,9 @@ vt_upgrade(struct vt_device *vd)
struct vt_window *vw;
unsigned int i;
 
+   if (getenv("kern.vt.disable"))
+   return;
+
for (i = 0; i < VT_MAXWINDOWS; i++) {
vw = vd->vd_windows[i];
if (vw == NULL) {
@@ -2056,6 +2064,9 @@ vt_allocate(struct vt_driver *drv, void 
struct vt_device *vd;
struct winsize wsz;
 
+   if (getenv("kern.vt.disable"))
+   return;
+
if (main_vd->vd_driver == NULL) {
main_vd->vd_driver = drv;
printf("VT: initialize with new VT driver \"%s\".\n",

Modified: head/sys/dev/vt/vt_sysmouse.c
==
--- head/sys/dev/vt/vt_sysmouse.c   Wed Jun 18 22:23:10 2014
(r267625)
+++ head/sys/dev/vt/vt_sysmouse.c   Wed Jun 18 22:30:22 2014
(r267626)
@@ -405,6 +405,8 @@ static void
 sysmouse_drvinit(void *unused)
 {
 
+   if (getenv("kern.vt.disable"))
+   return;
mtx_init(&sysmouse_lock, "sysmouse", NULL, MTX_DEF);
cv_init(&sysmouse_sleep, "sysmrd");
make_dev(&sysmouse_cdevsw, 0, UID_ROOT, GID_WHEEL, 0600,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267625 - head/sys/dev/syscons

2014-06-18 Thread Aleksandr Rybalko
Author: ray
Date: Wed Jun 18 22:23:10 2014
New Revision: 267625
URL: http://svnweb.freebsd.org/changeset/base/267625

Log:
  Allow to disable syscons(4) if "hw.syscons.disable" kenv is set.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/syscons/syscons.c
  head/sys/dev/syscons/sysmouse.c

Modified: head/sys/dev/syscons/syscons.c
==
--- head/sys/dev/syscons/syscons.c  Wed Jun 18 22:18:58 2014
(r267624)
+++ head/sys/dev/syscons/syscons.c  Wed Jun 18 22:23:10 2014
(r267625)
@@ -1589,6 +1589,11 @@ sc_cnprobe(struct consdev *cp)
 int unit;
 int flags;
 
+if (getenv("hw.syscons.disable")) {
+   cp->cn_pri = CN_DEAD;
+   return;
+}
+
 cp->cn_pri = sc_get_cons_priority(&unit, &flags);
 
 /* a video card is always required */

Modified: head/sys/dev/syscons/sysmouse.c
==
--- head/sys/dev/syscons/sysmouse.c Wed Jun 18 22:18:58 2014
(r267624)
+++ head/sys/dev/syscons/sysmouse.c Wed Jun 18 22:23:10 2014
(r267625)
@@ -165,6 +165,8 @@ static struct ttydevsw smdev_ttydevsw = 
 static void
 sm_attach_mouse(void *unused)
 {
+   if (getenv("hw.syscons.disable"))
+   return;
sysmouse_tty = tty_alloc(&smdev_ttydevsw, NULL);
tty_makedev(sysmouse_tty, NULL, "sysmouse");
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267624 - head/sys/dev/vt

2014-06-18 Thread Aleksandr Rybalko
Author: ray
Date: Wed Jun 18 22:18:58 2014
New Revision: 267624
URL: http://svnweb.freebsd.org/changeset/base/267624

Log:
  syscons(4) and vt(4) can be built together now.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/vt/vt.h

Modified: head/sys/dev/vt/vt.h
==
--- head/sys/dev/vt/vt.hWed Jun 18 22:16:44 2014(r267623)
+++ head/sys/dev/vt/vt.hWed Jun 18 22:18:58 2014(r267624)
@@ -50,11 +50,6 @@
 #include "opt_syscons.h"
 #include "opt_splash.h"
 
-#ifdef DEV_SC
-#error "Build with both syscons and vt is not supported. Please enable only \
-one 'device sc' or 'device vt'"
-#endif
-
 #ifndefVT_MAXWINDOWS
 #ifdef MAXCONS
 #defineVT_MAXWINDOWS   MAXCONS
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267623 - head/sys/conf

2014-06-18 Thread Aleksandr Rybalko
Author: ray
Date: Wed Jun 18 22:16:44 2014
New Revision: 267623
URL: http://svnweb.freebsd.org/changeset/base/267623

Log:
  Remove stale link to deleted vt(4) xboxfb driver.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/conf/files.i386

Modified: head/sys/conf/files.i386
==
--- head/sys/conf/files.i386Wed Jun 18 22:10:10 2014(r267622)
+++ head/sys/conf/files.i386Wed Jun 18 22:16:44 2014(r267623)
@@ -279,7 +279,6 @@ dev/viawd/viawd.c   optional viawd
 dev/vmware/vmxnet3/if_vmx.coptional vmx
 dev/acpica/acpi_if.m   standard
 dev/acpi_support/acpi_wmi_if.m standard
-dev/vt/hw/xboxfb/xboxfb.c  optional vt_xboxfb
 dev/wbwd/wbwd.coptional wbwd
 dev/wpi/if_wpi.c   optional wpi
 dev/isci/isci.c
optional isci
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267622 - in head/sys: conf dev/vt/hw/vga

2014-06-18 Thread Aleksandr Rybalko
Author: ray
Date: Wed Jun 18 22:10:10 2014
New Revision: 267622
URL: http://svnweb.freebsd.org/changeset/base/267622

Log:
  Rename vt(4) vga module to dismiss interference with syscons(4) vga module.
  
  MFC after:1 week
  Sponsored by: The FreeBSD Foundation

Added:
  head/sys/dev/vt/hw/vga/vt_vga.c
 - copied, changed from r267541, head/sys/dev/vt/hw/vga/vga.c
  head/sys/dev/vt/hw/vga/vt_vga_reg.h
 - copied unchanged from r267541, head/sys/dev/vt/hw/vga/vga_reg.h
Deleted:
  head/sys/dev/vt/hw/vga/vga.c
  head/sys/dev/vt/hw/vga/vga_reg.h
Modified:
  head/sys/conf/files

Modified: head/sys/conf/files
==
--- head/sys/conf/files Wed Jun 18 22:09:33 2014(r267621)
+++ head/sys/conf/files Wed Jun 18 22:10:10 2014(r267622)
@@ -2526,7 +2526,7 @@ dev/vt/font/vt_font_default.c optional v
 dev/vt/font/vt_mouse_cursor.c  optional vt
 dev/vt/hw/efifb/efifb.coptional vt_efifb
 dev/vt/hw/fb/vt_fb.c   optional vt
-dev/vt/hw/vga/vga.coptional vt vt_vga
+dev/vt/hw/vga/vt_vga.c optional vt vt_vga
 dev/vt/logo/logo_freebsd.c optional vt splash
 dev/vt/vt_buf.coptional vt
 dev/vt/vt_consolectl.c optional vt

Copied and modified: head/sys/dev/vt/hw/vga/vt_vga.c (from r267541, 
head/sys/dev/vt/hw/vga/vga.c)
==
--- head/sys/dev/vt/hw/vga/vga.cMon Jun 16 12:37:10 2014
(r267541, copy source)
+++ head/sys/dev/vt/hw/vga/vt_vga.c Wed Jun 18 22:10:10 2014
(r267622)
@@ -38,7 +38,7 @@ __FBSDID("$FreeBSD$");
 #include 
 
 #include 
-#include 
+#include 
 
 #include 
 

Copied: head/sys/dev/vt/hw/vga/vt_vga_reg.h (from r267541, 
head/sys/dev/vt/hw/vga/vga_reg.h)
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/sys/dev/vt/hw/vga/vt_vga_reg.h Wed Jun 18 22:10:10 2014
(r267622, copy of r267541, head/sys/dev/vt/hw/vga/vga_reg.h)
@@ -0,0 +1,220 @@
+/*-
+ * Copyright (c) 2005 Marcel Moolenaar
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *notice, this list of conditions and the following disclaimer in the
+ *documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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$
+ */
+
+#ifndef _DEV_VT_HW_VGA_VGA_REG_H_
+#define_DEV_VT_HW_VGA_VGA_REG_H_
+
+/*
+ * The VGA adapter uses two I/O port blocks. One of these blocks, the CRT
+ * controller registers, can be located either at 0x3B0 or at 0x3D0 in I/O
+ * port space. This allows compatibility with the monochrome adapter, which
+ * has the CRT controller registers at 0x3B0.
+ *
+ * It is assumed that compatibility with the monochrome adapter is not of
+ * interest anymore. As such, the CRT controller can be located at 0x3D0 in
+ * I/O port space unconditionally. This means that the 2 I/O blocks are
+ * always adjacent and can therefore be treated as a single logical I/O port
+ * range. In practical terms: there only has to be a single tag and handle
+ * to access all registers.
+ *
+ * The following definitions are taken from or inspired by:
+ *   Programmer's Guide to the EGA, VGA, and Super VGA Cards -- 3rd ed.,
+ * Richard F. Ferraro, Addison-Wesley, ISBN 0-201-62490-7
+ */
+
+#defineVGA_MEM_BASE0xA
+#defineVGA_MEM_SIZE0x1
+#defineVGA_REG_BASE0x3c0
+#defineVGA_REG_SIZE0x10+0x0c
+
+/* Attribute controller registers. */
+#defineVGA_AC_WRITE0x00
+#defineVGA_AC_READ 0x01
+#defineVGA_AC_PALETTE(x)   (x) /* 0 <= x <= 15 */
+#defineVGA_AC_PAL_SR   0x20/* Secondary red */
+#defineVGA_AC_PAL_SG   0x10/* S

svn commit: r267621 - stable/10/sys/dev/usb

2014-06-18 Thread Nick Hibma
Author: n_hibma
Date: Wed Jun 18 22:09:33 2014
New Revision: 267621
URL: http://svnweb.freebsd.org/changeset/base/267621

Log:
  MFC r261270:
  
  Fix the ordering of the arguments to printf in
  uhub_child_location_string(). This produced bogus information in
  
  dev...%location
  
  output from sysctl.

Modified:
  stable/10/sys/dev/usb/usb_hub.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/usb/usb_hub.c
==
--- stable/10/sys/dev/usb/usb_hub.c Wed Jun 18 19:32:38 2014
(r267620)
+++ stable/10/sys/dev/usb/usb_hub.c Wed Jun 18 22:09:33 2014
(r267621)
@@ -1625,8 +1625,9 @@ uhub_child_location_string(device_t pare
goto done;
}
snprintf(buf, buflen, "bus=%u hubaddr=%u port=%u devaddr=%u 
interface=%u",
+   device_get_unit(res.udev->bus->bdev),
(res.udev->parent_hub != NULL) ? res.udev->parent_hub->device_index 
: 0,
-   res.portno, device_get_unit(res.udev->bus->bdev),
+   res.portno,
res.udev->device_index, res.iface_index);
 done:
mtx_unlock(&Giant);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267620 - stable/10/sys/dev/nvme

2014-06-18 Thread Jim Harris
Author: jimharris
Date: Wed Jun 18 19:32:38 2014
New Revision: 267620
URL: http://svnweb.freebsd.org/changeset/base/267620

Log:
  MFC r267342:
  
Use bitwise OR instead of logical OR when constructing value for
SET_FEATURES/NUMBER_OF_QUEUES command.
  
  Sponsored by: Intel

Modified:
  stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c
==
--- stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jun 18 19:28:55 2014
(r267619)
+++ stable/10/sys/dev/nvme/nvme_ctrlr_cmd.c Wed Jun 18 19:32:38 2014
(r267620)
@@ -205,7 +205,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvm
 {
uint32_t cdw11;
 
-   cdw11 = ((num_queues - 1) << 16) || (num_queues - 1);
+   cdw11 = ((num_queues - 1) << 16) | (num_queues - 1);
nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11,
NULL, 0, cb_fn, cb_arg);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267619 - stable/9/sys/dev/nvme

2014-06-18 Thread Jim Harris
Author: jimharris
Date: Wed Jun 18 19:28:55 2014
New Revision: 267619
URL: http://svnweb.freebsd.org/changeset/base/267619

Log:
  MFC r267342:
  
Use bitwise OR instead of logical OR when constructing value for
SET_FEATURES/NUMBER_OF_QUEUES command.
  
  Sponsored by: Intel
  Approved by:  re (gjb)

Modified:
  stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/dev/   (props changed)

Modified: stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c
==
--- stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c  Wed Jun 18 18:31:35 2014
(r267618)
+++ stable/9/sys/dev/nvme/nvme_ctrlr_cmd.c  Wed Jun 18 19:28:55 2014
(r267619)
@@ -205,7 +205,7 @@ nvme_ctrlr_cmd_set_num_queues(struct nvm
 {
uint32_t cdw11;
 
-   cdw11 = ((num_queues - 1) << 16) || (num_queues - 1);
+   cdw11 = ((num_queues - 1) << 16) | (num_queues - 1);
nvme_ctrlr_cmd_set_feature(ctrlr, NVME_FEAT_NUMBER_OF_QUEUES, cdw11,
NULL, 0, cb_fn, cb_arg);
 }
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267618 - head/lib/libc/stdtime

2014-06-18 Thread Warren Block
Author: wblock (doc committer)
Date: Wed Jun 18 18:31:35 2014
New Revision: 267618
URL: http://svnweb.freebsd.org/changeset/base/267618

Log:
  Fix syntax error.
  
  PR:   191131
  Submitted by: dan.mcgre...@usask.ca
  MFC after:1 week

Modified:
  head/lib/libc/stdtime/strftime.3

Modified: head/lib/libc/stdtime/strftime.3
==
--- head/lib/libc/stdtime/strftime.3Wed Jun 18 18:27:16 2014
(r267617)
+++ head/lib/libc/stdtime/strftime.3Wed Jun 18 18:31:35 2014
(r267618)
@@ -248,7 +248,7 @@ function
 conforms to
 .St -isoC
 with a lot of extensions including
-.Ql %C ,
+.Ql \&%C ,
 .Ql \&%D ,
 .Ql %E* ,
 .Ql %e ,
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267617 - head/sbin/geom/class/eli

2014-06-18 Thread Warren Block
Author: wblock (doc committer)
Date: Wed Jun 18 18:27:16 2014
New Revision: 267617
URL: http://svnweb.freebsd.org/changeset/base/267617

Log:
  Fix spelling, typos, missing articles, contractions.  Expanded version
  of patch supplied with PR.
  
  PR:   191001
  Submitted by: olgeni
  MFC after:1 week

Modified:
  head/sbin/geom/class/eli/geli.8

Modified: head/sbin/geom/class/eli/geli.8
==
--- head/sbin/geom/class/eli/geli.8 Wed Jun 18 18:07:19 2014
(r267616)
+++ head/sbin/geom/class/eli/geli.8 Wed Jun 18 18:27:16 2014
(r267617)
@@ -24,7 +24,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd October 1, 2013
+.Dd June 18, 2014
 .Dt GELI 8
 .Os
 .Sh NAME
@@ -331,7 +331,7 @@ key length.
 .It Nm AES-XTS
 .Em 128 ,
 256
-.It Nm AES-CBC , Nm Camilla-CBC
+.It Nm AES-CBC , Nm Camellia-CBC
 .Em 128 ,
 192,
 256
@@ -353,13 +353,14 @@ because encryption/decryption which requ
 is done per sector; fewer sectors means less computational work.
 .It Fl V Ar version
 Metadata version to use.
-This option is helpful when creating provider that may be used by older
+This option is helpful when creating a provider that may be used by older
 .Nm FreeBSD/GELI
 versions.
 Consult the
 .Sx HISTORY
 section to find which metadata version is supported by which FreeBSD version.
-Note that using older metadata version may limit numer of features available.
+Note that using an older version of metadata may limit the number of
+features available.
 .El
 .It Cm attach
 Attach the given provider.
@@ -619,7 +620,7 @@ devices.
 .El
 .It Cm resume
 Resume previously suspended device.
-The caller must ensure that executing this subcommand doesn't access the
+The caller must ensure that executing this subcommand does not access the
 suspended device, leading to a deadlock.
 For example suspending a device which contains the file system where the
 .Nm
@@ -823,7 +824,7 @@ Enter passphrase:
 .Pp
 Create an encrypted provider, but use two User Keys:
 one for your employee and one for you as the company's security officer
-(so it's not a tragedy if the employee
+(so it is not a tragedy if the employee
 .Qq accidentally
 forgets his passphrase):
 .Bd -literal -offset indent
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267616 - head/lib/libc/net

2014-06-18 Thread Hajimu UMEMOTO
Author: ume
Date: Wed Jun 18 18:07:19 2014
New Revision: 267616
URL: http://svnweb.freebsd.org/changeset/base/267616

Log:
  Retooling addrconfig() to exclude addresses on loopback interfaces
  when looking for configured addresses.
  This change is based upon the code from the submitter, and made
  following changes:
  - Exclude addresses assigned on interfaces which are down, like NetBSD
does.
  - Exclude addresses assigned on interfaces which are ifdisabled.
  
  PR:   190824
  Submitted by: Justin McOmie
  MFC after:1 week

Modified:
  head/lib/libc/net/getaddrinfo.c

Modified: head/lib/libc/net/getaddrinfo.c
==
--- head/lib/libc/net/getaddrinfo.c Wed Jun 18 17:48:30 2014
(r267615)
+++ head/lib/libc/net/getaddrinfo.c Wed Jun 18 18:07:19 2014
(r267616)
@@ -62,12 +62,15 @@ __FBSDID("$FreeBSD$");
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #ifdef INET6
 #include 
 #include 
 #include 
-#include   /* XXX */
+#include 
+#include 
 #endif
 #include 
 #include 
@@ -245,6 +248,9 @@ static int get_portmatch(const struct ad
 static int get_port(struct addrinfo *, const char *, int);
 static const struct afd *find_afd(int);
 static int addrconfig(struct addrinfo *);
+#ifdef INET6
+static int is_ifdisabled(char *);
+#endif
 static void set_source(struct ai_order *, struct policyhead *);
 static int comp_dst(const void *, const void *);
 #ifdef INET6
@@ -1525,10 +1531,11 @@ find_afd(int af)
 }
 
 /*
- * post-2553: AI_ADDRCONFIG check.  if we use getipnodeby* as backend, backend
- * will take care of it.
- * the semantics of AI_ADDRCONFIG is not defined well.  we are not sure
- * if the code is right or not.
+ * post-2553: AI_ADDRCONFIG check.  Determines which address families are
+ * configured on the local system and correlates with pai->ai_family value.
+ * If an address family is not configured on the system, it will not be
+ * queried for.  For this purpose, loopback addresses are not considered
+ * configured addresses.
  *
  * XXX PF_UNSPEC -> PF_INET6 + PF_INET mapping needs to be in sync with
  * _dns_getaddrinfo.
@@ -1536,38 +1543,64 @@ find_afd(int af)
 static int
 addrconfig(struct addrinfo *pai)
 {
-   int s, af;
+   struct ifaddrs *ifaddrs, *ifa;
+   int seen_inet = 0, seen_inet6 = 0;
 
-   /*
-* TODO:
-* Note that implementation dependent test for address
-* configuration should be done everytime called
-* (or apropriate interval),
-* because addresses will be dynamically assigned or deleted.
-*/
-   af = pai->ai_family;
-   if (af == AF_UNSPEC) {
-   if ((s = _socket(AF_INET6, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
-   af = AF_INET;
-   else {
-   _close(s);
-   if ((s = _socket(AF_INET, SOCK_DGRAM | SOCK_CLOEXEC,
-   0)) < 0)
-   af = AF_INET6;
-   else
-   _close(s);
+   if (getifaddrs(&ifaddrs) != 0)
+   return 0;
+
+   for (ifa = ifaddrs; ifa != NULL; ifa = ifa->ifa_next) {
+   if (ifa->ifa_addr == NULL || (ifa->ifa_flags & IFF_UP) == 0)
+   continue;
+   if ((ifa->ifa_flags & IFT_LOOP) != 0)
+   continue;
+   switch (ifa->ifa_addr->sa_family) {
+   case AF_INET:
+   seen_inet = 1;
+   break;
+#ifdef INET6
+   case AF_INET6:
+   if (!seen_inet6 && !is_ifdisabled(ifa->ifa_name))
+   seen_inet6 = 1;
+   break;
+#endif
}
}
-   if (af != AF_UNSPEC) {
-   if ((s = _socket(af, SOCK_DGRAM | SOCK_CLOEXEC, 0)) < 0)
-   return 0;
-   _close(s);
+   freeifaddrs(ifaddrs);
+
+   switch(pai->ai_family) {
+   case AF_INET6:
+   return seen_inet6;
+   case AF_INET:
+   return seen_inet;
+   case AF_UNSPEC:
+   if (seen_inet == seen_inet6)
+   return seen_inet;
+   pai->ai_family = seen_inet ? AF_INET : AF_INET6;
+   return 1;
}
-   pai->ai_family = af;
return 1;
 }
 
 #ifdef INET6
+static int
+is_ifdisabled(char *name)
+{
+   struct in6_ndireq nd;
+   int fd;
+
+   if ((fd = _socket(AF_INET6, SOCK_DGRAM, 0)) < 0)
+   return -1;
+   memset(&nd, 0, sizeof(nd));
+   strlcpy(nd.ifname, name, sizeof(nd.ifname));
+   if (_ioctl(fd, SIOCGIFINFO_IN6, &nd) < 0) {
+   _close(fd);
+   return -1;
+   }
+   _close(fd);
+   return ((nd.ndi.flags & ND6_IFF_IFDISABLED) != 0);
+}
+
 /* convert a string to a scope identifier. XXX: IPv6 specific */
 static int
 i

svn commit: r267615 - head/usr.bin/iscsictl

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:48:30 2014
New Revision: 267615
URL: http://svnweb.freebsd.org/changeset/base/267615

Log:
  Rename a variable; no functional changes.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/iscsictl.c

Modified: head/usr.bin/iscsictl/iscsictl.c
==
--- head/usr.bin/iscsictl/iscsictl.cWed Jun 18 17:46:34 2014
(r267614)
+++ head/usr.bin/iscsictl/iscsictl.cWed Jun 18 17:48:30 2014
(r267615)
@@ -585,7 +585,7 @@ main(int argc, char **argv)
 {
int Aflag = 0, Mflag = 0, Rflag = 0, Lflag = 0, aflag = 0, vflag = 0;
const char *conf_path = DEFAULT_CONFIG_PATH;
-   char *nickname = NULL, *discovery_host = NULL, *host = NULL,
+   char *nickname = NULL, *discovery_host = NULL, *portal = NULL,
 *target = NULL, *user = NULL, *secret = NULL;
long long session_id = -1;
char *end;
@@ -631,7 +631,7 @@ main(int argc, char **argv)
nickname = optarg;
break;
case 'p':
-   host = optarg;
+   portal = optarg;
break;
case 't':
target = optarg;
@@ -666,7 +666,7 @@ main(int argc, char **argv)
 */
if (Aflag != 0) {
if (aflag != 0) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-a and -p and mutually exclusive");
if (target != NULL)
errx(1, "-a and -t and mutually exclusive");
@@ -679,7 +679,7 @@ main(int argc, char **argv)
if (discovery_host != NULL)
errx(1, "-a and -d and mutually exclusive");
} else if (nickname != NULL) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-n and -p and mutually exclusive");
if (target != NULL)
errx(1, "-n and -t and mutually exclusive");
@@ -690,17 +690,17 @@ main(int argc, char **argv)
if (discovery_host != NULL)
errx(1, "-n and -d and mutually exclusive");
} else if (discovery_host != NULL) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-d and -p and mutually exclusive");
if (target != NULL)
errx(1, "-d and -t and mutually exclusive");
} else {
-   if (target == NULL && host == NULL)
+   if (target == NULL && portal == NULL)
errx(1, "must specify -a, -n or -t/-p");
 
-   if (target != NULL && host == NULL)
+   if (target != NULL && portal == NULL)
errx(1, "-t must always be used with -p");
-   if (host != NULL && target == NULL)
+   if (portal != NULL && target == NULL)
errx(1, "-p must always be used with -t");
}
 
@@ -723,7 +723,7 @@ main(int argc, char **argv)
if (aflag != 0)
errx(1, "-M and -a are mutually exclusive");
if (nickname != NULL) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-n and -p and mutually exclusive");
if (target != NULL)
errx(1, "-n and -t and mutually exclusive");
@@ -745,22 +745,22 @@ main(int argc, char **argv)
errx(1, "-R and -d are mutually exclusive");
 
if (aflag != 0) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-a and -p and mutually exclusive");
if (target != NULL)
errx(1, "-a and -t and mutually exclusive");
if (nickname != NULL)
errx(1, "-a and -n and mutually exclusive");
} else if (nickname != NULL) {
-   if (host != NULL)
+   if (portal != NULL)
errx(1, "-n and -p and mutually exclusive");
if (target != NULL)
errx(1, "-n and -t and mutually exclusive");
-   } else if (host != NULL) {
+   } else if (portal != NULL) {
if (target != NULL)
errx(1, "-p and -t and mutually exclusive");
} else if (target != NULL) {
-   

svn commit: r267614 - head/usr.bin/iscsictl

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:46:34 2014
New Revision: 267614
URL: http://svnweb.freebsd.org/changeset/base/267614

Log:
  Add "iscsictl -M", which allows one to change session parameters
  without removing it and adding back.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/iscsictl.8
  head/usr.bin/iscsictl/iscsictl.c

Modified: head/usr.bin/iscsictl/iscsictl.8
==
--- head/usr.bin/iscsictl/iscsictl.8Wed Jun 18 17:35:40 2014
(r267613)
+++ head/usr.bin/iscsictl/iscsictl.8Wed Jun 18 17:46:34 2014
(r267614)
@@ -27,7 +27,7 @@
 .\"
 .\" $FreeBSD$
 .\"
-.Dd April 24, 2014
+.Dd June 18, 2014
 .Dt ISCSICTL 8
 .Os
 .Sh NAME
@@ -47,6 +47,17 @@
 .Fl A
 .Fl n Ar nickname Op Fl c Ar path
 .Nm
+.Fl M
+.Fl i Ar session-id
+.Op Fl p Ar portal
+.Op Fl t Ar target
+.Op Fl u Ar user
+.Op Fl s Ar secret
+.Nm
+.Fl M
+.Fl i Ar session-id
+.Op Fl n Ar nickname Op Fl c Ar path
+.Nm
 .Fl R
 .Op Fl p Ar portal
 .Op Fl t Ar target
@@ -68,6 +79,8 @@ The following options are available:
 .Bl -tag -width ".Fl A"
 .It Fl A
 Add session.
+.It Fl M
+Modify session.
 .It Fl R
 Remove session.
 .It Fl L
@@ -84,6 +97,10 @@ Target host name or address used for Sen
 When used, it will add a temporary discovery session.
 After discovery is done, sessions will be added for each discovered target,
 and the temporary discovery sesion will be removed.
+.It Fl i
+Session ID, as displayed by
+.Nm
+.Fl v .
 .It Fl n
 The "nickname" of session defined in the configuration file.
 .It Fl p

Modified: head/usr.bin/iscsictl/iscsictl.c
==
--- head/usr.bin/iscsictl/iscsictl.cWed Jun 18 17:35:40 2014
(r267613)
+++ head/usr.bin/iscsictl/iscsictl.cWed Jun 18 17:46:34 2014
(r267614)
@@ -350,6 +350,82 @@ kernel_add(int iscsi_fd, const struct ta
 }
 
 static int
+kernel_modify(int iscsi_fd, unsigned int session_id, const struct target *targ)
+{
+   struct iscsi_session_modify ism;
+   int error;
+
+   memset(&ism, 0, sizeof(ism));
+   ism.ism_session_id = session_id;
+   conf_from_target(&ism.ism_conf, targ);
+   error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
+   if (error != 0)
+   warn("ISCSISMODIFY");
+   return (error);
+}
+
+static void
+kernel_modify_some(int iscsi_fd, unsigned int session_id, const char *target,
+  const char *target_addr, const char *user, const char *secret)
+{
+   struct iscsi_session_state *states = NULL;
+   struct iscsi_session_state *state;
+   struct iscsi_session_conf *conf;
+   struct iscsi_session_list isl;
+   struct iscsi_session_modify ism;
+   unsigned int i, nentries = 1;
+   int error;
+
+   for (;;) {
+   states = realloc(states,
+   nentries * sizeof(struct iscsi_session_state));
+   if (states == NULL)
+   err(1, "realloc");
+
+   memset(&isl, 0, sizeof(isl));
+   isl.isl_nentries = nentries;
+   isl.isl_pstates = states;
+
+   error = ioctl(iscsi_fd, ISCSISLIST, &isl);
+   if (error != 0 && errno == EMSGSIZE) {
+   nentries *= 4;
+   continue;
+   }
+   break;
+   }
+   if (error != 0)
+   errx(1, "ISCSISLIST");
+
+   for (i = 0; i < isl.isl_nentries; i++) {
+   state = &states[i];
+
+   if (state->iss_id == session_id)
+   break;
+   }
+   if (i == isl.isl_nentries)
+   errx(1, "session-id %u not found", session_id);
+
+   conf = &state->iss_conf;
+
+   if (target != NULL)
+   strlcpy(conf->isc_target, target, sizeof(conf->isc_target));
+   if (target_addr != NULL)
+   strlcpy(conf->isc_target_addr, target_addr,
+   sizeof(conf->isc_target_addr));
+   if (user != NULL)
+   strlcpy(conf->isc_user, user, sizeof(conf->isc_user));
+   if (secret != NULL)
+   strlcpy(conf->isc_secret, secret, sizeof(conf->isc_secret));
+
+   memset(&ism, 0, sizeof(ism));
+   ism.ism_session_id = session_id;
+   memcpy(&ism.ism_conf, conf, sizeof(ism.ism_conf));
+   error = ioctl(iscsi_fd, ISCSISMODIFY, &ism);
+   if (error != 0)
+   warn("ISCSISMODIFY");
+}
+
+static int
 kernel_remove(int iscsi_fd, const struct target *targ)
 {
struct iscsi_session_remove isr;
@@ -404,7 +480,7 @@ kernel_list(int iscsi_fd, const struct t
state = &states[i];
conf = &state->iss_conf;
 
-   printf("Session ID:   %d\n", state->iss_id);
+   printf("Session ID:   %u\n", state->iss_id);
printf("Initiator name:   %s\n", conf->isc_initiator);

svn commit: r267613 - in head: sys/dev/iscsi usr.sbin/iscsid

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:35:40 2014
New Revision: 267613
URL: http://svnweb.freebsd.org/changeset/base/267613

Log:
  Implement redirection handling in initiator.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/dev/iscsi/iscsi.c
  head/sys/dev/iscsi/iscsi_ioctl.h
  head/usr.sbin/iscsid/iscsid.c
  head/usr.sbin/iscsid/login.c

Modified: head/sys/dev/iscsi/iscsi.c
==
--- head/sys/dev/iscsi/iscsi.c  Wed Jun 18 17:21:38 2014(r267612)
+++ head/sys/dev/iscsi/iscsi.c  Wed Jun 18 17:35:40 2014(r267613)
@@ -1589,6 +1589,33 @@ iscsi_sanitize_session_conf(struct iscsi
isc->isc_mutual_secret[ISCSI_SECRET_LEN - 1] = '\0';
 }
 
+static bool
+iscsi_valid_session_conf(const struct iscsi_session_conf *isc)
+{
+
+   if (isc->isc_initiator[0] == '\0') {
+   ISCSI_DEBUG("empty isc_initiator");
+   return (false);
+   }
+
+   if (isc->isc_target_addr[0] == '\0') {
+   ISCSI_DEBUG("empty isc_target_addr");
+   return (false);
+   }
+
+   if (isc->isc_discovery != 0 && isc->isc_target[0] != 0) {
+   ISCSI_DEBUG("non-empty isc_target for discovery session");
+   return (false);
+   }
+
+   if (isc->isc_discovery == 0 && isc->isc_target[0] == 0) {
+   ISCSI_DEBUG("empty isc_target for non-discovery session");
+   return (false);
+   }
+
+   return (true);
+}
+
 static int
 iscsi_ioctl_session_add(struct iscsi_softc *sc, struct iscsi_session_add *isa)
 {
@@ -1597,22 +1624,12 @@ iscsi_ioctl_session_add(struct iscsi_sof
int error;
 
iscsi_sanitize_session_conf(&isa->isa_conf);
+   if (iscsi_valid_session_conf(&isa->isa_conf) == false)
+   return (EINVAL);
 
is = malloc(sizeof(*is), M_ISCSI, M_ZERO | M_WAITOK);
memcpy(&is->is_conf, &isa->isa_conf, sizeof(is->is_conf));
 
-   if (is->is_conf.isc_initiator[0] == '\0' ||
-   is->is_conf.isc_target_addr[0] == '\0') {
-   free(is, M_ISCSI);
-   return (EINVAL);
-   }
-
-   if ((is->is_conf.isc_discovery != 0 && is->is_conf.isc_target[0] != 0) 
||
-   (is->is_conf.isc_discovery == 0 && is->is_conf.isc_target[0] == 0)) 
{
-   free(is, M_ISCSI);
-   return (EINVAL);
-   }
-
sx_xlock(&sc->sc_lock);
 
/*
@@ -1769,7 +1786,38 @@ iscsi_ioctl_session_list(struct iscsi_so
 
return (0);
 }
-   
+
+static int
+iscsi_ioctl_session_modify(struct iscsi_softc *sc,
+struct iscsi_session_modify *ism)
+{
+   struct iscsi_session *is;
+
+   iscsi_sanitize_session_conf(&ism->ism_conf);
+   if (iscsi_valid_session_conf(&ism->ism_conf) == false)
+   return (EINVAL);
+
+   sx_xlock(&sc->sc_lock);
+   TAILQ_FOREACH(is, &sc->sc_sessions, is_next) {
+   ISCSI_SESSION_LOCK(is);
+   if (is->is_id == ism->ism_session_id)
+   break;
+   ISCSI_SESSION_UNLOCK(is);
+   }
+   if (is == NULL) {
+   sx_xunlock(&sc->sc_lock);
+   return (ESRCH);
+   }
+   sx_xunlock(&sc->sc_lock);
+
+   memcpy(&is->is_conf, &ism->ism_conf, sizeof(is->is_conf));
+   ISCSI_SESSION_UNLOCK(is);
+
+   iscsi_session_reconnect(is);
+
+   return (0);
+}
+
 static int
 iscsi_ioctl(struct cdev *dev, u_long cmd, caddr_t arg, int mode,
 struct thread *td)
@@ -1808,6 +1856,9 @@ iscsi_ioctl(struct cdev *dev, u_long cmd
case ISCSISLIST:
return (iscsi_ioctl_session_list(sc,
(struct iscsi_session_list *)arg));
+   case ISCSISMODIFY:
+   return (iscsi_ioctl_session_modify(sc,
+   (struct iscsi_session_modify *)arg));
default:
return (EINVAL);
}

Modified: head/sys/dev/iscsi/iscsi_ioctl.h
==
--- head/sys/dev/iscsi/iscsi_ioctl.hWed Jun 18 17:21:38 2014
(r267612)
+++ head/sys/dev/iscsi/iscsi_ioctl.hWed Jun 18 17:35:40 2014
(r267613)
@@ -202,8 +202,15 @@ struct iscsi_session_list {
int isl_spare[4];
 };
 
+struct iscsi_session_modify {
+   unsigned intism_session_id;
+   struct iscsi_session_conf   ism_conf;
+   int ism_spare[4];
+};
+
 #defineISCSISADD   _IOW('I', 0x11, struct iscsi_session_add)
 #defineISCSISREMOVE_IOW('I', 0x12, struct iscsi_session_remove)
 #defineISCSISLIST  _IOWR('I', 0x13, struct iscsi_session_list)
+#defineISCSISMODIFY_IOWR('I', 0x14, struct iscsi_session_modify)
 
 #endif /* !ISCSI_IOCTL_H */

Modified: head/usr.sbin/iscsid/iscsid.c
==
--- head/usr.sbin/iscsid/i

svn commit: r267612 - head/usr.sbin/iscsid

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:21:38 2014
New Revision: 267612
URL: http://svnweb.freebsd.org/changeset/base/267612

Log:
  Get rid of unneccessary argument.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==
--- head/usr.sbin/iscsid/login.cWed Jun 18 17:20:02 2014
(r267611)
+++ head/usr.sbin/iscsid/login.cWed Jun 18 17:21:38 2014
(r267612)
@@ -159,11 +159,12 @@ login_target_error_str(int class, int de
 }
 
 static struct pdu *
-login_receive(struct connection *conn, bool initial)
+login_receive(struct connection *conn)
 {
struct pdu *response;
struct iscsi_bhs_login_response *bhslr;
const char *errorstr;
+   static bool initial = true;
 
response = pdu_new(conn);
pdu_receive(response);
@@ -201,6 +202,8 @@ login_receive(struct connection *conn, b
}
conn->conn_statsn = ntohl(bhslr->bhslr_statsn);
 
+   initial = false;
+
return (response);
 }
 
@@ -550,7 +553,7 @@ login_negotiate(struct connection *conn)
pdu_delete(request);
request = NULL;
 
-   response = login_receive(conn, false);
+   response = login_receive(conn);
response_keys = keys_new();
keys_load(response_keys, response);
for (i = 0; i < KEYS_MAX; i++) {
@@ -742,7 +745,7 @@ login_chap(struct connection *conn)
login_send_chap_a(conn);
 
log_debugx("waiting for CHAP_A/CHAP_C/CHAP_I");
-   response = login_receive(conn, false);
+   response = login_receive(conn);
 
log_debugx("sending CHAP_N/CHAP_R");
login_send_chap_r(response);
@@ -753,7 +756,7 @@ login_chap(struct connection *conn)
 */
 
log_debugx("waiting for CHAP result");
-   response = login_receive(conn, false);
+   response = login_receive(conn);
if (conn->conn_conf.isc_mutual_user[0] != '\0')
login_verify_mutual(response);
pdu_delete(response);
@@ -831,7 +834,7 @@ login(struct connection *conn)
pdu_send(request);
pdu_delete(request);
 
-   response = login_receive(conn, true);
+   response = login_receive(conn);
 
response_keys = keys_new();
keys_load(response_keys, response);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267611 - head/usr.sbin/bhyve

2014-06-18 Thread Neel Natu
Author: neel
Date: Wed Jun 18 17:20:02 2014
New Revision: 267611
URL: http://svnweb.freebsd.org/changeset/base/267611

Log:
  Fix typo and rename macro KDB_SYS_FLAG to KBD_SYS_FLAG.
  
  Reviewed by:  tychon

Modified:
  head/usr.sbin/bhyve/atkbdc.c

Modified: head/usr.sbin/bhyve/atkbdc.c
==
--- head/usr.sbin/bhyve/atkbdc.cWed Jun 18 17:13:18 2014
(r267610)
+++ head/usr.sbin/bhyve/atkbdc.cWed Jun 18 17:20:02 2014
(r267611)
@@ -39,7 +39,7 @@ __FBSDID("$FreeBSD$");
 #defineKBD_DATA_PORT   0x60
 
 #defineKBD_STS_CTL_PORT0x64
-#define KDB_SYS_FLAG   0x4
+#define KBD_SYS_FLAG   0x4
 
 #defineKBDC_RESET  0xfe
 
@@ -66,7 +66,7 @@ atkbdc_sts_ctl_handler(struct vmctx *ctx
 
retval = INOUT_OK;
if (in) {
-   *eax = KDB_SYS_FLAG;/* system passed POST */
+   *eax = KBD_SYS_FLAG;/* system passed POST */
} else {
switch (*eax) {
case KBDC_RESET:/* Pulse "reset" line. */
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267610 - head/sys/cam/ctl

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:13:18 2014
New Revision: 267610
URL: http://svnweb.freebsd.org/changeset/base/267610

Log:
  Rework session termination in iSCSI target to actually wait
  for any outstanding commands to be properly aborted by CTL.
  Without it, in some cases (such as files backing the LUNs
  stored on failing disk drives), terminating a busy session
  would result in panic.
  
  Reviewed by:  mav@ (earlier version)
  Sponsored by: The FreeBSD Foundation

Modified:
  head/sys/cam/ctl/ctl_frontend_iscsi.c

Modified: head/sys/cam/ctl/ctl_frontend_iscsi.c
==
--- head/sys/cam/ctl/ctl_frontend_iscsi.c   Wed Jun 18 17:04:25 2014
(r267609)
+++ head/sys/cam/ctl/ctl_frontend_iscsi.c   Wed Jun 18 17:13:18 2014
(r267610)
@@ -1045,7 +1045,7 @@ cfiscsi_session_terminate_tasks(struct c
 {
struct cfiscsi_data_wait *cdw, *tmpcdw;
union ctl_io *io;
-   int error;
+   int error, last;
 
 #ifdef notyet
io = ctl_alloc_io(cs->cs_target->ct_softc->fe.ctl_pool_ref);
@@ -1102,12 +1102,31 @@ cfiscsi_session_terminate_tasks(struct c
CFISCSI_SESSION_DEBUG(cs, "removing csw for initiator task tag "
"0x%x", cdw->cdw_initiator_task_tag);
 #endif
+   /*
+* Set nonzero port status; this prevents backends from
+* assuming that the data transfer actually succeeded
+* and writing uninitialized data to disk.
+*/
+   cdw->cdw_ctl_io->scsiio.io_hdr.port_status = 42;
cdw->cdw_ctl_io->scsiio.be_move_done(cdw->cdw_ctl_io);
TAILQ_REMOVE(&cs->cs_waiting_for_data_out, cdw, cdw_next);
uma_zfree(cfiscsi_data_wait_zone, cdw);
}
CFISCSI_SESSION_UNLOCK(cs);
 #endif
+
+   /*
+* Wait for CTL to terminate all the tasks.
+*/
+   for (;;) {
+   refcount_acquire(&cs->cs_outstanding_ctl_pdus);
+   last = refcount_release(&cs->cs_outstanding_ctl_pdus);
+   if (last != 0)
+   break;
+   CFISCSI_SESSION_WARN(cs, "waiting for CTL to terminate tasks, "
+   "%d remaining", cs->cs_outstanding_ctl_pdus);
+   pause("cfiscsi_terminate", 1);
+   }
 }
 
 static void
@@ -1124,19 +1143,22 @@ cfiscsi_maintenance_thread(void *arg)
CFISCSI_SESSION_UNLOCK(cs);
 
if (cs->cs_terminating) {
-   cfiscsi_session_terminate_tasks(cs);
-   callout_drain(&cs->cs_callout);
 
+   /*
+* We used to wait up to 30 seconds to deliver queued
+* PDUs to the initiator.  We also tried hard to deliver
+* SCSI Responses for the aborted PDUs.  We don't do
+* that anymore.  We might need to revisit that.
+*/
+   callout_drain(&cs->cs_callout);
icl_conn_shutdown(cs->cs_conn);
icl_conn_close(cs->cs_conn);
 
/*
-* XXX: We used to wait up to 30 seconds to deliver 
queued PDUs
-*  to the initiator.  We also tried hard to 
deliver SCSI Responses
-*  for the aborted PDUs.  We don't do that 
anymore.  We might need
-*  to revisit that.
+* At this point ICL receive thread is no longer
+* running; no new tasks can be queued.
 */
-
+   cfiscsi_session_terminate_tasks(cs);
cfiscsi_session_delete(cs);
kthread_exit();
return;
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267609 - head/usr.sbin/iscsid

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:04:25 2014
New Revision: 267609
URL: http://svnweb.freebsd.org/changeset/base/267609

Log:
  Improve code a little; no functional changes.
  
  Sponsored by: The FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==
--- head/usr.sbin/iscsid/login.cWed Jun 18 17:00:41 2014
(r267608)
+++ head/usr.sbin/iscsid/login.cWed Jun 18 17:04:25 2014
(r267609)
@@ -205,18 +205,32 @@ login_receive(struct connection *conn, b
 }
 
 static struct pdu *
-login_new_request(struct connection *conn)
+login_new_request(struct connection *conn, int csg)
 {
struct pdu *request;
struct iscsi_bhs_login_request *bhslr;
+   int nsg;
 
request = pdu_new(conn);
bhslr = (struct iscsi_bhs_login_request *)request->pdu_bhs;
bhslr->bhslr_opcode = ISCSI_BHS_OPCODE_LOGIN_REQUEST |
ISCSI_BHS_OPCODE_IMMEDIATE;
+
bhslr->bhslr_flags = BHSLR_FLAGS_TRANSIT;
-   login_set_csg(request, BHSLR_STAGE_SECURITY_NEGOTIATION);
-   login_set_nsg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
+   switch (csg) {
+   case BHSLR_STAGE_SECURITY_NEGOTIATION:
+   nsg = BHSLR_STAGE_OPERATIONAL_NEGOTIATION;
+   break;
+   case BHSLR_STAGE_OPERATIONAL_NEGOTIATION:
+   nsg = BHSLR_STAGE_FULL_FEATURE_PHASE;
+   break;
+   default:
+   assert(!"invalid csg");
+   log_errx(1, "invalid csg %d", csg);
+   }
+   login_set_csg(request, csg);
+   login_set_nsg(request, nsg);
+
memcpy(bhslr->bhslr_isid, &conn->conn_isid, sizeof(bhslr->bhslr_isid));
bhslr->bhslr_initiator_task_tag = 0;
bhslr->bhslr_cmdsn = 0;
@@ -496,9 +510,7 @@ login_negotiate(struct connection *conn)
int i;
 
log_debugx("beginning operational parameter negotiation");
-   request = login_new_request(conn);
-   login_set_csg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
-   login_set_nsg(request, BHSLR_STAGE_FULL_FEATURE_PHASE);
+   request = login_new_request(conn, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
request_keys = keys_new();
 
/*
@@ -570,7 +582,7 @@ login_send_chap_a(struct connection *con
struct pdu *request;
struct keys *request_keys;
 
-   request = login_new_request(conn);
+   request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
request_keys = keys_new();
keys_add(request_keys, "CHAP_A", "5");
keys_save(request_keys, request);
@@ -632,7 +644,7 @@ login_send_chap_r(struct pdu *response)
 
keys_delete(response_keys);
 
-   request = login_new_request(conn);
+   request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
request_keys = keys_new();
keys_add(request_keys, "CHAP_N", conn->conn_conf.isc_user);
keys_add(request_keys, "CHAP_R", chap_r);
@@ -779,7 +791,7 @@ login(struct connection *conn)
login_create_isid(conn);
 
log_debugx("beginning Login phase; sending Login PDU");
-   request = login_new_request(conn);
+   request = login_new_request(conn, BHSLR_STAGE_SECURITY_NEGOTIATION);
request_keys = keys_new();
if (conn->conn_conf.isc_mutual_user[0] != '\0') {
keys_add(request_keys, "AuthMethod", "CHAP");
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267608 - head/usr.sbin/iscsid

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 17:00:41 2014
New Revision: 267608
URL: http://svnweb.freebsd.org/changeset/base/267608

Log:
  Use proper term in debug messages.
  
  MFC after:1 month
  Sponsored by: FreeBSD Foundation

Modified:
  head/usr.sbin/iscsid/login.c

Modified: head/usr.sbin/iscsid/login.c
==
--- head/usr.sbin/iscsid/login.cWed Jun 18 13:41:20 2014
(r267607)
+++ head/usr.sbin/iscsid/login.cWed Jun 18 17:00:41 2014
(r267608)
@@ -495,7 +495,7 @@ login_negotiate(struct connection *conn)
struct iscsi_bhs_login_response *bhslr;
int i;
 
-   log_debugx("beginning parameter negotiation");
+   log_debugx("beginning operational parameter negotiation");
request = login_new_request(conn);
login_set_csg(request, BHSLR_STAGE_OPERATIONAL_NEGOTIATION);
login_set_nsg(request, BHSLR_STAGE_FULL_FEATURE_PHASE);
@@ -557,7 +557,7 @@ login_negotiate(struct connection *conn)
log_warnx("received final login response with wrong NSG 0x%x",
login_nsg(response));
 
-   log_debugx("parameter negotiation done; "
+   log_debugx("operational parameter negotiation done; "
"transitioning to Full Feature phase");
 
keys_delete(response_keys);
@@ -848,12 +848,12 @@ login(struct connection *conn)
login_nsg(response) == BHSLR_STAGE_OPERATIONAL_NEGOTIATION) {
if (conn->conn_conf.isc_mutual_user[0] != '\0') {
log_errx(1, "target requested transition "
-   "to operational negotiation, but we require "
-   "mutual CHAP");
+   "to operational parameter negotiation, "
+   "but we require mutual CHAP");
}
 
log_debugx("target requested transition "
-   "to operational negotiation");
+   "to operational parameter negotiation");
keys_delete(response_keys);
pdu_delete(response);
login_negotiate(conn);
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267607 - head/sys/x86/xen

2014-06-18 Thread Roger Pau Monné
Author: royger
Date: Wed Jun 18 13:41:20 2014
New Revision: 267607
URL: http://svnweb.freebsd.org/changeset/base/267607

Log:
  xen: fix out-of-bounds access to ipi_handle
  
  Fix the gate in xen_pv_lapic_ipi_vectored to prevent access to element
  at position nitems(xen_ipis).
  
  Sponsored by: Citrix Systems R&D
  Coverity ID: 1223203
  Approved by: gibbs

Modified:
  head/sys/x86/xen/xen_apic.c

Modified: head/sys/x86/xen/xen_apic.c
==
--- head/sys/x86/xen/xen_apic.c Wed Jun 18 12:26:02 2014(r267606)
+++ head/sys/x86/xen/xen_apic.c Wed Jun 18 13:41:20 2014(r267607)
@@ -272,7 +272,7 @@ xen_pv_lapic_ipi_vectored(u_int vector, 
int ipi_idx, to_cpu, self;
 
ipi_idx = IPI_TO_IDX(vector);
-   if (ipi_idx > nitems(xen_ipis))
+   if (ipi_idx >= nitems(xen_ipis))
panic("IPI out of range");
 
switch(dest) {
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267606 - head/usr.sbin/ctld

2014-06-18 Thread Alexander Motin
Author: mav
Date: Wed Jun 18 12:26:02 2014
New Revision: 267606
URL: http://svnweb.freebsd.org/changeset/base/267606

Log:
  On discovery stage add set of TargetAddress keys to reply, reporting to
  the client all the portal groups addresses and ports.
  
  Reviewed by:  trasz@
  MFC after:2 weeks
  Sponsored by: iXsystems, Inc.

Modified:
  head/usr.sbin/ctld/discovery.c

Modified: head/usr.sbin/ctld/discovery.c
==
--- head/usr.sbin/ctld/discovery.c  Wed Jun 18 10:56:59 2014
(r267605)
+++ head/usr.sbin/ctld/discovery.c  Wed Jun 18 12:26:02 2014
(r267606)
@@ -35,6 +35,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 #include "ctld.h"
 #include "iscsi_proto.h"
@@ -155,6 +157,48 @@ logout_new_response(struct pdu *request)
return (response);
 }
 
+static void
+discovery_add_target(struct keys *response_keys, struct target *targ)
+{
+   struct portal *portal;
+   char *buf;
+   char hbuf[NI_MAXHOST], sbuf[NI_MAXSERV];
+   struct addrinfo *ai;
+   int ret;
+
+   keys_add(response_keys, "TargetName", targ->t_name);
+   TAILQ_FOREACH(portal, &targ->t_portal_group->pg_portals, p_next) {
+   ai = portal->p_ai;
+   ret = getnameinfo(ai->ai_addr, ai->ai_addrlen,
+   hbuf, sizeof(hbuf), sbuf, sizeof(sbuf),
+   NI_NUMERICHOST | NI_NUMERICSERV);
+   if (ret != 0) {
+   log_warnx("getnameinfo: %s", gai_strerror(ret));
+   continue;
+   }
+   switch (ai->ai_addr->sa_family) {
+   case AF_INET:
+   if (strcmp(hbuf, "0.0.0.0") == 0)
+   continue;
+   ret = asprintf(&buf, "%s:%s,%d", hbuf, sbuf,
+   targ->t_portal_group->pg_tag);
+   break;
+   case AF_INET6:
+   if (strcmp(hbuf, "::") == 0)
+   continue;
+   ret = asprintf(&buf, "[%s]:%s,%d", hbuf, sbuf,
+   targ->t_portal_group->pg_tag);
+   break;
+   default:
+   continue;
+   }
+   if (ret <= 0)
+   log_err(1, "asprintf");
+   keys_add(response_keys, "TargetAddress", buf);
+   free(buf);
+   }
+}
+
 void
 discovery(struct connection *conn)
 {
@@ -186,7 +230,7 @@ discovery(struct connection *conn)
targ->t_name);
continue;
}
-   keys_add(response_keys, "TargetName", targ->t_name);
+   discovery_add_target(response_keys, targ);
}
} else {
targ = target_find(conn->conn_portal->p_portal_group->pg_conf,
@@ -194,9 +238,8 @@ discovery(struct connection *conn)
if (targ == NULL) {
log_debugx("initiator requested information on unknown "
"target \"%s\"; returning nothing", send_targets);
-   } else {
-   keys_add(response_keys, "TargetName", targ->t_name);
-   }
+   } else
+   discovery_add_target(response_keys, targ);
}
keys_save(response_keys, response);
 
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267605 - stable/8/sys/dev/acpica

2014-06-18 Thread Marius Strobl
Author: marius
Date: Wed Jun 18 10:56:59 2014
New Revision: 267605
URL: http://svnweb.freebsd.org/changeset/base/267605

Log:
  MFC: r220871
  
  Correctly output the entire array for hw.acpi.thermal._ACx.

Modified:
  stable/8/sys/dev/acpica/acpi_thermal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/acpica/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_thermal.c
==
--- stable/8/sys/dev/acpica/acpi_thermal.c  Wed Jun 18 10:38:29 2014
(r267604)
+++ stable/8/sys/dev/acpica/acpi_thermal.c  Wed Jun 18 10:56:59 2014
(r267605)
@@ -293,7 +293,8 @@ acpi_tz_attach(device_t dev)
"critical temp setpoint (shutdown now)");
 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "_ACx", CTLTYPE_INT | CTLFLAG_RD,
-   &sc->tz_zone.ac, 0, sysctl_handle_int, "IK", "");
+   &sc->tz_zone.ac, sizeof(sc->tz_zone.ac),
+   sysctl_handle_opaque, "IK", "");
 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW,
sc, offsetof(struct acpi_tz_softc, tz_zone.tc1),
___
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"


svn commit: r267604 - stable/8/sys/dev/acpica

2014-06-18 Thread Marius Strobl
Author: marius
Date: Wed Jun 18 10:38:29 2014
New Revision: 267604
URL: http://svnweb.freebsd.org/changeset/base/267604

Log:
  MFC: r220798
  
  Fix a few acpi sysctls that want "IK" formatting to specify CTLTYPE_INT.
  
  MFC: r245266
  
  Remove not very useful printf, that can be too chatty.
  
  MFC: r255077
  
  Warn about insane _TMP temperature only once.

Modified:
  stable/8/sys/dev/acpica/acpi_thermal.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/dev/   (props changed)
  stable/8/sys/dev/acpica/   (props changed)

Modified: stable/8/sys/dev/acpica/acpi_thermal.c
==
--- stable/8/sys/dev/acpica/acpi_thermal.c  Wed Jun 18 07:23:04 2014
(r267603)
+++ stable/8/sys/dev/acpica/acpi_thermal.c  Wed Jun 18 10:38:29 2014
(r267604)
@@ -112,6 +112,7 @@ struct acpi_tz_softc {
 
 struct acpi_tz_zonetz_zone;/*Thermal zone parameters*/
 inttz_validchecks;
+inttz_insane_tmp_notified;
 
 /* passive cooling */
 struct proc*tz_cooling_proc;
@@ -162,6 +163,8 @@ static driver_t acpi_tz_driver = {
 sizeof(struct acpi_tz_softc),
 };
 
+static char *acpi_tz_tmp_name = "_TMP";
+
 static devclass_t acpi_tz_devclass;
 DRIVER_MODULE(acpi_tz, acpi, acpi_tz_driver, acpi_tz_devclass, 0, 0);
 MODULE_DEPEND(acpi_tz, acpi, 1, 1, 1);
@@ -259,10 +262,10 @@ acpi_tz_attach(device_t dev)
 sc->tz_sysctl_tree = SYSCTL_ADD_NODE(&sc->tz_sysctl_ctx,
 SYSCTL_CHILDREN(acpi_tz_sysctl_tree),
 OID_AUTO, oidname, CTLFLAG_RD, 0, "");
-SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
- OID_AUTO, "temperature", CTLFLAG_RD, &sc->tz_temperature,
- sizeof(sc->tz_temperature), "IK",
- "current thermal zone temperature");
+SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+   OID_AUTO, "temperature", CTLTYPE_INT | CTLFLAG_RD,
+   &sc->tz_temperature, 0, sysctl_handle_int,
+   "IK", "current thermal zone temperature");
 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "active", CTLTYPE_INT | CTLFLAG_RW,
sc, 0, acpi_tz_active_sysctl, "I", "cooling is active");
@@ -288,9 +291,9 @@ acpi_tz_attach(device_t dev)
sc, offsetof(struct acpi_tz_softc, tz_zone.crt),
acpi_tz_temp_sysctl, "IK",
"critical temp setpoint (shutdown now)");
-SYSCTL_ADD_OPAQUE(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
- OID_AUTO, "_ACx", CTLFLAG_RD, &sc->tz_zone.ac,
- sizeof(sc->tz_zone.ac), "IK", "");
+SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
+   OID_AUTO, "_ACx", CTLTYPE_INT | CTLFLAG_RD,
+   &sc->tz_zone.ac, 0, sysctl_handle_int, "IK", "");
 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree),
OID_AUTO, "_TC1", CTLTYPE_INT | CTLFLAG_RW,
sc, offsetof(struct acpi_tz_softc, tz_zone.tc1),
@@ -456,12 +459,11 @@ acpi_tz_get_temperature(struct acpi_tz_s
 {
 inttemp;
 ACPI_STATUSstatus;
-static char*tmp_name = "_TMP";
 
 ACPI_FUNCTION_NAME ("acpi_tz_get_temperature");
 
 /* Evaluate the thermal zone's _TMP method. */
-status = acpi_GetInteger(sc->tz_handle, tmp_name, &temp);
+status = acpi_GetInteger(sc->tz_handle, acpi_tz_tmp_name, &temp);
 if (ACPI_FAILURE(status)) {
ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
"error fetching current temperature -- %s\n",
@@ -470,7 +472,7 @@ acpi_tz_get_temperature(struct acpi_tz_s
 }
 
 /* Check it for validity. */
-acpi_tz_sanity(sc, &temp, tmp_name);
+acpi_tz_sanity(sc, &temp, acpi_tz_tmp_name);
 if (temp == -1)
return (FALSE);
 
@@ -509,15 +511,8 @@ acpi_tz_monitor(void *Context)
  */
 newactive = TZ_ACTIVE_NONE;
 for (i = TZ_NUMLEVELS - 1; i >= 0; i--) {
-   if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i]) {
+   if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i])
newactive = i;
-   if (sc->tz_active != newactive) {
-   ACPI_VPRINT(sc->tz_dev,
-   acpi_device_get_parent_softc(sc->tz_dev),
-   "_AC%d: temperature %d.%d >= setpoint %d.%d\n", i,
-   TZ_KELVTOC(temp), TZ_KELVTOC(sc->tz_zone.ac[i]));
-   }
-   }
 }
 
 /*
@@ -703,10 +698,29 @@ static void
 acpi_tz_sanity(struct acpi_tz_softc *sc, int *val, char *what)
 {
 if (*val != -1 && (*val < TZ_ZER

svn commit: r267603 - head/share/vt/keymaps

2014-06-18 Thread Edward Tomasz Napierala
Author: trasz
Date: Wed Jun 18 07:23:04 2014
New Revision: 267603
URL: http://svnweb.freebsd.org/changeset/base/267603

Log:
  Add polish vt(4) keymap.
  
  Sponsored by: The FreeBSD Foundation

Added:
  head/share/vt/keymaps/pl.kbd   (contents, props changed)
Modified:
  head/share/vt/keymaps/Makefile

Modified: head/share/vt/keymaps/Makefile
==
--- head/share/vt/keymaps/Makefile  Wed Jun 18 05:35:09 2014
(r267602)
+++ head/share/vt/keymaps/Makefile  Wed Jun 18 07:23:04 2014
(r267603)
@@ -1,6 +1,6 @@
 # $FreeBSD$
 
-FILES= ua.kbd ua.shift.alt.kbd
+FILES= pl.kbd ua.kbd ua.shift.alt.kbd
 
 FILESDIR= ${SHAREDIR}/vt/keymaps
 

Added: head/share/vt/keymaps/pl.kbd
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/share/vt/keymaps/pl.kbdWed Jun 18 07:23:04 2014
(r267603)
@@ -0,0 +1,116 @@
+# Polish ISO-8859-2 keymap by Krzysztof Mlynarski (17:46 27-04-1996 MET DST)
+# (krzy...@hydra.mimuw.edu.pl)
+# $FreeBSD$
+# alt
+# scan   cntrl  altalt   cntrl lock
+# code  base   shift  cntrl  shift  altshift  cntrl  shift state
+# --
+  000   nopnopnopnopnopnopnopnop O
+  001   escescescescescescdebug  esc O
+  002   '1''!'nopnop'1''!'nopnop O
+  003   '2''@'nulnul'2''@'nulnul O
+  004   '3''#'nopnop'3''#'nopnop O
+  005   '4''$'nopnop'4''$'nopnop O
+  006   '5''%'nopnop'5''%'nopnop O
+  007   '6''^'rs rs '6''^'rs rs  O
+  008   '7''&'nopnop'7''&'nopnop O
+  009   '8''*'nopnop'8''*'nopnop O
+  010   '9''('nopnop'9''('nopnop O
+  011   '0'')'nopnop'0'')'nopnop O
+  012   '-''_'us us '-''_'us us  O
+  013   '=''+'nopnop'=''+'nopnop O
+  014   bs bs deldelbs bs deldel O
+  015   ht btab   nopnopht btab   nopnop O
+  016   'q''Q'dc1dc1'q''Q'dc1dc1 C
+  017   'w''W'etbetb'w''W'etbetb C
+  018   'e''E'enqenq281280enqenq C
+  019   'r''R'dc2dc2'r''R'dc2dc2 C
+  020   't''T'dc4dc4't''T'dc4dc4 C
+  021   'y''Y'em em 'y''Y'em em  C
+  022   'u''U'naknak'u''U'naknak C
+  023   'i''I'ht ht 'i''I'ht ht  C
+  024   'o''O'si si 243211si si  C
+  025   'p''P'dledle'p''P'dledle C
+  026   '[''{'escesc'[''{'escesc O
+  027   ']''}'gs gs ']''}'gs gs  O
+  028   cr cr nl nl cr cr nl nl  O
+  029   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
+  030   'a''A'sohsoh261260sohsoh C
+  031   's''S'dc3dc3347346dc3dc3 C
+  032   'd''D'eoteot'd''D'eoteot C
+  033   'f''F'ackack'f''F'ackack C
+  034   'g''G'belbel'g''G'belbel C
+  035   'h''H'bs bs 'h''H'bs bs  C
+  036   'j''J'nl nl 'j''J'nl nl  C
+  037   'k''K'vt vt 'k''K'vt vt  C
+  038   'l''L'ff ff 322321ff ff  C
+  039   ';'':'nopnop';'':'nopnop O
+  040   ''''"'nopnop''''"'nopnop O
+  041   '`''~'nopnop'`''~'nopnop O
+  042   lshift lshift lshift lshift lshift lshift lshift lshift  O
+  043   '\''|'fs fs '\''|'fs fs  O
+  044   'z''Z'subsub380379subsub C
+  045   'x''X'cancan378377cancan C
+  046   'c''C'etxetx263262etxetx C
+  047   'v''V'synsyn'v''V'synsyn C
+  048   'b''B'stxstx'b''B'stxstx C
+  049   'n''N'so so 324323so so  C
+  050   'm''M'cr cr 'm''M'cr cr  C
+  051   ',''<'nopnop',''<'nopnop O
+  052   '.''>'