Re: sqlite3 update

2016-06-03 Thread Stuart Henderson
On 2016/06/03 20:17, James Turner wrote:
> I personally think this is the way to go. Sadly I don't have the time to
> do this right now (We just welcomed our second child recently).

Heh. One doesn't really prepare you for two :-)



kern continue

2016-06-03 Thread Ted Unangst
a few more here and there.


Index: ddb/db_examine.c
===
RCS file: /cvs/src/sys/ddb/db_examine.c,v
retrieving revision 1.21
diff -u -p -r1.21 db_examine.c
--- ddb/db_examine.c19 Apr 2016 12:23:25 -  1.21
+++ ddb/db_examine.c4 Jun 2016 01:28:06 -
@@ -277,7 +277,7 @@ db_strlcpy(char *dst, const char *src, s
if (siz != 0)
*d = '\0';  /* NUL-terminate dst */
while (*s++)
-   ;
+   continue;
}
 
return(s - src - 1);/* count does not include NUL */
Index: dev/hotplug.c
===
RCS file: /cvs/src/sys/dev/hotplug.c,v
retrieving revision 1.15
diff -u -p -r1.15 hotplug.c
--- dev/hotplug.c   14 Mar 2015 03:38:46 -  1.15
+++ dev/hotplug.c   4 Jun 2016 01:28:12 -
@@ -134,7 +134,7 @@ hotplugclose(dev_t dev, int flag, int mo
struct hotplug_event he;
 
while (hotplug_get_event() == 0)
-   ;
+   continue;
opened = 0;
return (0);
 }
Index: dev/ipmi.c
===
RCS file: /cvs/src/sys/dev/ipmi.c,v
retrieving revision 1.96
diff -u -p -r1.96 ipmi.c
--- dev/ipmi.c  27 Mar 2016 12:45:47 -  1.96
+++ dev/ipmi.c  4 Jun 2016 01:28:16 -
@@ -640,7 +640,7 @@ kcs_wait(struct ipmi_softc *sc, u_int8_t
if ((v & KCS_STATE_MASK) == KCS_ERROR_STATE) {
bmc_write(sc, _KCS_COMMAND_REGISTER, KCS_GET_STATUS);
while (bmc_read(sc, _KCS_STATUS_REGISTER) & KCS_IBF)
-   ;
+   continue;
printf("%s: error code: %x\n", DEVNAME(sc),
bmc_read(sc, _KCS_DATAIN_REGISTER));
}
Index: kern/kern_pledge.c
===
RCS file: /cvs/src/sys/kern/kern_pledge.c,v
retrieving revision 1.167
diff -u -p -r1.167 kern_pledge.c
--- kern/kern_pledge.c  27 May 2016 16:33:55 -  1.167
+++ kern/kern_pledge.c  4 Jun 2016 01:28:21 -
@@ -1601,7 +1601,7 @@ canonpath(const char *input, char *buf, 
p += 3;
if (q != buf)   /* "/../" at start of buf */
while (*--q != '/')
-   ;
+   continue;
 
} else {
*q++ = *p++;
Index: kern/kgdb_stub.c
===
RCS file: /cvs/src/sys/kern/kgdb_stub.c,v
retrieving revision 1.10
diff -u -p -r1.10 kgdb_stub.c
--- kern/kgdb_stub.c7 Mar 2016 18:43:59 -   1.10
+++ kern/kgdb_stub.c4 Jun 2016 01:28:26 -
@@ -240,7 +240,7 @@ kgdb_recv(u_char *bp, int maxlen)
p = bp;
csum = len = 0;
while ((c = GETC()) != KGDB_START)
-   ;
+   continue;
 
while ((c = GETC()) != KGDB_END && len < maxlen) {
c &= 0x7f;
Index: kern/vfs_bio.c
===
RCS file: /cvs/src/sys/kern/vfs_bio.c,v
retrieving revision 1.174
diff -u -p -r1.174 vfs_bio.c
--- kern/vfs_bio.c  17 Mar 2016 03:57:51 -  1.174
+++ kern/vfs_bio.c  4 Jun 2016 01:28:32 -
@@ -908,7 +908,7 @@ geteblk(int size)
struct buf *bp;
 
while ((bp = buf_get(NULL, 0, size)) == NULL)
-   ;
+   continue;
 
return (bp);
 }
@@ -1319,7 +1319,7 @@ bufcache_adjust(void)
[i].warmbufpages) ||
chillbufs([i], [i].hotqueue,
[i].hotbufpages))
-   ;
+   continue;
}
 }
 
Index: net/pf.c
===
RCS file: /cvs/src/sys/net/pf.c,v
retrieving revision 1.974
diff -u -p -r1.974 pf.c
--- net/pf.c31 May 2016 07:35:36 -  1.974
+++ net/pf.c4 Jun 2016 01:28:57 -
@@ -3867,7 +3867,7 @@ pf_tcp_track_full(struct pf_pdesc *pd, s
if (dst->seqdiff && !src->seqdiff) {
/* use random iss for the TCP server */
while ((src->seqdiff = arc4random() - seq) == 0)
-   ;
+   continue;
ack = ntohl(th->th_ack) - dst->seqdiff;
pf_change_a(pd, >th_seq, htonl(seq + src->seqdiff));
pf_change_a(pd, >th_ack, htonl(ack));
Index: net/rtable.c
===
RCS file: /cvs/src/sys/net/rtable.c,v
retrieving revision 1.42
diff -u -p -r1.42 rtable.c
--- net/rtable.c18 May 2016 03:46:03 -  1.42
+++ net/rtable.c4 Jun 2016 

more continue loops

2016-06-03 Thread Ted Unangst
this is in sbin. i left csh and ksh in bin for some other brave soul.


Index: dump/main.c
===
RCS file: /cvs/src/sbin/dump/main.c,v
retrieving revision 1.57
diff -u -p -r1.57 main.c
--- dump/main.c 20 Aug 2015 22:02:20 -  1.57
+++ dump/main.c 4 Jun 2016 00:19:31 -
@@ -769,7 +769,7 @@ obsolete(int *argcp, char **argvp[])
 
/* Copy remaining arguments. */
while ((*nargv++ = *argv++))
-   ;
+   continue;
 
/* Update argument count. */
*argcp = nargv - *argvp - 1;
Index: fsdb/fsdb.c
===
RCS file: /cvs/src/sbin/fsdb/fsdb.c,v
retrieving revision 1.29
diff -u -p -r1.29 fsdb.c
--- fsdb/fsdb.c 20 Jan 2015 18:22:21 -  1.29
+++ fsdb/fsdb.c 4 Jun 2016 00:16:30 -
@@ -451,7 +451,7 @@ CMDFUNCSTART(focusname)
}
for (p = argv[1]; p != NULL;) {
while ((val = strsep(, "/")) != NULL && *val == '\0')
-   ;
+   continue;
if (val) {
printf("component `%s': ", val);
fflush(stdout);
Index: nfsd/nfsd.c
===
RCS file: /cvs/src/sbin/nfsd/nfsd.c,v
retrieving revision 1.35
diff -u -p -r1.35 nfsd.c
--- nfsd/nfsd.c 16 Jan 2015 06:40:00 -  1.35
+++ nfsd/nfsd.c 4 Jun 2016 00:16:35 -
@@ -342,6 +342,6 @@ reapchild(int signo)
int save_errno = errno;
 
while (wait3(NULL, WNOHANG, NULL) > 0)
-   ;
+   continue;
errno = save_errno;
 }
Index: restore/main.c
===
RCS file: /cvs/src/sbin/restore/main.c,v
retrieving revision 1.23
diff -u -p -r1.23 main.c
--- restore/main.c  20 Jan 2015 18:22:21 -  1.23
+++ restore/main.c  4 Jun 2016 00:16:43 -
@@ -88,7 +88,7 @@ main(int argc, char *argv[])
if ((tmpdir = strdup(tmpdir)) == NULL)
err(1, NULL);
for (p = tmpdir + strlen(tmpdir) - 1; p >= tmpdir && *p == '/'; p--)
-   ;
+   continue;
obsolete(, );
while ((ch = getopt(argc, argv, "b:cdf:himNRrs:tvxy")) != -1)
switch(ch) {
@@ -344,7 +344,7 @@ obsolete(int *argcp, char **argvp[])
 
/* Copy remaining arguments. */
while ((*nargv++ = *argv++))
-   ;
+   continue;
 
/* Update argument count. */
*argcp = nargv - *argvp - 1;
Index: route/route.c
===
RCS file: /cvs/src/sbin/route/route.c,v
retrieving revision 1.182
diff -u -p -r1.182 route.c
--- route/route.c   3 Dec 2015 08:00:49 -   1.182
+++ route/route.c   4 Jun 2016 00:16:49 -
@@ -763,7 +763,7 @@ inet_makenetandmask(u_int32_t net, struc
sin->sin_family = 0;
cp = (char *)(>sin_addr + 1);
while (*--cp == '\0' && cp > (char *)sin)
-   ;
+   continue;
sin->sin_len = 1 + cp - (char *)sin;
 }
 
Index: scsi/scsi.c
===
RCS file: /cvs/src/sbin/scsi/scsi.c,v
retrieving revision 1.29
diff -u -p -r1.29 scsi.c
--- scsi/scsi.c 20 Nov 2014 15:22:39 -  1.29
+++ scsi/scsi.c 4 Jun 2016 00:16:55 -
@@ -442,11 +442,11 @@ skipwhite(FILE *f)
 skip_again:
 
while (isspace(c = getc(f)))
-   ;
+   continue;
 
if (c == '#') {
while ((c = getc(f)) != '\n' && c != EOF)
-   ;
+   continue;
goto skip_again;
}
 



Re: sqlite3 update

2016-06-03 Thread James Turner
On Fri, Jun 03, 2016 at 11:24:15PM +0100, Stuart Henderson wrote:
> On 2016/06/01 11:22, Stuart Henderson wrote:
> > On 2016/06/01 09:09, Landry Breuil wrote:
> > > And most importantly, 47 (released next week) requires 3.11.
> > > /usr/obj/ports/firefox-47.0beta9/firefox-47.0b9/old-configure:SQLITE_VERSION=3.11.0
> > 
> > Ok, I'll update the diff this evening.
> 
> So this was a bit optimistic... 3.11 and 3.13 start making more
> changes to the Tcl scripts that replaced the awk scripts and it's
> beyond my awk to replicate them. (Also I'm not too sure about the
> XXX in Makefile about lempar.c which has changed upstream since
> the version where we added it).
> 
> As I see it there are two options to get us out of the hole.
> 
> - Pregenerate the files with Tcl and commit them, adapting the
> Makefile to use them. This is looking possible for 3.11 though
> still a bit of a pain to handle the build system hacks that
> will be needed. From a quick look at 3.13 there are more build
> system changes and further changes to the Tcl. I for one am
> not going to be able to maintain a forked build system with
> this many moving pieces.
> 
> - Switch to the "amalgamation" (4 source files: 3 for the lib,
> one for the shell), which is what upstream push people towards
> using (and what everybody else that I've seen including
> sqlite source uses).
> 
> With this the main file is unfortunately huge but would be easier
> by far to update later. Note that we only have a small change to
> the actual source code (replacing the RNG code) which is easy enough
> to carry across. Most of our changes are to the build infrastructure.
> 
> As far as Firefox goes, I think sqlite 3.11 should do us until
> release, but might be problematic if we want to update in -stable
> ports.
> 
> From what I can tell sqlite upstream *are* careful about ABI.
> But it would seem quite a stretch to expect things to work
> safely/reliably with two different versions brought into
> one address space.
> 

So when I talked with Ingo about removing SQLite from base we talked
about imported the "amalgamation" into mandoc for local use only and
then removing lib/libsqlite3 and usr.bin/sqlite3.

We would then need to updated sqlite3 in ports and update ports to use
this instead.

I personally think this is the way to go. Sadly I don't have the time to
do this right now (We just welcomed our second child recently).

-- 
James Turner



Re: video(1) query only diff

2016-06-03 Thread Dmitrij D. Czarkoff
Marcus Glocker said:
> Sometimes I just would like to query a video device for it's properties
> without starting a stream to see what's supported and evt. make a
> decision afterwards how to start the stream.
> 
> This diff adds the 'q' option to video(1) for this purpose to just
> query the device, display the results, and quit.
> 
> Anyone else find this useful?

I had this in my plans.

Tested on amd64 with Ricoh laptop camera (5986:03b4).  OK czarkoff@.

> Index: video.1
> ===
> RCS file: /cvs/xenocara/app/video/video.1,v
> retrieving revision 1.12
> diff -u -p -u -p -r1.12 video.1
> --- video.1   31 May 2016 06:47:12 -  1.12
> +++ video.1   3 Jun 2016 12:21:59 -
> @@ -25,7 +25,7 @@
>  .Sh SYNOPSIS
>  .Nm
>  .Bk -words
> -.Op Fl \
> +.Op Fl \
>  .Op Fl a Ar adaptor
>  .Op Fl e Ar encoding
>  .Op Fl f Ar file
> @@ -133,6 +133,9 @@ If
>  is
>  .Ql - ,
>  frames will be written to standard output.
> +.It Fl q
> +Query for encodings, frame sizes/rates, and controls.
> +Display them and quit.
>  .It Fl R
>  Disable frame rate adjustment.
>  .It Fl r Ar rate
> Index: video.c
> ===
> RCS file: /cvs/xenocara/app/video/video.c,v
> retrieving revision 1.16
> diff -u -p -u -p -r1.16 video.c
> --- video.c   2 Jun 2016 08:53:32 -   1.16
> +++ video.c   3 Jun 2016 12:21:59 -
> @@ -169,6 +169,7 @@ struct video {
>  #define M_OUT_XV 0x2
>  #define M_IN_FILE0x4
>  #define M_OUT_FILE   0x8
> +#define M_QUERY  0x10
>   int  mode;
>   int  verbose;
>  };
> @@ -186,6 +187,7 @@ int dev_get_sizes(struct video *);
>  int dev_get_rates(struct video *);
>  int dev_get_ctrls(struct video *);
>  void dev_dump_info(struct video *);
> +void dev_dump_query(struct video *);
>  int dev_init(struct video *);
>  void dev_set_ctrl(struct video *, int, int);
>  void dev_reset_ctrls(struct video *);
> @@ -213,7 +215,7 @@ extern char *__progname;
>  void
>  usage(void)
>  {
> - fprintf(stderr, "usage: %s [-gRv] "
> + fprintf(stderr, "usage: %s [-gqRv] "
>   "[-a adaptor] [-e encoding] [-f file] [-i input] [-O output]\n"
>   "   %*s [-o output] [-r rate] [-s size]\n", __progname,
>   (int)strlen(__progname), "");
> @@ -1024,6 +1026,24 @@ dev_dump_info(struct video *vid)
>   fprintf(stderr, "\n");
>  }
>  
> +void
> +dev_dump_query(struct video *vid)
> +{
> + if (!dev_check_caps(vid))
> + return;
> + if (!dev_get_encs(vid))
> + return;
> + if (!choose_enc(vid))
> + return;
> + if (!dev_get_sizes(vid))
> + return;
> + if (!dev_get_rates(vid))
> + return;
> + if (!dev_get_ctrls(vid))
> + return;
> + dev_dump_info(vid);
> +}
> +
>  int
>  dev_init(struct video *vid)
>  {
> @@ -1757,7 +1777,7 @@ main(int argc, char *argv[])
>   vid.mmap_on = 1; /* mmap method is default */
>   wout = 1;
>  
> - while ((ch = getopt(argc, argv, "gvRa:e:f:i:O:o:r:s:")) != -1) {
> + while ((ch = getopt(argc, argv, "gqRva:e:f:i:O:o:r:s:")) != -1) {
>   switch (ch) {
>   case 'a':
>   x->cur_adap = strtonum(optarg, 0, 4, );
> @@ -1802,6 +1822,10 @@ main(int argc, char *argv[])
>   optarg);
>   }
>   break;
> + case 'q':
> + vid.mode |= M_QUERY;
> + vid.mode &= ~M_OUT_XV;
> + break;
>   case 'R':
>   vid.nofps = 1;
>   break;
> @@ -1831,6 +1855,11 @@ main(int argc, char *argv[])
>   }
>   argc -= optind;
>   argv += optind;
> +
> + if (vid.mode & M_QUERY) {
> + dev_dump_query();
> + cleanup(, 0);
> + }
>  
>   if (vid.fps == 0)
>   vid.nofps = 1;
> 

-- 
Dmitrij D. Czarkoff



Re: sqlite3 update

2016-06-03 Thread Stuart Henderson
On 2016/06/01 11:22, Stuart Henderson wrote:
> On 2016/06/01 09:09, Landry Breuil wrote:
> > And most importantly, 47 (released next week) requires 3.11.
> > /usr/obj/ports/firefox-47.0beta9/firefox-47.0b9/old-configure:SQLITE_VERSION=3.11.0
> 
> Ok, I'll update the diff this evening.

So this was a bit optimistic... 3.11 and 3.13 start making more
changes to the Tcl scripts that replaced the awk scripts and it's
beyond my awk to replicate them. (Also I'm not too sure about the
XXX in Makefile about lempar.c which has changed upstream since
the version where we added it).

As I see it there are two options to get us out of the hole.

- Pregenerate the files with Tcl and commit them, adapting the
Makefile to use them. This is looking possible for 3.11 though
still a bit of a pain to handle the build system hacks that
will be needed. From a quick look at 3.13 there are more build
system changes and further changes to the Tcl. I for one am
not going to be able to maintain a forked build system with
this many moving pieces.

- Switch to the "amalgamation" (4 source files: 3 for the lib,
one for the shell), which is what upstream push people towards
using (and what everybody else that I've seen including
sqlite source uses).

With this the main file is unfortunately huge but would be easier
by far to update later. Note that we only have a small change to
the actual source code (replacing the RNG code) which is easy enough
to carry across. Most of our changes are to the build infrastructure.

As far as Firefox goes, I think sqlite 3.11 should do us until
release, but might be problematic if we want to update in -stable
ports.

>From what I can tell sqlite upstream *are* careful about ABI.
But it would seem quite a stretch to expect things to work
safely/reliably with two different versions brought into
one address space.



Re: iwn(4) HT protection updates

2016-06-03 Thread Stefan Sperling
On Fri, Jun 03, 2016 at 07:59:22PM +0200, Marcus MERIGHI wrote:
> I saved the tcpdump and a more detailed report in case you want it. 

Thanks for testing! I've committed the change.

> after a added urtwn0 (hey, another five-letter device :-).

Yeah. I don't really like the name of that driver ;)



Re: iwn(4) HT protection updates

2016-06-03 Thread Marcus MERIGHI
s...@stsp.name (Stefan Sperling), 2016.06.03 (Fri) 17:27 (CEST):
> On Fri, Jun 03, 2016 at 04:54:13PM +0200, Marcus MERIGHI wrote:
> > s...@stsp.name (Stefan Sperling), 2016.06.03 (Fri) 11:19 (CEST):
> > > Currently, iwn(4) does not track HT protection changes because the
> > > support code was broken and hence disabled.
> > > 
> > > Here's a fixed version which should allow us to enable HT protection
> > > updates again.
> > 
> > I'm not sure this was a call for testing. If it was:
> > 
> > Works here and I see no change in behavior. 

short: My gut feeling and tcpbench do not see a loss of quality. 
 
what I did: restart; start tcpdump and tcpbench; config iwn0; start
tcpdump; check netstat/tcpbench; insert/config run0; check
netstat/tcpbench; insert/config urtwn0; check netstat/tcpbench; stop
tcpdump; stop tcpbench; run tcpdump -r ... | grep ... | wc -l. 

I saved the tcpdump and a more detailed report in case you want it. 

> How many 'HT protection changes' are counted in 'netstat -W iwn0'?

First '0' (only iwn0). Then '1' after I added run0 and it stayed there
after a added urtwn0 (hey, another five-letter device :-).
Though now it's at 2, about half an hour later.

> While associated, the current protection mode can be seen with tcpdump:
> tcpdump -n -i iwn0 -s 4096 -y IEEE802_11_RADIO -vv subtype beacon 
> In the 'htop=' field, look for any of these strings:

Thanks for the instructions!
after testing it showed the following number of lines:

>   protect non-member

3649

>   protect 20MHz

0

>   protect non-HT

7895

> If none of those is printed, HT protection is disabled.
> An 11g device on the channel will always force it to "protect non-HT".
> 
> To trigger a change, try associating an additional 11g device to your AP
> while already associated with iwn0 in 11n mode.
> The counter in netstat -W iwn0 should go up, unless you already had 11g
> clients on the same channel because then protection settings won't change.
> If it's always "protect non-HT", you might have more luck after setting
> the AP to a different channel where no 11g client exists.
> 
> The question is:
> Does an HT protection change affect the quality of your iwn0 wifi connection?
> It should not.

My gut feeling and tcpbench do not see a loss of quality. 

Thank you once more, Marcus



x99token login_token etc.

2016-06-03 Thread Ted Unangst
We have a bunch of DES token utilities which were probably useful circa 1995
with diminishing utility over the course of the next decade, followed by a
decade in which I suspect they were of very dminished utility. I think we can
purge these, and if people really, really need them, they can live in ports.

However, before anything happens, I'd like to double check that my guess about
their use is correct. Is anybody still using any of these old DES token tools?

(This is unrelated to s/key.)

Affected utilities to remove include:
x99token
login_token
token_adm
tokeninit



Re: iwn(4) HT protection updates

2016-06-03 Thread Marcus MERIGHI
s...@stsp.name (Stefan Sperling), 2016.06.03 (Fri) 11:19 (CEST):
> Currently, iwn(4) does not track HT protection changes because the
> support code was broken and hence disabled.
> 
> Here's a fixed version which should allow us to enable HT protection
> updates again.

I'm not sure this was a call for testing. If it was:

Works here and I see no change in behavior. 

(under kernel #2165: cvs up, apply patch, config, make, move, boot)

lenovo x200s

iwn0 at pci2 dev 0 function 0 "Intel WiFi Link 5300" rev 0x00: msi, MIMO
  3T3R, MoW, address 00:21:6a:xx:yy:zz

iwn0: flags=8843 mtu 1500
lladdr 00:21:6a:xx:yy:zz
index 2 priority 4
groups: wlan egress
media: IEEE802.11 autoselect (HT-MCS7 mode 11n)
status: active
ieee80211: nwid foobar chan 6 bssid e2:46:9a:8c:59:c8 -51dBm
  wpakey  wpaprotos wpa1,wpa2 wpaakms psk
  wpaciphers tkip,ccmp wpagroupcipher tkip
inet 192.168.188.128 netmask 0xff00 broadcast
  192.168.188.255

OpenBSD 6.0-beta (GENERIC.MP) #11: Fri Jun  3 16:38:17 CEST 2016
foo@bar:/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4166717440 (3973MB)
avail mem = 4035948544 (3848MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.4 @ 0xe0010 (68 entries)
bios0: vendor LENOVO version "6DET72WW (3.22 )" date 10/25/2012
bios0: LENOVO 7470W1W
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP SSDT ECDT APIC MCFG HPET SLIC BOOT ASF! SSDT
  TCPA DMAR SSDT SSDT SSDT
acpi0: wakeup devices LID_(S3) SLPB(S3) IGBE(S4) EXP0(S4) EXP1(S4)
  EXP2(S4) EXP3(S4) USB0(S3) USB3(S3) USB5(S3) EHC0(S3) EHC1(S3) HDEF(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU L9400 @ 1.86GHz, 1862.26 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu0: 6MB 64b/line 16-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 7 var ranges, 88 fixed ranges
cpu0: apic clock running at 265MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2.1.3, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU L9400 @ 1.86GHz, 1862.00 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,SMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR
cpu1: 6MB 64b/line 16-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (AGP_)
acpiprt2 at acpi0: bus 2 (EXP0)
acpiprt3 at acpi0: bus 3 (EXP1)
acpiprt4 at acpi0: bus -1 (EXP2)
acpiprt5 at acpi0: bus 5 (EXP3)
acpicpu0 at acpi0: !C3(100@57 mwait.3@0x30), !C2(500@1 mwait.1@0x10), C1(1000@1 
mwait.1), PSS
acpicpu1 at acpi0: !C3(100@57 mwait.3@0x30), !C2(500@1 mwait.1@0x10), C1(1000@1 
mwait.1), PSS
acpipwrres0 at acpi0: PUBS, resource for USB0, USB3, USB5, EHC0, EHC1
acpitz0 at acpi0: critical temperature is 127 degC
acpitz1 at acpi0: critical temperature is 104 degC
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
"PNP0303" at acpi0 not configured
"IBM3780" at acpi0 not configured
acpibat0 at acpi0: BAT0 model "93P5030" serial   165 type LION oem "SANYO"
acpiac0 at acpi0: AC unit online
acpithinkpad0 at acpi0
"PNP0C14" at acpi0 not configured
acpidock0 at acpi0: GDCK not docked (0)
acpivideo0 at acpi0: VID_
acpivout0 at acpivideo0: LCD0
acpivideo1 at acpi0: VID_
cpu0: Enhanced SpeedStep 1862 MHz: speeds: 1867, 1866, 1600, 800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel GM45 Host" rev 0x07
inteldrm0 at pci0 dev 2 function 0 "Intel GM45 Video" rev 0x07
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xd000, size 0x1000
inteldrm0: msi
inteldrm0: 1280x800
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel GM45 Video" rev 0x07 at pci0 dev 2 function 1 not configured
"Intel GM45 HECI" rev 0x07 at pci0 dev 3 function 0 not configured
em0 at pci0 dev 25 function 0 "Intel ICH9 IGP M AMT" rev 0x03: msi, address 
00:1f:16:32:df:5c
uhci0 at pci0 dev 26 function 0 "Intel 82801I USB" rev 0x03: apic 1 int 20
uhci1 at pci0 dev 26 function 1 "Intel 82801I USB" rev 0x03: apic 1 int 21
uhci2 at pci0 dev 26 function 2 "Intel 82801I USB" rev 0x03: apic 1 int 22
ehci0 at pci0 dev 26 function 7 "Intel 82801I USB" rev 0x03: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
azalia0 at pci0 dev 27 

video(1) query only diff

2016-06-03 Thread Marcus Glocker
Sometimes I just would like to query a video device for it's properties
without starting a stream to see what's supported and evt. make a
decision afterwards how to start the stream.

This diff adds the 'q' option to video(1) for this purpose to just
query the device, display the results, and quit.

Anyone else find this useful?


Index: video.1
===
RCS file: /cvs/xenocara/app/video/video.1,v
retrieving revision 1.12
diff -u -p -u -p -r1.12 video.1
--- video.1 31 May 2016 06:47:12 -  1.12
+++ video.1 3 Jun 2016 12:21:59 -
@@ -25,7 +25,7 @@
 .Sh SYNOPSIS
 .Nm
 .Bk -words
-.Op Fl \
+.Op Fl \
 .Op Fl a Ar adaptor
 .Op Fl e Ar encoding
 .Op Fl f Ar file
@@ -133,6 +133,9 @@ If
 is
 .Ql - ,
 frames will be written to standard output.
+.It Fl q
+Query for encodings, frame sizes/rates, and controls.
+Display them and quit.
 .It Fl R
 Disable frame rate adjustment.
 .It Fl r Ar rate
Index: video.c
===
RCS file: /cvs/xenocara/app/video/video.c,v
retrieving revision 1.16
diff -u -p -u -p -r1.16 video.c
--- video.c 2 Jun 2016 08:53:32 -   1.16
+++ video.c 3 Jun 2016 12:21:59 -
@@ -169,6 +169,7 @@ struct video {
 #define M_OUT_XV   0x2
 #define M_IN_FILE  0x4
 #define M_OUT_FILE 0x8
+#define M_QUERY0x10
int  mode;
int  verbose;
 };
@@ -186,6 +187,7 @@ int dev_get_sizes(struct video *);
 int dev_get_rates(struct video *);
 int dev_get_ctrls(struct video *);
 void dev_dump_info(struct video *);
+void dev_dump_query(struct video *);
 int dev_init(struct video *);
 void dev_set_ctrl(struct video *, int, int);
 void dev_reset_ctrls(struct video *);
@@ -213,7 +215,7 @@ extern char *__progname;
 void
 usage(void)
 {
-   fprintf(stderr, "usage: %s [-gRv] "
+   fprintf(stderr, "usage: %s [-gqRv] "
"[-a adaptor] [-e encoding] [-f file] [-i input] [-O output]\n"
"   %*s [-o output] [-r rate] [-s size]\n", __progname,
(int)strlen(__progname), "");
@@ -1024,6 +1026,24 @@ dev_dump_info(struct video *vid)
fprintf(stderr, "\n");
 }
 
+void
+dev_dump_query(struct video *vid)
+{
+   if (!dev_check_caps(vid))
+   return;
+   if (!dev_get_encs(vid))
+   return;
+   if (!choose_enc(vid))
+   return;
+   if (!dev_get_sizes(vid))
+   return;
+   if (!dev_get_rates(vid))
+   return;
+   if (!dev_get_ctrls(vid))
+   return;
+   dev_dump_info(vid);
+}
+
 int
 dev_init(struct video *vid)
 {
@@ -1757,7 +1777,7 @@ main(int argc, char *argv[])
vid.mmap_on = 1; /* mmap method is default */
wout = 1;
 
-   while ((ch = getopt(argc, argv, "gvRa:e:f:i:O:o:r:s:")) != -1) {
+   while ((ch = getopt(argc, argv, "gqRva:e:f:i:O:o:r:s:")) != -1) {
switch (ch) {
case 'a':
x->cur_adap = strtonum(optarg, 0, 4, );
@@ -1802,6 +1822,10 @@ main(int argc, char *argv[])
optarg);
}
break;
+   case 'q':
+   vid.mode |= M_QUERY;
+   vid.mode &= ~M_OUT_XV;
+   break;
case 'R':
vid.nofps = 1;
break;
@@ -1831,6 +1855,11 @@ main(int argc, char *argv[])
}
argc -= optind;
argv += optind;
+
+   if (vid.mode & M_QUERY) {
+   dev_dump_query();
+   cleanup(, 0);
+   }
 
if (vid.fps == 0)
vid.nofps = 1;



Re: bgpd: filter as path with operators

2016-06-03 Thread Stuart Henderson
On 2016/05/31 09:07, Peter Hessler wrote:
> This feature came about because of a talk from Job at NTT during RIPE72,
> where they will be introducing exactly this ruleset on all of their
> links starting in July.

KPN and GTT will also be doing this.



iwn(4) HT protection updates

2016-06-03 Thread Stefan Sperling
Currently, iwn(4) does not track HT protection changes because the
support code was broken and hence disabled.

Here's a fixed version which should allow us to enable HT protection
updates again.

Index: if_iwn.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwn.c,v
retrieving revision 1.165
diff -u -p -r1.165 if_iwn.c
--- if_iwn.c28 Apr 2016 08:28:18 -  1.165
+++ if_iwn.c25 May 2016 18:47:34 -
@@ -5046,11 +5046,8 @@ iwn_delete_key(struct ieee80211com *ic, 
 void
 iwn_update_htprot(struct ieee80211com *ic, struct ieee80211_node *ni)
 {
-   /* XXX Disabled for now. It seems to cause output errors
-* (tx status=0x83) and to make block ack sessions degrade
-* into a half-working state. */
-#if 0
struct iwn_softc *sc = ic->ic_softc;
+   struct iwn_ops *ops = >ops;
enum ieee80211_htprot htprot;
struct iwn_rxon_assoc rxon_assoc;
int s, error;
@@ -5072,11 +5069,19 @@ iwn_update_htprot(struct ieee80211com *i
rxon_assoc.rxchain = sc->rxon.rxchain;
rxon_assoc.acquisition = sc->rxon.acquisition;
 
+   s = splnet();
+
error = iwn_cmd(sc, IWN_CMD_RXON_ASSOC, _assoc,
sizeof(rxon_assoc), 1);
if (error != 0)
printf("%s: RXON_ASSOC command failed\n", sc->sc_dev.dv_xname);
-#endif
+
+   /* All RXONs wipe the firmware's txpower table. Restore it. */
+   error = ops->set_txpower(sc, 1);
+   if (error != 0)
+   printf("%s: could not set TX power\n", sc->sc_dev.dv_xname);
+
+   splx(s);
 }
 
 /*