svn commit: r318284 - head/contrib/ipfilter/lib

2017-05-14 Thread Cy Schubert
Author: cy
Date: Mon May 15 03:39:35 2017
New Revision: 318284
URL: https://svnweb.freebsd.org/changeset/base/318284

Log:
  Just like r318173, which was for outputting IPv6 addresses in tree
  pools, implement outputting of IPv6 addresses in the ippool debug list
  of hash type pools (ippool -l -d -t hash). Currently IPv6 in ippool tree
  type pool handling is mostly implemented.
  This continues theseries of commits to remediate ippool.
  
  This will be MFCed with a yet to be committed series of fixes to ippool
  after it has been fully remediated.
  
  PR:   218433

Modified:
  head/contrib/ipfilter/lib/printhashnode.c

Modified: head/contrib/ipfilter/lib/printhashnode.c
==
--- head/contrib/ipfilter/lib/printhashnode.c   Sun May 14 23:45:10 2017
(r318283)
+++ head/contrib/ipfilter/lib/printhashnode.c   Mon May 15 03:39:35 2017
(r318284)
@@ -35,18 +35,47 @@ printhashnode(iph, ipep, copyfunc, opts,
}
printf("\n");
} else if ((opts & OPT_DEBUG) != 0) {
-   PRINTF("\t%d\tAddress: %s", hv,
-   inet_ntoa(ipe.ipe_addr.in4));
-   printmask(ipe.ipe_family, (u_32_t *)_mask.in4_addr);
-   PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
-   ipe.ipe_group);
+#ifdef AF_INET6
+   if (ipe.ipe_family == AF_INET6) {
+   char buf[INET6_ADDRSTRLEN + 1];
+   const char *str;
+
+   buf[0] = '\0';
+   str = inet_ntop(AF_INET6, _addr.in6,
+   buf, sizeof(buf) - 1);
+   if (str == NULL)
+   str = "???";
+   PRINTF("\t%d\tAddress: %s", hv, str);
+   printmask(ipe.ipe_family, (u_32_t 
*)_mask.in4_addr);
+   PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
+   ipe.ipe_group);
+#ifdef USE_QUAD_T
+   PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
+  ipe.ipe_hits, ipe.ipe_bytes);
+#else
+   PRINTF("\tHits: %lu\tBytes: %lu\n",
+  ipe.ipe_hits, ipe.ipe_bytes);
+#endif /* USE_QUAD_T */
+   } else if (ipe.ipe_family == AF_INET) {
+#else
+   if (ipe.ipe_family == AF_INET) {
+#endif /* AF_INET6 */
+   PRINTF("\t%d\tAddress: %s", hv,
+   inet_ntoa(ipe.ipe_addr.in4));
+   printmask(ipe.ipe_family, (u_32_t 
*)_mask.in4_addr);
+   PRINTF("\tRef. Count: %d\tGroup: %s\n", ipe.ipe_ref,
+   ipe.ipe_group);
 #ifdef USE_QUAD_T
-   PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
-  ipe.ipe_hits, ipe.ipe_bytes);
+   PRINTF("\tHits: %"PRIu64"\tBytes: %"PRIu64"\n",
+  ipe.ipe_hits, ipe.ipe_bytes);
 #else
-   PRINTF("\tHits: %lu\tBytes: %lu\n",
-  ipe.ipe_hits, ipe.ipe_bytes);
-#endif
+   PRINTF("\tHits: %lu\tBytes: %lu\n",
+  ipe.ipe_hits, ipe.ipe_bytes);
+#endif /* USE_QUAD_T */
+   } else {
+   PRINTF("\tAddress: family: %d\n",
+   ipe.ipe_family);
+   }
} else {
putchar(' ');
printip(ipe.ipe_family, (u_32_t *)_addr.in4_addr);
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318283 - head/contrib/ipfilter/lib

2017-05-14 Thread Cy Schubert
Author: cy
Date: Sun May 14 23:45:10 2017
New Revision: 318283
URL: https://svnweb.freebsd.org/changeset/base/318283

Log:
  As of r318281, there is no need to put a colon (:) in the message
  string.
  
  MFC after:3 days
  X-MFC with:   r318281

Modified:
  head/contrib/ipfilter/lib/printhash_live.c

Modified: head/contrib/ipfilter/lib/printhash_live.c
==
--- head/contrib/ipfilter/lib/printhash_live.c  Sun May 14 21:33:01 2017
(r318282)
+++ head/contrib/ipfilter/lib/printhash_live.c  Sun May 14 23:45:10 2017
(r318283)
@@ -59,7 +59,7 @@ printhash_live(hp, fd, name, opts, field
printed++;
}
if (last == 0)
-   ipferror(fd, "walking hash nodes:");
+   ipferror(fd, "walking hash nodes");
 
if (printed == 0)
putchar(';');
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318282 - head/sys/dev/sdhci

2017-05-14 Thread Marius Strobl
Author: marius
Date: Sun May 14 21:33:01 2017
New Revision: 318282
URL: https://svnweb.freebsd.org/changeset/base/318282

Log:
  - Unlike as in the PCI case, when attached to ACPI, Intel Bay Trail
and Braswell eMMC and SDXC controllers share the same IDs. Like in
the PCI case, Braswell eMMC needs the SDHCI_QUIRK_DATA_TIMEOUT_1MHZ
quirk (see r311794 for the corresponding change to the sdhci(4) PCI
PCI front-end), though. However, due to the shared ACPI IDs, this
is trickier to do.
  - Intel Apollo Lake eMMC and SDXC controllers are affected by the
APL18 ("Using 32-bit Addressing Mode With SD/eMMC Controller May
Lead to Unpredictable System Behavior") silicon bug [1]. When this
erratum hits, typically both SDHCI and XHCI controllers wedge.
According to Intel, using ADMA2 with 64-bit addressing and 96-bit
descriptors serves as a workaround. Until such times when sdhci(4)
has ADMA2 support, flag DMA as broken for affected interfaces.
This turns out to work around the problem, too, at the cost of
performance.
  - In the sdhci(4) ACPI front-end, probe the Intel Apollo Lake eMMC
and SDXC controllers, too.
  
  1: 
http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/pentium-celeron-n-series-j-series-datasheet-spec-update.pdf

Modified:
  head/sys/dev/sdhci/sdhci_acpi.c
  head/sys/dev/sdhci/sdhci_pci.c

Modified: head/sys/dev/sdhci/sdhci_acpi.c
==
--- head/sys/dev/sdhci/sdhci_acpi.c Sun May 14 21:18:01 2017
(r318281)
+++ head/sys/dev/sdhci/sdhci_acpi.c Sun May 14 21:33:01 2017
(r318282)
@@ -57,25 +57,39 @@ static const struct sdhci_acpi_device {
const char  *desc;
u_int   quirks;
 } sdhci_acpi_devices[] = {
-   { "80860F14",   1,  "Intel Bay Trail eMMC 4.5 Controller",
+   { "80860F14",   1, "Intel Bay Trail/Braswell eMMC 4.5/4.5.1 Controller",
SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
SDHCI_QUIRK_INTEL_POWER_UP_RESET |
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_MMC_DDR52 |
SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
-   { "80860F14",   3,  "Intel Bay Trail SDXC Controller",
+   { "80860F14",   3, "Intel Bay Trail/Braswell SDXC Controller",
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
-   { "80860F16",   0,  "Intel Bay Trail SDXC Controller",
+   { "80860F16",   0, "Intel Bay Trail/Braswell SDXC Controller",
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+   { "80865ACA",   0, "Intel Apollo Lake SDXC Controller",
+   SDHCI_QUIRK_BROKEN_DMA |/* APL18 erratum */
+   SDHCI_QUIRK_WAIT_WHILE_BUSY |
+   SDHCI_QUIRK_PRESET_VALUE_BROKEN },
+   { "80865ACC",   0, "Intel Apollo Lake eMMC 5.0 Controller",
+   SDHCI_QUIRK_BROKEN_DMA |/* APL18 erratum */
+   SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
+   SDHCI_QUIRK_INTEL_POWER_UP_RESET |
+   SDHCI_QUIRK_WAIT_WHILE_BUSY |
+   SDHCI_QUIRK_MMC_DDR52 |
+   SDHCI_QUIRK_CAPS_BIT63_FOR_MMC_HS400 |
+   SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ NULL, 0, NULL, 0}
 };
 
 static char *sdhci_ids[] = {
"80860F14",
"80860F16",
+   "80865ACA",
+   "80865ACC",
NULL
 };
 
@@ -249,6 +263,11 @@ sdhci_acpi_attach(device_t dev)
return (ENOMEM);
}
 
+   /* Intel Braswell eMMC 4.5.1 controller quirk */
+   if (strcmp(acpi_dev->hid, "80860F14") == 0 && acpi_dev->uid == 1 &&
+   SDHCI_READ_4(dev, >slot, SDHCI_CAPABILITIES) == 0x446cc8b2 &&
+   SDHCI_READ_4(dev, >slot, SDHCI_CAPABILITIES2) == 0x0807)
+   sc->quirks |= SDHCI_QUIRK_DATA_TIMEOUT_1MHZ;
sc->quirks &= ~sdhci_quirk_clear;
sc->quirks |= sdhci_quirk_set;
sc->slot.quirks = sc->quirks;

Modified: head/sys/dev/sdhci/sdhci_pci.c
==
--- head/sys/dev/sdhci/sdhci_pci.c  Sun May 14 21:18:01 2017
(r318281)
+++ head/sys/dev/sdhci/sdhci_pci.c  Sun May 14 21:33:01 2017
(r318282)
@@ -132,9 +132,11 @@ static const struct sdhci_device {
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ 0x5aca8086,   0x, "Intel Apollo Lake SDXC Controller",
+   SDHCI_QUIRK_BROKEN_DMA |/* APL18 erratum */
SDHCI_QUIRK_WAIT_WHILE_BUSY |
SDHCI_QUIRK_PRESET_VALUE_BROKEN },
{ 0x5acc8086,   0x, "Intel Apollo Lake eMMC 5.0 Controller",
+   SDHCI_QUIRK_BROKEN_DMA |/* APL18 erratum */
SDHCI_QUIRK_ALL_SLOTS_NON_REMOVABLE |
SDHCI_QUIRK_INTEL_POWER_UP_RESET |
SDHCI_QUIRK_WAIT_WHILE_BUSY |
@@ -340,6 +342,7 @@ 

svn commit: r318281 - head/contrib/ipfilter/lib

2017-05-14 Thread Cy Schubert
Author: cy
Date: Sun May 14 21:18:01 2017
New Revision: 318281
URL: https://svnweb.freebsd.org/changeset/base/318281

Log:
  Separate the ipfilter function/static string from the error with a
  colon (:) in error messages to assist the user in parsing out the error
  from where or which object the error message refers to.
  
  MFC after:3 days

Modified:
  head/contrib/ipfilter/lib/ipf_perror.c

Modified: head/contrib/ipfilter/lib/ipf_perror.c
==
--- head/contrib/ipfilter/lib/ipf_perror.c  Sun May 14 20:39:01 2017
(r318280)
+++ head/contrib/ipfilter/lib/ipf_perror.c  Sun May 14 21:18:01 2017
(r318281)
@@ -10,7 +10,7 @@ ipf_perror(err, string)
if (err == 0)
fprintf(stderr, "%s\n", string);
else
-   fprintf(stderr, "%s %s\n", string, ipf_strerror(err));
+   fprintf(stderr, "%s: %s\n", string, ipf_strerror(err));
 }
 
 int
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318280 - head/usr.bin/getconf

2017-05-14 Thread Ngie Cooper
Author: ngie
Date: Sun May 14 20:39:01 2017
New Revision: 318280
URL: https://svnweb.freebsd.org/changeset/base/318280

Log:
  getconf: use nitems(..) to compute NWORDS instead of hardcoding
  the equivalent macro
  
  MFC after:1 month
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/getconf/fake-gperf.awk

Modified: head/usr.bin/getconf/fake-gperf.awk
==
--- head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:17:50 2017
(r318279)
+++ head/usr.bin/getconf/fake-gperf.awk Sun May 14 20:39:01 2017
(r318280)
@@ -36,7 +36,8 @@ state == 1 { print; next; }
   state = 3;
   print "\t{ NULL, 0, 0 }";
   print "};";
-  print "#define\tNWORDS\t(sizeof(wordlist)/sizeof(wordlist[0]) - 1)";
+  print "#include ";
+  print "#define\tNWORDS\t(nitems(wordlist) - 1)";
   print "static const struct map *";
   print "in_word_set(const char *word)";
   print "{";
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318278 - head/usr.bin/localedef

2017-05-14 Thread Ngie Cooper
Author: ngie
Date: Sun May 14 18:47:09 2017
New Revision: 318278
URL: https://svnweb.freebsd.org/changeset/base/318278

Log:
  Mark errf _Noreturn, and mark errf and warn __printflike
  
  The _Noreturn attribute was added to placate Coverity and other static
  analysis tools. The __printflike attribute was added to catch issues
  with the calls related to printf(3) abuse.
  
  - Modify the code to facilitate the __printflike attribute addition.
  - Convert errf calls in to_mb(..) and to_mb_string(..) to warn(..) so
the calls will return instead of exiting, as the code suggests it
should.
  
  Differential Revision:D10704
  MFC after:1 month
  Reviewed by:  pfg
  Sponsored by: Dell EMC Isilon

Modified:
  head/usr.bin/localedef/localedef.c
  head/usr.bin/localedef/localedef.h
  head/usr.bin/localedef/wide.c

Modified: head/usr.bin/localedef/localedef.c
==
--- head/usr.bin/localedef/localedef.c  Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/localedef.c  Sun May 14 18:47:09 2017
(r318278)
@@ -119,7 +119,7 @@ open_category(void)
 */
file = fopen(category_file(), "w");
if (file == NULL) {
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (NULL);
}
return (file);
@@ -131,11 +131,11 @@ close_category(FILE *f)
if (fchmod(fileno(f), 0644) < 0) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
if (fclose(f) < 0) {
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
if (verbose) {
(void) fprintf(stdout, "done.\n");
@@ -195,13 +195,13 @@ putl_category(const char *s, FILE *f)
if (s && fputs(s, f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
if (fputc('\n', f) == EOF) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -216,7 +216,7 @@ wr_category(void *buf, size_t sz, FILE *
if (fwrite(buf, sz, 1, f) < 1) {
(void) fclose(f);
(void) unlink(category_file());
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
return (EOF);
}
return (0);
@@ -331,7 +331,7 @@ main(int argc, char **argv)
while ((dir = opendir(locname)) == NULL) {
if ((errno != ENOENT) ||
(mkdir(locname, 0755) <  0)) {
-   errf(strerror(errno));
+   errf("%s", strerror(errno));
}
}
(void) closedir(dir);

Modified: head/usr.bin/localedef/localedef.h
==
--- head/usr.bin/localedef/localedef.h  Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/localedef.h  Sun May 14 18:47:09 2017
(r318278)
@@ -35,6 +35,7 @@
  */
 
 /* Common header files. */
+#include 
 #include 
 #include 
 #include 
@@ -54,8 +55,8 @@ extern int warnings;
 
 int yylex(void);
 void yyerror(const char *);
-void errf(const char *, ...);
-void warn(const char *, ...);
+_Noreturn void errf(const char *, ...) __printflike(1, 2);
+void warn(const char *, ...) __printflike(1, 2);
 
 int putl_category(const char *, FILE *);
 int wr_category(void *, size_t, FILE *);

Modified: head/usr.bin/localedef/wide.c
==
--- head/usr.bin/localedef/wide.c   Sun May 14 17:10:55 2017
(r318277)
+++ head/usr.bin/localedef/wide.c   Sun May 14 18:47:09 2017
(r318278)
@@ -598,7 +598,7 @@ to_mb(char *mb, wchar_t wc)
int rv;
 
if ((rv = _tomb(mb, wc)) < 0) {
-   errf(widemsg);
+   warn("%s", widemsg);
free(widemsg);
widemsg = NULL;
}
@@ -614,7 +614,7 @@ to_mb_string(const wchar_t *wcs)
 
mbs = malloc((wcslen(wcs) * mb_cur_max) + 1);
if (mbs == NULL) {
-   errf("out of memory");
+   warn("out of memory");
return (NULL);
}
ptr = mbs;
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318276 - head/sys/dev/usb/controller

2017-05-14 Thread Marius Strobl
Author: marius
Date: Sun May 14 14:27:59 2017
New Revision: 318276
URL: https://svnweb.freebsd.org/changeset/base/318276

Log:
  Describe Intel Apollo Lake and Braswell USB 3.0 controllers.

Modified:
  head/sys/dev/usb/controller/xhci_pci.c

Modified: head/sys/dev/usb/controller/xhci_pci.c
==
--- head/sys/dev/usb/controller/xhci_pci.c  Sun May 14 14:21:11 2017
(r318275)
+++ head/sys/dev/usb/controller/xhci_pci.c  Sun May 14 14:27:59 2017
(r318276)
@@ -116,6 +116,10 @@ xhci_pci_match(device_t self)
case 0x9c318086:
case 0x1e318086:
return ("Intel Panther Point USB 3.0 controller");
+   case 0x22b58086:
+   return ("Intel Braswell USB 3.0 controller");
+   case 0x5aa88086:
+   return ("Intel Apollo Lake USB 3.0 controller");
case 0x8c318086:
return ("Intel Lynx Point USB 3.0 controller");
case 0x8cb18086:
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


Re: svn commit: r318262 - head/usr.sbin/mountd

2017-05-14 Thread Rick Macklem
Oh, and if the commit doesn't get reverted, I do plan on committing a
change to the exports.5 man page. I just held off on that until the dust
settles.

I had expected more discussion on freebsd-current@ w.r.t. this, but after
several days of no messages, I went ahead with what the two responders
seemed to support.

rick

From: Bruce Evans 
Sent: Saturday, May 13, 2017 11:35:00 PM
To: Rick Macklem
Cc: src-committ...@freebsd.org; svn-src-...@freebsd.org; 
svn-src-head@freebsd.org
Subject: Re: svn commit: r318262 - head/usr.sbin/mountd

On Sun, 14 May 2017, Rick Macklem wrote:

> Log:
>  Change the default uid/gid values for nobody/nogroup to 65534/65533.
>
>  The default values found in /etc/passwd and /etc/group are 65534, 65533.
>  In mountd.c, the defaults were -2, which was 65534 back when uid_t was 
> 16bits.
>  Without this patch, a file created by root on an NFS exported volume without
>  the "-root=" export option will end up owned by uid 4**32 - 2.
>  When discussed on freebsd-current@, it seemed that users preferred the
>  values being changed to 65534/65533.

I got used to 4294967294.  The large number makes it easy to see files
created by root on another system.  I mostly use nfs without maproot, and
create such files often using tmp directories to transfer files.

>  I have not added code to acquire these values from the databases, since
>  the mountd daemon might get "stuck" during startup waiting for a 
> non-responsive
>  password database server.
>
>  Discussed on:freebsd-current
>
> Modified:
>  head/usr.sbin/mountd/mountd.c

exports(5) is not modified, so still documents -2:-2 but not the actual
value of 4294967294:4294967294.  It seems dangerous to change the documented
default.

What happens if the server only supports 16-bit (or 15-bit, or 8-bit) uids?

> Modified: head/usr.sbin/mountd/mountd.c
> ==
> --- head/usr.sbin/mountd/mountd.c Sun May 14 00:23:27 2017
> (r318261)
> +++ head/usr.sbin/mountd/mountd.c Sun May 14 00:38:41 2017
> (r318262)
> @@ -230,9 +230,9 @@ static char **exnames;
> static char **hosts = NULL;
> static struct xucred def_anon = {
>   XUCRED_VERSION,
> - (uid_t)-2,
> + (uid_t)65534,
>   1,
> - { (gid_t)-2 },
> + { (gid_t)65533 },
>   NULL
> };
> static int force_v2 = 0;

The casts are now bogus.  They might have been needed to avoid warnings
about possible sign extension bugs...

> @@ -2893,8 +2893,8 @@ parsecred(char *namelist, struct xucred
>   /*
>* Set up the unprivileged user.
>*/
> - cr->cr_uid = -2;
> - cr->cr_groups[0] = -2;
> + cr->cr_uid = 65534;
> + cr->cr_groups[0] = 65533;
>   cr->cr_ngroups = 1;
>   /*
>* Get the user's password table entry.

But there were no casts here, and the warnings should be the same.

Bruce
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318269 - in head/bin/sh: . tests/builtins

2017-05-14 Thread Jilles Tjoelker
Author: jilles
Date: Sun May 14 13:14:19 2017
New Revision: 318269
URL: https://svnweb.freebsd.org/changeset/base/318269

Log:
  sh: Fix '-' from quoted arithmetic in case/glob pattern range.
  
  It does not make much sense to generate the '-' in a pattern bracket
  expression using arithmetic expansion, but it does not make sense to forbid
  it either.
  
  Try to avoid reprocessing the string if it is unnecessary.

Added:
  head/bin/sh/tests/builtins/case22.0   (contents, props changed)
Modified:
  head/bin/sh/expand.c
  head/bin/sh/tests/builtins/Makefile

Modified: head/bin/sh/expand.c
==
--- head/bin/sh/expand.cSun May 14 12:41:58 2017(r318268)
+++ head/bin/sh/expand.cSun May 14 13:14:19 2017(r318269)
@@ -440,8 +440,15 @@ expari(const char *p, struct nodelist **
fmtstr(expdest, DIGITS(result), ARITH_FORMAT_STR, result);
adj = strlen(expdest);
STADJUST(adj, expdest);
-   if (!quoted)
-   reprocess(expdest - adj - stackblock(), flag, VSNORMAL, 0, dst);
+   /*
+* If this is quoted, a '-' must not indicate a range in [...].
+* If this is not quoted, splitting may occur.
+*/
+   if (quoted ?
+   result < 0 && begoff > 1 && flag & (EXP_GLOB | EXP_CASE) :
+   flag & EXP_SPLIT)
+   reprocess(expdest - adj - stackblock(), flag, VSNORMAL, quoted,
+   dst);
return p;
 }
 

Modified: head/bin/sh/tests/builtins/Makefile
==
--- head/bin/sh/tests/builtins/Makefile Sun May 14 12:41:58 2017
(r318268)
+++ head/bin/sh/tests/builtins/Makefile Sun May 14 13:14:19 2017
(r318269)
@@ -41,6 +41,7 @@ ${PACKAGE}FILES+= case18.0
 ${PACKAGE}FILES+=  case19.0
 ${PACKAGE}FILES+=  case20.0
 ${PACKAGE}FILES+=  case21.0
+${PACKAGE}FILES+=  case22.0
 ${PACKAGE}FILES+=  cd1.0
 ${PACKAGE}FILES+=  cd2.0
 ${PACKAGE}FILES+=  cd3.0

Added: head/bin/sh/tests/builtins/case22.0
==
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ head/bin/sh/tests/builtins/case22.0 Sun May 14 13:14:19 2017
(r318269)
@@ -0,0 +1,10 @@
+# $FreeBSD$
+
+case 5 in
+[0"$((-9))"]) echo bad1 ;;
+esac
+
+case - in
+[0"$((-9))"]) ;;
+*) echo bad2 ;;
+esac
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"


svn commit: r318263 - head/sys/dev/cxgbe

2017-05-14 Thread Navdeep Parhar
Author: np
Date: Sun May 14 09:07:13 2017
New Revision: 318263
URL: https://svnweb.freebsd.org/changeset/base/318263

Log:
  cxgbe(4): netmap-only interrupts for a VI do not have an associated rxq
  or ofld_rxq and should be ignored by vi_intr_iq.
  
  MFC after:3 days.
  Sponsored by: Chelsio Communications

Modified:
  head/sys/dev/cxgbe/t4_sge.c

Modified: head/sys/dev/cxgbe/t4_sge.c
==
--- head/sys/dev/cxgbe/t4_sge.c Sun May 14 00:38:41 2017(r318262)
+++ head/sys/dev/cxgbe/t4_sge.c Sun May 14 09:07:13 2017(r318263)
@@ -969,6 +969,11 @@ vi_intr_iq(struct vi_info *vi, int idx)
return (>sge.fwq);
 
nintr = vi->nintr;
+#ifdef DEV_NETMAP
+   /* Do not consider any netmap-only interrupts */
+   if (vi->flags & INTR_RXQ && vi->nnmrxq > vi->nrxq)
+   nintr -= vi->nnmrxq - vi->nrxq;
+#endif
KASSERT(nintr != 0,
("%s: vi %p has no exclusive interrupts, total interrupts = %d",
__func__, vi, sc->intr_count));
___
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"