Re: lock(1): make -n and -t options mutually exclusive

2019-07-04 Thread Theo de Raadt
Klemens Nanni  wrote:

> On Thu, Jul 04, 2019 at 12:43:21PM -0500, Scott Cheloha wrote:
> > It doesn't make sense to allow the user to simultaneously set -n
> > (never time out) and also set -t timeout (release the terminal after
> > timeout minutes).
> Makes sense but the synopsis should probably stay the same.  You could
> simply print usage like chmod(8) or explicitly state their mutual
> exclusiveness in an error message like pfctl(8) does.  I prefer the
> former here.

I agree on that. Being excessively precise with nested [] can be
annoying and hide the simple case.



Re: drm(4), multi-threaded task queues and barriers

2019-07-04 Thread Jonathan Gray
On Wed, Jun 12, 2019 at 09:15:36AM +0200, Mark Kettenis wrote:
> > Date: Wed, 12 Jun 2019 17:04:10 +1000
> > From: Jonathan Gray 
> > 
> > On Tue, Jun 11, 2019 at 09:10:46PM +0200, Mark Kettenis wrote:
> > > The drm(4) codebase really needs multi-threaded task queues since the
> > > code has taks that wait for the completion of other tasks that are
> > > submitted to the same task queue.  Thank you Linux...
> > > 
> > > Unfortunately the code also needs to wait for the completion of
> > > submitted tasks from other threads.  This implemented using
> > > task_barrier(9).  But unfortunately our current implementation only
> > > works for single-threaded task queues.
> > > 
> > > The diff below fixes this by marking the barrier task with a flag and
> > > making sure that all threads of the task queue are syncchronized.
> > > This achived through a TASK_BARRIER flag that simply blocks the
> > > threads until the last unblocked thread sees the flag and executes the
> > > task.
> > > 
> > > The diff also starts 4 threads for each workqueue that gets created by
> > > the drm(4) layer.  The number 4 is a bit arbitrary but it is the
> > > number of threads that Linux creates per CPU for a so-called "unbound"
> > > workqueue which hopefully is enough to always make progress.
> > 
> > Ignoring taskletq and systq use in burner_task/switchtask across
> > drivers and the local only backlight_schedule_update_status(), was it
> > intentional to exclude:
> > 
> > workqueue.h: alloc_workqueue()
> > struct taskq *tq = taskq_create(name, 1, IPL_TTY, 0);
> > workqueue.h: alloc_ordered_workqueue()
> > struct taskq *tq = taskq_create(name, 1, IPL_TTY, 0);
> > workqueue.h:
> > #define system_power_efficient_wq ((struct workqueue_struct *)systq)
> 
> Not entirely.  But I don't want to spawn too many threads...  If this
> diff seems to work, we might want to tweak the numbers a bit to see
> what works best.  Whatever we do, the ordered workqueues need to stay
> single-threaded.

While the non-drm parts of this went in the drm_linux.c and intel_hotplug.c
parts have not.  Was there a particular reason these changes didn't go in?

> 
> > > Please test.  If you experience a "hang" with this diff, please try to
> > > log in to the machine remotely over ssh and send me and jsg@ the
> > > output of "ps -AHwlk".
> > > 
> > > Thanks,
> > > 
> > > Mark
> > > 
> > > 
> > > Index: dev/pci/drm/drm_linux.c
> > > ===
> > > RCS file: /cvs/src/sys/dev/pci/drm/drm_linux.c,v
> > > retrieving revision 1.38
> > > diff -u -p -r1.38 drm_linux.c
> > > --- dev/pci/drm/drm_linux.c   9 Jun 2019 12:58:30 -   1.38
> > > +++ dev/pci/drm/drm_linux.c   11 Jun 2019 18:54:38 -
> > > @@ -1399,15 +1399,15 @@ drm_linux_init(void)
> > >  {
> > >   if (system_wq == NULL) {
> > >   system_wq = (struct workqueue_struct *)
> > > - taskq_create("drmwq", 1, IPL_HIGH, 0);
> > > + taskq_create("drmwq", 4, IPL_HIGH, 0);
> > >   }
> > >   if (system_unbound_wq == NULL) {
> > >   system_unbound_wq = (struct workqueue_struct *)
> > > - taskq_create("drmubwq", 1, IPL_HIGH, 0);
> > > + taskq_create("drmubwq", 4, IPL_HIGH, 0);
> > >   }
> > >   if (system_long_wq == NULL) {
> > >   system_long_wq = (struct workqueue_struct *)
> > > - taskq_create("drmlwq", 1, IPL_HIGH, 0);
> > > + taskq_create("drmlwq", 4, IPL_HIGH, 0);
> > >   }
> > >  
> > >   if (taskletq == NULL)
> > > Index: dev/pci/drm/i915/intel_hotplug.c
> > > ===
> > > RCS file: /cvs/src/sys/dev/pci/drm/i915/intel_hotplug.c,v
> > > retrieving revision 1.2
> > > diff -u -p -r1.2 intel_hotplug.c
> > > --- dev/pci/drm/i915/intel_hotplug.c  14 Apr 2019 10:14:52 -  
> > > 1.2
> > > +++ dev/pci/drm/i915/intel_hotplug.c  11 Jun 2019 18:54:38 -
> > > @@ -619,7 +619,6 @@ void intel_hpd_init_work(struct drm_i915
> > >   INIT_WORK(_priv->hotplug.hotplug_work, i915_hotplug_work_func);
> > >   INIT_WORK(_priv->hotplug.dig_port_work, i915_digport_work_func);
> > >   INIT_WORK(_priv->hotplug.poll_init_work, i915_hpd_poll_init_work);
> > > - dev_priv->hotplug.poll_init_work.tq = systq;
> > >   INIT_DELAYED_WORK(_priv->hotplug.reenable_work,
> > > intel_hpd_irq_storm_reenable_work);
> > >  }
> > > Index: kern/kern_task.c
> > > ===
> > > RCS file: /cvs/src/sys/kern/kern_task.c,v
> > > retrieving revision 1.25
> > > diff -u -p -r1.25 kern_task.c
> > > --- kern/kern_task.c  28 Apr 2019 04:20:40 -  1.25
> > > +++ kern/kern_task.c  11 Jun 2019 18:54:39 -
> > > @@ -43,6 +43,7 @@ struct taskq {
> > >   TQ_S_DESTROYED
> > >   }tq_state;
> > >   unsigned int tq_running;
> > > + unsigned int tq_barrier;
> > >   unsigned 

syslogd unveil cleanup

2019-07-04 Thread Alexander Bluhm
Hi,

When syslogd(8) parent exists, the file cleanup code does not work
anymore.  unveil(2) prevents removal.

Removing the UNIX domain sockets is not necessary.  They are harmless
and unlinked before a new bind.  I removed that code.

/var/run/syslog.pid is a common feature so we want to keep it.
Removing a stale pid file is a good idea.  Adding a constant path
to unveil is not a risk.  So I added a unveil for delete.

Note that the current implemetation triggers a vnode leak in the
kernel.  But that is another story.

ok?

bluhm

Index: usr.sbin/syslogd/privsep.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/privsep.c,v
retrieving revision 1.70
diff -u -p -r1.70 privsep.c
--- usr.sbin/syslogd/privsep.c  28 Jun 2019 13:32:51 -  1.70
+++ usr.sbin/syslogd/privsep.c  4 Jul 2019 20:57:01 -
@@ -190,6 +190,8 @@ priv_exec(char *conf, int numeric, int c
err(1, "unveil");
if (unveil(_PATH_DEV, "rw") == -1)
err(1, "unveil");
+   if (unveil(_PATH_LOGPID, "c") == -1)
+   err(1, "unveil");

/* for pipes */
if (unveil(_PATH_BSHELL, "x") == -1)
@@ -431,12 +433,6 @@ priv_exec(char *conf, int numeric, int c
}

close(sock);
-
-   /* Unlink any domain sockets that have been opened */
-   for (i = 0; i < nunix; i++)
-   (void)unlink(path_unix[i]);
-   if (path_ctlsock != NULL)
-   (void)unlink(path_ctlsock);

if (restart) {
int status;
Index: usr.sbin/syslogd/syslogd.c
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.c,v
retrieving revision 1.261
diff -u -p -r1.261 syslogd.c
--- usr.sbin/syslogd/syslogd.c  2 Jul 2019 13:17:27 -   1.261
+++ usr.sbin/syslogd/syslogd.c  4 Jul 2019 21:03:09 -
@@ -215,8 +215,6 @@ char*TypeNames[] = {
 SIMPLEQ_HEAD(filed_list, filed) Files;
 struct filed consfile;

-intnunix;  /* Number of Unix domain sockets requested */
-char   **path_unix;/* Paths to Unix domain sockets */
 intDebug;  /* debug flag */
 intForeground; /* run in foreground, instead of daemonizing */
 char   LocalHostName[HOST_NAME_MAX+1]; /* our hostname */
@@ -233,7 +231,6 @@ int NoDNS = 0;  /* when true, refrain fr
 intZuluTime = 0;   /* display date and time in UTC ISO format */
 intIncludeHostname = 0;/* include RFC 3164 hostnames when forwarding */
 intFamily = PF_UNSPEC; /* protocol family, may disable IPv4 or IPv6 */
-char   *path_ctlsock = NULL;   /* Path to control socket */

 struct tls *server_ctx;
 struct tls_config *client_config, *server_config;
@@ -372,7 +369,8 @@ main(int argc, char *argv[])
int  ch, i;
int  lockpipe[2] = { -1, -1}, pair[2], nullfd, fd;
int  fd_ctlsock, fd_klog, fd_sendsys, *fd_bind, *fd_listen;
-   int *fd_tls, *fd_unix, nbind, nlisten, ntls;
+   int *fd_tls, *fd_unix, nunix, nbind, nlisten, ntls;
+   char**path_unix, *path_ctlsock;
char**bind_host, **bind_port, **listen_host, **listen_port;
char*tls_hostport, **tls_host, **tls_port;

@@ -386,6 +384,7 @@ main(int argc, char *argv[])
err(1, "malloc %s", _PATH_LOG);
path_unix[0] = _PATH_LOG;
nunix = 1;
+   path_ctlsock = NULL;

bind_host = listen_host = tls_host = NULL;
bind_port = listen_port = tls_port = NULL;
Index: usr.sbin/syslogd/syslogd.h
===
RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.h,v
retrieving revision 1.32
diff -u -p -r1.32 syslogd.h
--- usr.sbin/syslogd/syslogd.h  5 Oct 2017 16:15:24 -   1.32
+++ usr.sbin/syslogd/syslogd.h  4 Jul 2019 20:57:24 -
@@ -44,11 +44,6 @@ void ttymsg(struct iovec *, int, char *)
 void send_fd(int, int);
 int  receive_fd(int);

-/* The list of domain sockets */
-extern int nunix;
-extern char **path_unix;
-extern char *path_ctlsock;
-
 #define ERRBUFSIZE 256
 void vlogmsg(int pri, const char *, const char *, va_list);
 __dead void die(int);



Re: sync acme-client.conf.5 with the example about LE API url

2019-07-04 Thread Solene Rapenne
On Thu, Jul 04, 2019 at 10:52:50PM +0200, Sebastian Benoit wrote:
> Solene Rapenne(sol...@perso.pw) on 2019.07.04 06:56:44 +0200:
> > The example uses acme-v02.api.letsencrypt.org while acme-client.conf(5)
> > still uses v01.
> 
> ups.
> 
> ok benno@
> 
thanks!

I reply in thread because I receive okays but it's committed :)



Re: sync acme-client.conf.5 with the example about LE API url

2019-07-04 Thread Sebastian Benoit
Solene Rapenne(sol...@perso.pw) on 2019.07.04 06:56:44 +0200:
> The example uses acme-v02.api.letsencrypt.org while acme-client.conf(5)
> still uses v01.

ups.

ok benno@

> 
> Index: acme-client.conf.5
> ===
> RCS file: /data/cvs/src/usr.sbin/acme-client/acme-client.conf.5,v
> retrieving revision 1.20
> diff -u -p -r1.20 acme-client.conf.5
> --- acme-client.conf.517 Jun 2019 12:42:52 -  1.20
> +++ acme-client.conf.54 Jul 2019 04:51:15 -
> @@ -63,7 +63,7 @@ Macros are not expanded inside quotes.
>  .Pp
>  For example:
>  .Bd -literal -offset indent
> -api_url="https://acme-v01.api.letsencrypt.org/directory;
> +api_url="https://acme-v02.api.letsencrypt.org/directory;
>  authority letsencrypt {
>   api url $api_url
>   account key "/etc/acme/letsencrypt-privkey.pem"
> 



Re: fix pfctl regress on armv7

2019-07-04 Thread Alexander Bluhm
On Thu, Jul 04, 2019 at 10:03:20PM +0200, Moritz Buhl wrote:
> - yyerror("rule label too long (max %d chars)",
> + yyerror("rule label too long (max %ld chars)",
>   sizeof(r->label)-1);

>   yyerror("rule qname too long (max "
> - "%d chars)", sizeof(r->qname)-1);
> + "%lu chars)", sizeof(r->qname)-1);

>   yyerror("rule pqname too long (max "
> - "%d chars)", sizeof(r->pqname)-1);
> + "%lu chars)", sizeof(r->pqname)-1);

sizeof() format string should be %zu.  otherwise OK bluhm@



Re: cwm: label application windows with command name

2019-07-04 Thread Klemens Nanni
Please disregard the patch, I've already found the first flaw in it.



unveil vnode leak

2019-07-04 Thread Alexander Bluhm
Hi,

If an unlink fails due to unveil, the reference count of the inode
is not decremented.  You cannot unmount the file system anymore.
I have added unveilleak.c that triggers the breakage.

dd if=/dev/zero of=diskimage bs=512 count=4k
vnconfig vnd0 diskimage
newfs vnd0c
mount /dev/vnd0c /mnt
unveilleak /mnt foo
umount /mnt
umount: /mnt: Device busy

Kenrel debug print shows that use count is not 0.

vflush: busy vnode: 0xd50bf2e8, type VDIR, use 1, write 0, hold 1, flags (VROOT)
tag VT_UFS, ino 2, on dev 14, 2 flags 0x100, effnlink 2, nlink 2
mode 040755, owner 0, group 0, size 512

This unveilleak.c program increases use by 1.

#include 

#include 
#include 
#include 
#include 

int
main(int argc, char *argv[])
{
char *dir, *file, *path;
int fd;

if (argc != 3)
errx(2, "missing dir file");

dir = argv[1];
file = argv[2];
if (asprintf(, "%s/%s", dir, file) == -1)
err(1, "asprintf");

fd = open(path, O_WRONLY|O_CREAT, 0755);
if (fd == -1)
err(1, "open %s", dir);
close(fd);

if (unveil(dir, "r") == -1)
err(1, "unveil %s", dir);
if (unveil(NULL, NULL) == -1)
err(1, "unveil NULL");
if (unlink(path) == 0)
errx(1, "unlink %s succeeded", path);

return 0;
}

And this vput(9) in namei(9) fixes the bug.

ok?

bluhm

Index: kern/vfs_lookup.c
===
RCS file: /data/mirror/openbsd/cvs/src/sys/kern/vfs_lookup.c,v
retrieving revision 1.77
diff -u -p -r1.77 vfs_lookup.c
--- kern/vfs_lookup.c   13 May 2019 22:55:27 -  1.77
+++ kern/vfs_lookup.c   4 Jul 2019 20:16:24 -
@@ -262,7 +262,7 @@ fail:
if ((cnp->cn_flags & LOCKPARENT) &&
(cnp->cn_flags & ISLASTCN) &&
(ndp->ni_vp != ndp->ni_dvp))
-   VOP_UNLOCK(ndp->ni_dvp);
+   vput(ndp->ni_dvp);
if (ndp->ni_vp) {
if ((cnp->cn_flags & LOCKLEAF))
vput(ndp->ni_vp);



fix format strings in relayd

2019-07-04 Thread Moritz Buhl
Hi,

as promised a patch to relayd to enable formatting warnings for yyerror.

Greetings,
Moritz Buhl

Index: usr.sbin/relayd/parse.y
===
RCS file: /cvs/src/usr.sbin/relayd/parse.y,v
retrieving revision 1.238
diff -u -p -r1.238 parse.y
--- usr.sbin/relayd/parse.y 31 May 2019 15:25:57 -  1.238
+++ usr.sbin/relayd/parse.y 4 Jul 2019 14:59:36 -
@@ -75,7 +75,9 @@ intpopfile(void);
 int check_file_secrecy(int, const char *);
 int yyparse(void);
 int yylex(void);
-int yyerror(const char *, ...);
+int yyerror(const char *, ...)
+__attribute__((__format__ (printf, 1, 2)))
+__attribute__((__nonnull__ (1)));
 int kw_cmp(const void *, const void *);
 int lookup(char *);
 int igetc(void);
@@ -350,7 +352,7 @@ port: PORT HTTP {
}
| PORT NUMBER {
if ($2 <= 0 || $2 > (int)USHRT_MAX) {
-   yyerror("invalid port: %d", $2);
+   yyerror("invalid port: %lld", $2);
YYERROR;
}
$$.val[0] = htons($2);
@@ -389,7 +391,7 @@ sendbuf : NOTHING   {
 
 main   : INTERVAL NUMBER   {
if ((conf->sc_conf.interval.tv_sec = $2) < 0) {
-   yyerror("invalid interval: %d", $2);
+   yyerror("invalid interval: %lld", $2);
YYERROR;
}
}
@@ -403,7 +405,7 @@ main: INTERVAL NUMBER   {
| PREFORK NUMBER{
if ($2 <= 0 || $2 > PROC_MAX_INSTANCES) {
yyerror("invalid number of preforked "
-   "relays: %d", $2);
+   "relays: %lld", $2);
YYERROR;
}
conf->sc_conf.prefork_relay = $2;
@@ -895,7 +897,7 @@ tablecheck  : ICMP  { table->conf.check 
}
table->conf.check = CHECK_HTTP_CODE;
if ((table->conf.retcode = $5) <= 0) {
-   yyerror("invalid HTTP code: %d", $5);
+   yyerror("invalid HTTP code: %lld", $5);
free($2);
free($3);
YYERROR;
@@ -1094,7 +1096,7 @@ httpflags_l   : httpflags comma httpflags_
 
 httpflags  : HEADERLEN NUMBER  {
if ($2 < 0 || $2 > RELAY_MAXHEADERLENGTH) {
-   yyerror("invalid headerlen: %d", $2);
+   yyerror("invalid headerlen: %lld", $2);
YYERROR;
}
proto->httpheaderlen = $2;
@@ -1115,7 +1117,7 @@ tcpflags  : SACK  { proto->tcpflags |= T
| NO SPLICE { proto->tcpflags |= TCPFLAG_NSPLICE; }
| BACKLOG NUMBER{
if ($2 < 0 || $2 > RELAY_MAX_BACKLOG) {
-   yyerror("invalid backlog: %d", $2);
+   yyerror("invalid backlog: %lld", $2);
YYERROR;
}
proto->tcpbacklog = $2;
@@ -1123,13 +1125,13 @@ tcpflags: SACK  { 
proto->tcpflags |= T
| SOCKET BUFFER NUMBER  {
proto->tcpflags |= TCPFLAG_BUFSIZ;
if ((proto->tcpbufsiz = $3) < 0) {
-   yyerror("invalid socket buffer size: %d", $3);
+   yyerror("invalid socket buffer size: %lld", $3);
YYERROR;
}
}
| IP STRING NUMBER  {
if ($3 < 0) {
-   yyerror("invalid ttl: %d", $3);
+   yyerror("invalid ttl: %lld", $3);
free($2);
YYERROR;
}
@@ -2072,7 +2074,7 @@ routeoptsl: ROUTE addrprefix {
YYERROR;
}
if ($2 < 0 || $2 > RT_TABLEID_MAX) {
-   yyerror("invalid rtable id %d", $2);
+   yyerror("invalid rtable id %lld", $2);
YYERROR;
}
router->rt_conf.rtable = $2;
@@ -2150,7 +2152,7 @@ hostflags : RETRY NUMBER  {

fix pfctl regress on armv7

2019-07-04 Thread Moritz Buhl
Hi,

due to the pfctl regression tests failing on armv7 I noticed that the
yyerror function is having the usual format attributes. This lead to
garbage in error messages on armv7. I added the directives and then
adjusted the formatting to what the compiler suggested.

The same goes for relayd. A patch will follow.

Thanks for feedback and comments,
Moritz Buhl


Index: sbin/pfctl/parse.y
===
RCS file: /cvs/src/sbin/pfctl/parse.y,v
retrieving revision 1.696
diff -u -p -r1.696 parse.y
--- sbin/pfctl/parse.y  8 May 2019 21:31:30 -   1.696
+++ sbin/pfctl/parse.y  4 Jul 2019 14:34:29 -
@@ -83,7 +83,9 @@ intpopfile(void);
 int check_file_secrecy(int, const char *);
 int yyparse(void);
 int yylex(void);
-int yyerror(const char *, ...);
+int yyerror(const char *, ...)
+__attribute__((__format__ (printf, 1, 2)))
+__attribute__((__nonnull__ (1)));
 int kw_cmp(const void *, const void *);
 int lookup(char *);
 int igetc(void);
@@ -1041,7 +1043,7 @@ scrub_opt : NODF  {
YYERROR;
}
if ($2 < 0 || $2 > 255) {
-   yyerror("illegal min-ttl value %d", $2);
+   yyerror("illegal min-ttl value %lld", $2);
YYERROR;
}
scrub_opts.marker |= FOM_MINTTL;
@@ -1053,7 +1055,7 @@ scrub_opt : NODF  {
YYERROR;
}
if ($2 < 0 || $2 > 65535) {
-   yyerror("illegal max-mss value %d", $2);
+   yyerror("illegal max-mss value %lld", $2);
YYERROR;
}
scrub_opts.marker |= FOM_MAXMSS;
@@ -2218,7 +2220,7 @@ filter_set: prio {
YYERROR;
}
if ($2 < 0 || $2 > 0x) {
-   yyerror("illegal delay value %d (0-%u)", $2,
+   yyerror("illegal delay value %lld (0-%u)", $2,
0x);
YYERROR;
}
@@ -2289,7 +2291,7 @@ blockspec : /* empty */   {
}
| RETURNRST '(' TTL NUMBER ')'  {
if ($4 < 0 || $4 > 255) {
-   yyerror("illegal ttl value %d", $4);
+   yyerror("illegal ttl value %lld", $4);
YYERROR;
}
$$.b2 = PFRULE_RETURNRST;
@@ -2339,7 +2341,7 @@ reticmpspec   : STRING{
u_int8_ticmptype;
 
if ($1 < 0 || $1 > 255) {
-   yyerror("invalid icmp code %lu", $1);
+   yyerror("invalid icmp code %lld", $1);
YYERROR;
}
icmptype = returnicmpdefault >> 8;
@@ -2358,7 +2360,7 @@ reticmp6spec  : STRING{
u_int8_ticmptype;
 
if ($1 < 0 || $1 > 255) {
-   yyerror("invalid icmp code %lu", $1);
+   yyerror("invalid icmp code %lld", $1);
YYERROR;
}
icmptype = returnicmp6default >> 8;
@@ -2788,7 +2790,7 @@ host  : STRING{
if (strlcpy($$->addr.v.rtlabelname, $2,
sizeof($$->addr.v.rtlabelname)) >=
sizeof($$->addr.v.rtlabelname)) {
-   yyerror("route label too long, max %u chars",
+   yyerror("route label too long, max %lu chars",
sizeof($$->addr.v.rtlabelname) - 1);
free($2);
free($$);
@@ -3014,7 +3016,7 @@ uid   : STRING{
}
| NUMBER{
if ($1 < 0 || $1 >= UID_MAX) {
-   yyerror("illegal uid value %lu", $1);
+   yyerror("illegal uid value %lld", $1);
YYERROR;
}
$$ = $1;
@@ -3092,7 +3094,7 @@ gid   : STRING{
}
| NUMBER{
if ($1 < 0 || $1 >= GID_MAX) {
-   

ssh-keygen: tweak error for -b

2019-07-04 Thread Christian Weisgerber
Seen on misc@:

> $ ssh-keygen -t ed25519 -b 2
> key bits exceeds maximum 16384

The check for > OPENSSL_RSA_MAX_MODULUS_BITS should only be applied
to RSA keys.  No point in checking for > OPENSSL_DSA_MAX_MODULUS_BITS,
since we only permit 1024-bit DSA keys anyway.

While there, only set DEFAULT_BITS for RSA keys.

ok?

Index: ssh-keygen.c
===
RCS file: /cvs/src/usr.bin/ssh/ssh-keygen.c,v
retrieving revision 1.333
diff -u -p -r1.333 ssh-keygen.c
--- ssh-keygen.c28 Jun 2019 13:35:04 -  1.333
+++ ssh-keygen.c4 Jul 2019 19:38:45 -
@@ -168,30 +168,31 @@ static void
 type_bits_valid(int type, const char *name, u_int32_t *bitsp)
 {
 #ifdef WITH_OPENSSL
-   u_int maxbits, nid;
+   u_int nid;
 #endif
 
if (type == KEY_UNSPEC)
fatal("unknown key type %s", key_type_name);
if (*bitsp == 0) {
 #ifdef WITH_OPENSSL
-   if (type == KEY_DSA)
+   switch(type) {
+   case KEY_DSA:
*bitsp = DEFAULT_BITS_DSA;
-   else if (type == KEY_ECDSA) {
+   break;
+   case KEY_ECDSA:
if (name != NULL &&
(nid = sshkey_ecdsa_nid_from_name(name)) > 0)
*bitsp = sshkey_curve_nid_to_bits(nid);
if (*bitsp == 0)
*bitsp = DEFAULT_BITS_ECDSA;
-   } else
-#endif
+   break;
+   case KEY_RSA:
*bitsp = DEFAULT_BITS;
+   break;
+   }
+#endif
}
 #ifdef WITH_OPENSSL
-   maxbits = (type == KEY_DSA) ?
-   OPENSSL_DSA_MAX_MODULUS_BITS : OPENSSL_RSA_MAX_MODULUS_BITS;
-   if (*bitsp > maxbits)
-   fatal("key bits exceeds maximum %d", maxbits);
switch (type) {
case KEY_DSA:
if (*bitsp != 1024)
@@ -201,6 +202,9 @@ type_bits_valid(int type, const char *na
if (*bitsp < SSH_RSA_MINIMUM_MODULUS_SIZE)
fatal("Invalid RSA key length: minimum is %d bits",
SSH_RSA_MINIMUM_MODULUS_SIZE);
+   else if (*bitsp > OPENSSL_RSA_MAX_MODULUS_BITS)
+   fatal("Invalid RSA key length: maximum is %d bits",
+   OPENSSL_RSA_MAX_MODULUS_BITS);
break;
case KEY_ECDSA:
if (sshkey_ecdsa_bits_to_nid(*bitsp) == -1)
-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



uvideo(4): dynamic max ctrl size

2019-07-04 Thread Patrick Wildt
Hi,

on my Lenovo X395 the uvideo(4) follows the current UVC 1.5 spec.  The
message length was increased with each specification, so now the buffer
for probe messages is up to 48 bytes.  On that particular device the
camera sends a USB stall if we only supply the 26 bytes from the
original UVC 1.0 spec.  By increasing the length depending on the UVC
version, and the other diff I sent, my webcam works fine.

Patrick

diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 1a9dfc733fa..3cb93158955 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -67,6 +67,7 @@ struct uvideo_softc {
struct device   *sc_videodev;
 
int  sc_enabled;
+   int  sc_max_ctrl_size;
int  sc_max_fbuf_size;
int  sc_negotiated_flag;
int  sc_frame_rate;
@@ -725,6 +726,12 @@ uvideo_vc_parse_desc_header(struct uvideo_softc *sc,

sc->sc_desc_vc_header.fix = d;
sc->sc_desc_vc_header.baInterfaceNr = (uByte *)(d + 1);
+   if (UGETW(d->bcdUVC) < 0x0110)
+   sc->sc_max_ctrl_size = 26;
+   else if (UGETW(d->bcdUVC) < 0x0150)
+   sc->sc_max_ctrl_size = 34;
+   else
+   sc->sc_max_ctrl_size = 48;
 
return (USBD_NORMAL_COMPLETION);
 }
@@ -1438,7 +1445,7 @@ uvideo_vs_negotiation(struct uvideo_softc *sc, int commit)
struct usb_video_header_desc *hd;
struct usb_video_frame_desc *frame;
uint8_t *p, *cur;
-   uint8_t probe_data[34];
+   uint8_t probe_data[48];
uint32_t frame_ival, nivals, min, max, step, diff;
usbd_status error;
int i, ival_bytes, changed = 0;
@@ -1622,7 +1629,7 @@ uvideo_vs_set_probe(struct uvideo_softc *sc, uint8_t 
*probe_data)
tmp = tmp << 8;
USETW(req.wValue, tmp);
USETW(req.wIndex, sc->sc_vs_cur->iface);
-   USETW(req.wLength, 26);
+   USETW(req.wLength, sc->sc_max_ctrl_size);
 
pc = (struct usb_video_probe_commit *)probe_data;
 
@@ -1667,7 +1674,7 @@ uvideo_vs_get_probe(struct uvideo_softc *sc, uint8_t 
*probe_data,
tmp = tmp << 8;
USETW(req.wValue, tmp);
USETW(req.wIndex, sc->sc_vs_cur->iface);
-   USETW(req.wLength, 26);
+   USETW(req.wLength, sc->sc_max_ctrl_size);
 
pc = (struct usb_video_probe_commit *)probe_data;
 
@@ -1710,7 +1717,7 @@ uvideo_vs_set_commit(struct uvideo_softc *sc, uint8_t 
*probe_data)
tmp = tmp << 8;
USETW(req.wValue, tmp);
USETW(req.wIndex, sc->sc_vs_cur->iface);
-   USETW(req.wLength, 26);
+   USETW(req.wLength, sc->sc_max_ctrl_size);
 
error = usbd_do_request(sc->sc_udev, , probe_data);
if (error) {



uvideo(4): dump interface association descriptor

2019-07-04 Thread Patrick Wildt
Hi,

since we already dump most of the descriptors, also dump the interface
association descriptor, which helped me debug the previous issue.

Patrick

diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index c990c899c45..1a9dfc733fa 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -198,6 +198,8 @@ voiduvideo_dump_desc_output(struct 
uvideo_softc *,
const usb_descriptor_t *);
 void   uvideo_dump_desc_endpoint(struct uvideo_softc *,
const usb_descriptor_t *);
+void   uvideo_dump_desc_iface_assoc(struct uvideo_softc *,
+   const usb_descriptor_t *);
 void   uvideo_dump_desc_interface(struct uvideo_softc *,
const usb_descriptor_t *);
 void   uvideo_dump_desc_config(struct uvideo_softc *,
@@ -2487,6 +2489,11 @@ uvideo_dump_desc_all(struct uvideo_softc *sc)
printf("|\n");
uvideo_dump_desc_interface(sc, desc);
break;
+   case UDESC_IFACE_ASSOC:
+   printf(" (UDESC_IFACE_ASSOC)\n");
+   printf("|\n");
+   uvideo_dump_desc_iface_assoc(sc, desc);
+   break;
default:
printf(" (unknown)\n");
break;
@@ -2608,6 +2615,24 @@ uvideo_dump_desc_endpoint(struct uvideo_softc *sc,
printf("bInterval=0x%02x\n", d->bInterval);
 }
 
+void
+uvideo_dump_desc_iface_assoc(struct uvideo_softc *sc,
+const usb_descriptor_t *desc)
+{
+   usb_interface_assoc_descriptor_t *d;
+
+   d = (usb_interface_assoc_descriptor_t *)(uint8_t *)desc;
+
+   printf("bLength=%d\n", d->bLength);
+   printf("bDescriptorType=0x%02x\n", d->bDescriptorType);
+   printf("bFirstInterface=0x%02x\n", d->bFirstInterface);
+   printf("bInterfaceCount=%d\n", d->bInterfaceCount);
+   printf("bFunctionClass=0x%02x\n", d->bFunctionClass);
+   printf("bFunctionSubClass=0x%02x\n", d->bFunctionSubClass);
+   printf("bFunctionProtocol=0x%02x\n", d->bFunctionProtocol);
+   printf("iFunction=0x%02x\n", d->iFunction);
+}
+
 void
 uvideo_dump_desc_interface(struct uvideo_softc *sc,
 const usb_descriptor_t *desc)



uvideo(4): handle interface associations

2019-07-04 Thread Patrick Wildt
Hi,

newer laptops can have more than one camera.  For instance the Lenovo
X395 ships with a normal camera and an infrared camera.  These cameras
are behind a single USB device and their "functions" are separated
using interface association descriptors.  This means that there are
USB descriptors that tell us which USB interfaces belong to a single
function.  Note that the interface association descriptor is always
before its interfaces.

Unfortunately uvideo(4) currently can't handle that.  It goes through
all interfaces looking for VC or VS headers and realizes... there are
too many!  Because it doesn't know where to look, and when to stop.
Thus, it reports

uvideo0: too many VC_HEADERs!

Also since it claims all interfaces of the device, only one uvideo(4)
attaches and not two.

To fix this first of all when we attach, we should look for the first
unclaimed video class interface.  Then, go through all descriptors and
look for the function we belong to (using the interface association
descriptor).  Then, claim all the interfaces belonging to that function
and leave the rest.  This allows the second uvideo(4) to attach.

uvideo(4) contains more code that goes through every USB descriptor
looking for information.  In all these functions we should restrict it
so that it only looks inside its function's descriptors.  Thus, skip all
descriptors until we find our first interface and only then start
parsing.  Once we cross the function by reaching the next interface
association descriptor break out, because there's nothing left for us.

With this, and another small diff that follows, I can use the normal
camera on my Lenovo X395.

Patrick

diff --git a/sys/dev/usb/uvideo.c b/sys/dev/usb/uvideo.c
index 0c382b39071..c990c899c45 100644
--- a/sys/dev/usb/uvideo.c
+++ b/sys/dev/usb/uvideo.c
@@ -61,8 +61,8 @@ int uvideo_debug = 1;
 struct uvideo_softc {
struct devicesc_dev;
struct usbd_device  *sc_udev;
+   int  sc_iface;
int  sc_nifaces;
-   struct usbd_interface   **sc_ifaces;
 
struct device   *sc_videodev;
 
@@ -500,25 +500,56 @@ uvideo_attach(struct device *parent, struct device *self, 
void *aux)
 {
struct uvideo_softc *sc = (struct uvideo_softc *)self;
struct usb_attach_arg *uaa = aux;
+   usb_interface_assoc_descriptor_t *iad;
usb_interface_descriptor_t *id;
+   const usb_descriptor_t *desc;
+   struct usbd_desc_iter iter;
int i;
 
sc->sc_udev = uaa->device;
-   sc->sc_nifaces = uaa->nifaces;
-   /*
-* Claim all video interfaces.  Interfaces must be claimed during
-* attach, during attach hooks is too late.
-*/
-   for (i = 0; i < sc->sc_nifaces; i++) {
+
+   /* Find the first unclaimed video interface. */
+   for (i = 0; i < uaa->nifaces; i++) {
if (usbd_iface_claimed(sc->sc_udev, i))
continue;
id = usbd_get_interface_descriptor(>sc_udev->ifaces[i]);
if (id == NULL)
continue;
if (id->bInterfaceClass == UICLASS_VIDEO)
-   usbd_claim_iface(sc->sc_udev, i);
+   break;
+   }
+   KASSERT(i != uaa->nifaces);
+
+   /* Find out which interface association we belong to. */
+   usbd_desc_iter_init(sc->sc_udev, );
+   desc = usbd_desc_iter_next();
+   while (desc) {
+   if (desc->bDescriptorType != UDESC_IFACE_ASSOC) {
+   desc = usbd_desc_iter_next();
+   continue;
+   }
+   iad = (usb_interface_assoc_descriptor_t *)desc;
+   if (i >= iad->bFirstInterface &&
+   i < iad->bFirstInterface + iad->bInterfaceCount)
+   break;
+   desc = usbd_desc_iter_next();
+   }
+   KASSERT(desc != NULL);
+
+   /*
+* Claim all interfaces of our association.  Interfaces must be
+* claimed during attach, during attach hooks is too late.
+*/
+   for (i = iad->bFirstInterface;
+   i < iad->bFirstInterface + iad->bInterfaceCount; i++) {
+   KASSERT(!usbd_iface_claimed(sc->sc_udev, i));
+   usbd_claim_iface(sc->sc_udev, i);
}
 
+   /* Remember our association by saving the first interface. */
+   sc->sc_iface = iad->bFirstInterface;
+   sc->sc_nifaces = iad->bInterfaceCount;
+
/* maybe the device has quirks */
sc->sc_quirk = uvideo_lookup(uaa->vendor, uaa->product);
 
@@ -612,6 +643,7 @@ uvideo_vc_parse_desc(struct uvideo_softc *sc)
 {
struct usbd_desc_iter iter;
const usb_descriptor_t *desc;
+   usb_interface_descriptor_t *id;
int vc_header_found;
usbd_status error;
 
@@ -622,6 +654,18 @@ 

ADMtec aue interface does not work with full 1500 VLAN_MTU

2019-07-04 Thread Christopher Zimmermann
Hi,

I own this old USB ethernet controller:

aue0 at uhub9 port 5 configuration 1 interface 0 "ADMtek USB To LAN Converter" 
rev 2.00/1.01 addr 4
aue0: address 00:05:1b:b2:96:02
ukphy0 at aue0 phy 1: Generic IEEE 802.3u media interface, rev. 1: OUI 
0x000749, model 0x0001

This works:

doas ifconfig vlan67 mtu 1496

this doesn't:

doas ifconfig vlan67 mtu 1497


Should we therefore disable VLAN_MTU on this chipset?


Christopher



Index: if_aue.c
===
RCS file: /cvs/src/sys/dev/usb/if_aue.c,v
retrieving revision 1.109
diff -u -p -r1.109 if_aue.c
--- if_aue.c2 Oct 2018 19:49:10 -   1.109
+++ if_aue.c4 Jul 2019 18:25:06 -
@@ -781,8 +781,6 @@ aue_attach(struct device *parent, struct
ifp->if_watchdog = aue_watchdog;
strlcpy(ifp->if_xname, sc->aue_dev.dv_xname, IFNAMSIZ);
 
-   ifp->if_capabilities = IFCAP_VLAN_MTU;
-
/* Initialize MII/media info. */
mii = >aue_mii;
mii->mii_ifp = ifp;


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
CB07 DA40 B0B6 571D 35E2  0DEF 87E2 92A7 13E5 DEE1


pgphJJK9uAJdt.pgp
Description: OpenPGP digital signature


Re: lock(1): make -n and -t options mutually exclusive

2019-07-04 Thread Klemens Nanni
On Thu, Jul 04, 2019 at 12:43:21PM -0500, Scott Cheloha wrote:
> It doesn't make sense to allow the user to simultaneously set -n
> (never time out) and also set -t timeout (release the terminal after
> timeout minutes).
Makes sense but the synopsis should probably stay the same.  You could
simply print usage like chmod(8) or explicitly state their mutual
exclusiveness in an error message like pfctl(8) does.  I prefer the
former here.



lock(1): make -n and -t options mutually exclusive

2019-07-04 Thread Scott Cheloha
It doesn't make sense to allow the user to simultaneously set -n
(never time out) and also set -t timeout (release the terminal after
timeout minutes).

ok?

Index: lock.c
===
RCS file: /cvs/src/usr.bin/lock/lock.c,v
retrieving revision 1.41
diff -u -p -r1.41 lock.c
--- lock.c  6 Sep 2017 21:02:31 -   1.41
+++ lock.c  4 Jul 2019 17:41:35 -
@@ -63,7 +63,9 @@
 
 void bye(int);
 void hi(int);
+void usage(void);
 
+intcustom_timeout;
 intno_timeout; /* lock terminal forever */
 
 int
@@ -84,7 +86,7 @@ main(int argc, char *argv[])
sectimeout = TIMEOUT;
style = NULL;
usemine = 0;
-   no_timeout = 0;
+   custom_timeout = no_timeout = 0;
memset(, 0, sizeof(timeout));
 
if (pledge("stdio rpath wpath getpw tty proc exec", NULL) == -1)
@@ -116,21 +118,23 @@ main(int argc, char *argv[])
usemine = 1;
break;
case 't':
+   if (no_timeout)
+   usage();
sectimeout = strtonum(optarg, 1, INT_MAX, );
if (errstr)
errx(1, "timeout %s: %s", errstr, optarg);
+   custom_timeout = 1;
break;
case 'p':
usemine = 1;
break;
case 'n':
+   if (custom_timeout)
+   usage();
no_timeout = 1;
break;
default:
-   fprintf(stderr,
-   "usage: %s [-np] [-a style] [-t timeout]\n",
-   getprogname());
-   exit(1);
+   usage();
}
}
timeout.tv_sec = sectimeout * 60;
@@ -251,4 +255,12 @@ bye(int signo)
if (!no_timeout)
warnx("timeout");
_exit(1);
+}
+
+void
+usage(void)
+{
+   fprintf(stderr, "usage: %s [-p] [-a style] [-n | -t timeout]\n",
+   getprogname());
+   exit(1);
 }
Index: lock.1
===
RCS file: /cvs/src/usr.bin/lock/lock.1,v
retrieving revision 1.17
diff -u -p -r1.17 lock.1
--- lock.1  14 Aug 2013 08:39:26 -  1.17
+++ lock.1  4 Jul 2019 17:41:35 -
@@ -37,9 +37,9 @@
 .Nd reserve a terminal
 .Sh SYNOPSIS
 .Nm lock
-.Op Fl np
+.Op Fl p
 .Op Fl a Ar style
-.Op Fl t Ar timeout
+.Op Fl n | Fl t Ar timeout
 .Sh DESCRIPTION
 .Nm
 requests a password from the user, reads it again for verification



Re: SAS drives on Sparc64

2019-07-04 Thread Theo de Raadt
Andrew Grillet  wrote:

> I have several SAS H/Ds that are reporting "device not configured" with
> fdisk and disklabel.
> dd if=/dev/zero of=/dev/sd1
> The dmesg entry for one is ...
> sd1 at scsibus1 targ 1 lun 0:  SCSI4
> 0/direct fixed naa.5000cca0222458c0
> 
> I assumed that the problem lies with the boot sector contents, and managed
> to do
> dd if=/dev/zero of=/dev/sd1
> however, the problem has not gone away.
> Would a SCSI format help? if so, is there an easy way to do it?
> 
> Google suggested using scsictl, but it is not installed. Is it part of a
> pkg, or old info?

It probably means you don't have device nodes in /dev.  Look into MAKEDEV.



Re: SAS drives on Sparc64

2019-07-04 Thread Theo de Raadt
Andrew Grillet  wrote:

> I assumed that the problem lies with the boot sector contents, and managed
> to do
> dd if=/dev/zero of=/dev/sd1
> however, the problem has not gone away.

Ignoring your other comments, I hope you didn't do that precise command
because now you have a gigantic useless regular file in /, which is
unrelated to the issue.



SAS drives on Sparc64

2019-07-04 Thread Andrew Grillet
I have several SAS H/Ds that are reporting "device not configured" with
fdisk and disklabel.
dd if=/dev/zero of=/dev/sd1
The dmesg entry for one is ...
sd1 at scsibus1 targ 1 lun 0:  SCSI4
0/direct fixed naa.5000cca0222458c0

I assumed that the problem lies with the boot sector contents, and managed
to do
dd if=/dev/zero of=/dev/sd1
however, the problem has not gone away.
Would a SCSI format help? if so, is there an easy way to do it?

Google suggested using scsictl, but it is not installed. Is it part of a
pkg, or old info?


Re: socket splicing without kernel lock

2019-07-04 Thread Claudio Jeker
On Thu, Jul 04, 2019 at 01:16:53PM +0200, Alexander Bluhm wrote:
> On Thu, Jul 04, 2019 at 10:47:22AM +0200, Claudio Jeker wrote:
> > Would it be possible to use some #defined flags here instead of 1,2,3?
> > Maybe use FREAD/FWRITE or define something new.
> 
> Makes code longer, but more readable.
> 
> ok?

Looks good to me. OK claudio@
 
> bluhm
> 
> Index: sys/kern/uipc_socket.c
> ===
> RCS file: /data/mirror/openbsd/cvs/src/sys/kern/uipc_socket.c,v
> retrieving revision 1.231
> diff -u -p -r1.231 uipc_socket.c
> --- sys/kern/uipc_socket.c17 Dec 2018 16:46:59 -  1.231
> +++ sys/kern/uipc_socket.c4 Jul 2019 11:07:40 -
> @@ -195,6 +195,8 @@ solisten(struct socket *so, int backlog)
>   return (0);
>  }
> 
> +#define SOSP_FREEING_READ1
> +#define SOSP_FREEING_WRITE   2
>  void
>  sofree(struct socket *so, int s)
>  {
> @@ -218,11 +220,20 @@ sofree(struct socket *so, int s)
>   sigio_free(>so_sigio);
>  #ifdef SOCKET_SPLICE
>   if (so->so_sp) {
> - if (issplicedback(so))
> - sounsplice(so->so_sp->ssp_soback, so,
> - so->so_sp->ssp_soback != so);
> - if (isspliced(so))
> - sounsplice(so, so->so_sp->ssp_socket, 0);
> + if (issplicedback(so)) {
> + int freeing = SOSP_FREEING_WRITE;
> +
> + if (so->so_sp->ssp_soback == so)
> + freeing |= SOSP_FREEING_READ;
> + sounsplice(so->so_sp->ssp_soback, so, freeing);
> + }
> + if (isspliced(so)) {
> + int freeing = SOSP_FREEING_READ;
> +
> + if (so == so->so_sp->ssp_socket)
> + freeing |= SOSP_FREEING_WRITE;
> + sounsplice(so, so->so_sp->ssp_socket, freeing);
> + }
>   }
>  #endif /* SOCKET_SPLICE */
>   sbrelease(so, >so_snd);
> @@ -1148,7 +1159,7 @@ sosplice(struct socket *so, int fd, off_
>   return (error);
>   }
>   if (so->so_sp->ssp_socket)
> - sounsplice(so, so->so_sp->ssp_socket, 1);
> + sounsplice(so, so->so_sp->ssp_socket, 0);
>   sbunlock(so, >so_rcv);
>   return (0);
>   }
> @@ -1227,7 +1238,7 @@ sosplice(struct socket *so, int fd, off_
>  }
> 
>  void
> -sounsplice(struct socket *so, struct socket *sosp, int wakeup)
> +sounsplice(struct socket *so, struct socket *sosp, int freeing)
>  {
>   soassertlocked(so);
> 
> @@ -1236,8 +1247,11 @@ sounsplice(struct socket *so, struct soc
>   sosp->so_snd.sb_flags &= ~SB_SPLICE;
>   so->so_rcv.sb_flags &= ~SB_SPLICE;
>   so->so_sp->ssp_socket = sosp->so_sp->ssp_soback = NULL;
> - if (wakeup && soreadable(so))
> + /* Do not wakeup a socket that is about to be freed. */
> + if ((freeing & SOSP_FREEING_READ) == 0 && soreadable(so))
>   sorwakeup(so);
> + if ((freeing & SOSP_FREEING_WRITE) == 0 && sowriteable(sosp))
> + sowwakeup(sosp);
>  }
> 
>  void
> @@ -1249,7 +1263,7 @@ soidle(void *arg)
>   s = solock(so);
>   if (so->so_rcv.sb_flags & SB_SPLICE) {
>   so->so_error = ETIMEDOUT;
> - sounsplice(so, so->so_sp->ssp_socket, 1);
> + sounsplice(so, so->so_sp->ssp_socket, 0);
>   }
>   sounlock(so, s);
>  }
> @@ -1574,7 +1588,7 @@ somove(struct socket *so, int wait)
>   so->so_error = error;
>   if (((so->so_state & SS_CANTRCVMORE) && so->so_rcv.sb_cc == 0) ||
>   (sosp->so_state & SS_CANTSENDMORE) || maxreached || error) {
> - sounsplice(so, sosp, 1);
> + sounsplice(so, sosp, 0);
>   return (0);
>   }
>   if (timerisset(>so_idletv))
> @@ -1620,6 +1634,8 @@ sowwakeup(struct socket *so)
>  #ifdef SOCKET_SPLICE
>   if (so->so_snd.sb_flags & SB_SPLICE)
>   task_add(sosplice_taskq, >so_sp->ssp_soback->so_splicetask);
> + if (issplicedback(so))
> + return;
>  #endif
>   sowakeup(so, >so_snd);
>  }
> Index: share/man/man9/sosplice.9
> ===
> RCS file: /data/mirror/openbsd/cvs/src/share/man/man9/sosplice.9,v
> retrieving revision 1.9
> diff -u -p -r1.9 sosplice.9
> --- share/man/man9/sosplice.9 15 Aug 2018 12:10:49 -  1.9
> +++ share/man/man9/sosplice.9 3 Jul 2019 21:42:34 -
> @@ -206,10 +206,13 @@ will call
>  to trigger the transfer when new data or buffer space is available.
>  While socket splicing is active, any
>  .Xr read 2
> -from the source socket will block and the wakeup will not be delivered
> -to the file descriptor.
> -A read event or a socket error is signaled to userland after
> -dissolving.
> +from the source socket will block.
> +Neither read nor write wakeups will be delivered to the file
> +descriptors.
> 

Re: socket splicing without kernel lock

2019-07-04 Thread Alexander Bluhm
On Thu, Jul 04, 2019 at 10:47:22AM +0200, Claudio Jeker wrote:
> Would it be possible to use some #defined flags here instead of 1,2,3?
> Maybe use FREAD/FWRITE or define something new.

Makes code longer, but more readable.

ok?

bluhm

Index: sys/kern/uipc_socket.c
===
RCS file: /data/mirror/openbsd/cvs/src/sys/kern/uipc_socket.c,v
retrieving revision 1.231
diff -u -p -r1.231 uipc_socket.c
--- sys/kern/uipc_socket.c  17 Dec 2018 16:46:59 -  1.231
+++ sys/kern/uipc_socket.c  4 Jul 2019 11:07:40 -
@@ -195,6 +195,8 @@ solisten(struct socket *so, int backlog)
return (0);
 }

+#define SOSP_FREEING_READ  1
+#define SOSP_FREEING_WRITE 2
 void
 sofree(struct socket *so, int s)
 {
@@ -218,11 +220,20 @@ sofree(struct socket *so, int s)
sigio_free(>so_sigio);
 #ifdef SOCKET_SPLICE
if (so->so_sp) {
-   if (issplicedback(so))
-   sounsplice(so->so_sp->ssp_soback, so,
-   so->so_sp->ssp_soback != so);
-   if (isspliced(so))
-   sounsplice(so, so->so_sp->ssp_socket, 0);
+   if (issplicedback(so)) {
+   int freeing = SOSP_FREEING_WRITE;
+
+   if (so->so_sp->ssp_soback == so)
+   freeing |= SOSP_FREEING_READ;
+   sounsplice(so->so_sp->ssp_soback, so, freeing);
+   }
+   if (isspliced(so)) {
+   int freeing = SOSP_FREEING_READ;
+
+   if (so == so->so_sp->ssp_socket)
+   freeing |= SOSP_FREEING_WRITE;
+   sounsplice(so, so->so_sp->ssp_socket, freeing);
+   }
}
 #endif /* SOCKET_SPLICE */
sbrelease(so, >so_snd);
@@ -1148,7 +1159,7 @@ sosplice(struct socket *so, int fd, off_
return (error);
}
if (so->so_sp->ssp_socket)
-   sounsplice(so, so->so_sp->ssp_socket, 1);
+   sounsplice(so, so->so_sp->ssp_socket, 0);
sbunlock(so, >so_rcv);
return (0);
}
@@ -1227,7 +1238,7 @@ sosplice(struct socket *so, int fd, off_
 }

 void
-sounsplice(struct socket *so, struct socket *sosp, int wakeup)
+sounsplice(struct socket *so, struct socket *sosp, int freeing)
 {
soassertlocked(so);

@@ -1236,8 +1247,11 @@ sounsplice(struct socket *so, struct soc
sosp->so_snd.sb_flags &= ~SB_SPLICE;
so->so_rcv.sb_flags &= ~SB_SPLICE;
so->so_sp->ssp_socket = sosp->so_sp->ssp_soback = NULL;
-   if (wakeup && soreadable(so))
+   /* Do not wakeup a socket that is about to be freed. */
+   if ((freeing & SOSP_FREEING_READ) == 0 && soreadable(so))
sorwakeup(so);
+   if ((freeing & SOSP_FREEING_WRITE) == 0 && sowriteable(sosp))
+   sowwakeup(sosp);
 }

 void
@@ -1249,7 +1263,7 @@ soidle(void *arg)
s = solock(so);
if (so->so_rcv.sb_flags & SB_SPLICE) {
so->so_error = ETIMEDOUT;
-   sounsplice(so, so->so_sp->ssp_socket, 1);
+   sounsplice(so, so->so_sp->ssp_socket, 0);
}
sounlock(so, s);
 }
@@ -1574,7 +1588,7 @@ somove(struct socket *so, int wait)
so->so_error = error;
if (((so->so_state & SS_CANTRCVMORE) && so->so_rcv.sb_cc == 0) ||
(sosp->so_state & SS_CANTSENDMORE) || maxreached || error) {
-   sounsplice(so, sosp, 1);
+   sounsplice(so, sosp, 0);
return (0);
}
if (timerisset(>so_idletv))
@@ -1620,6 +1634,8 @@ sowwakeup(struct socket *so)
 #ifdef SOCKET_SPLICE
if (so->so_snd.sb_flags & SB_SPLICE)
task_add(sosplice_taskq, >so_sp->ssp_soback->so_splicetask);
+   if (issplicedback(so))
+   return;
 #endif
sowakeup(so, >so_snd);
 }
Index: share/man/man9/sosplice.9
===
RCS file: /data/mirror/openbsd/cvs/src/share/man/man9/sosplice.9,v
retrieving revision 1.9
diff -u -p -r1.9 sosplice.9
--- share/man/man9/sosplice.9   15 Aug 2018 12:10:49 -  1.9
+++ share/man/man9/sosplice.9   3 Jul 2019 21:42:34 -
@@ -206,10 +206,13 @@ will call
 to trigger the transfer when new data or buffer space is available.
 While socket splicing is active, any
 .Xr read 2
-from the source socket will block and the wakeup will not be delivered
-to the file descriptor.
-A read event or a socket error is signaled to userland after
-dissolving.
+from the source socket will block.
+Neither read nor write wakeups will be delivered to the file
+descriptors.
+After dissolving, a read event or a socket error is signaled to
+userland on the source socket.
+If space is available, a write event will be signaled on the drain
+socket.
 .Sh RETURN VALUES
 .Fn sosplice
 returns 0 on 

Re: move to interface rx queue backpressure for if_rxr livelock detection

2019-07-04 Thread Hrvoje Popovski
On 1.7.2019. 3:16, David Gwynne wrote:
> interface rx queue processing includes detection of when the stack
> becomes too busy to process packets.
> 
> there's three stages to this mechanism. firstly, everything is fine
> and the packets are simply queued for processing. the second is the
> "pressure_return" stage where the interface has queued a few times,
> but the stack hasn't run to process them. ifiq_input returns 1 in
> this situation to notify the nic that it should start to slow down.
> the last stage is the "pressure_drop" stage where the nic has
> continued to queue packets and the stack still hasnt run. in this
> stage it drops the packets and returns 1.
> 
> independently, the stack looks for lost clock ticks (because the stack
> traditionally blocked softclock ticks) as a livelock detection
> mechanism. this no longer works that well now we're in an MP worls.
> firstly, the stack could be running on a different cpu to the clock and
> therefore wont block it. secondly, the stack runs in a thread and doesnt
> raise the spl, so it shouldnt be blocking clock interrupts even if it is
> sharing a cpu now.
> 
> therefore the traditional livelock detection mechanism doesnt work and
> should be moved away from. the replacement is getting nics that
> implement rx ring moderation to look at the return value of the rx queue
> input function and telling the rings to slow down. that is what this
> diff does.
> 
> i've compiled it on amd64, which covers most of the drivers, but there's
> a few in fdt that i did blind and havent tested. ive tested a couple of
> the interfaces, but more testing would be appreciated.


Hi,

without this diff when box is under pressure ifconfig output can take up
from 10 to 20 min to finish...
   11m26.31s real 0m00.01s user 1m37.16s system


with this diff and
net.link.ifrxq.pressure_return=4
net.link.ifrxq.pressure_drop=8

it takes under minute
0m40.55s real 0m00.00s user 0m00.80s system


every time numbers will be different, but this diff makes my test box
smoother under pressure ...




Re: ftplist.cgi & ftpinstall.cgi source code

2019-07-04 Thread Stuart Henderson
On 2019/07/04 12:59, Lauri Tirkkonen wrote:
> Hi tech@,
> 
> I was doing an install into a fresh VM, and the installer was able to
> guess the (non-public) mirror I want to use correctly; I got curious and
> ran into ftplist.cgi in install.sub. That in itself made me more
> curious, but I was unable to find the source code for these CGI scripts
> anywhere. Is it available somewhere?

No.



ftplist.cgi & ftpinstall.cgi source code

2019-07-04 Thread Lauri Tirkkonen
Hi tech@,

I was doing an install into a fresh VM, and the installer was able to
guess the (non-public) mirror I want to use correctly; I got curious and
ran into ftplist.cgi in install.sub. That in itself made me more
curious, but I was unable to find the source code for these CGI scripts
anywhere. Is it available somewhere?

-- 
Lauri Tirkkonen | lotheac @ IRCnet



Re: socket splicing without kernel lock

2019-07-04 Thread Claudio Jeker
On Wed, Jul 03, 2019 at 11:49:51PM +0200, Alexander Bluhm wrote:
> Hi,
> 
> I would like to remove a useless kernel lock during socket splicing.
> 
> We have a socket "so" that splices data to socket "sosp".  Everytime
> when space in sosp gets available, we add a task to move data from
> so to sosp.  Additionally we call sowakeup() from sowwakeup().  I
> have added this as it is possible to splice from so to sosp and
> write from userland to sosp simultaneously.  In practice this does
> not make sense as the data streams from two sources would get mixed.
> Nothing uses this.  So it is not neccessay to inform userland that
> it is possible to write.
> 
> Note that sowakeup() takes the kernel lock.  So when I do not call
> it for a spliced socket, there is no kernel lock in the TCP splicing
> path anymore.
> 
> But then I have to wakeup userland for the wirting socket in
> sounsplice().
> 
> ok?

I think in general this makes sense. One comment inline.


> Index: sys/kern/uipc_socket.c
> ===
> RCS file: /data/mirror/openbsd/cvs/src/sys/kern/uipc_socket.c,v
> retrieving revision 1.231
> diff -u -p -r1.231 uipc_socket.c
> --- sys/kern/uipc_socket.c17 Dec 2018 16:46:59 -  1.231
> +++ sys/kern/uipc_socket.c3 Jul 2019 13:56:09 -
> @@ -220,9 +220,10 @@ sofree(struct socket *so, int s)
>   if (so->so_sp) {
>   if (issplicedback(so))
>   sounsplice(so->so_sp->ssp_soback, so,
> - so->so_sp->ssp_soback != so);
> + so->so_sp->ssp_soback == so ? 3 : 2);
>   if (isspliced(so))
> - sounsplice(so, so->so_sp->ssp_socket, 0);
> + sounsplice(so, so->so_sp->ssp_socket,
> + so == so->so_sp->ssp_socket ? 3 : 1);
>   }
>  #endif /* SOCKET_SPLICE */
>   sbrelease(so, >so_snd);
> @@ -1148,7 +1149,7 @@ sosplice(struct socket *so, int fd, off_
>   return (error);
>   }
>   if (so->so_sp->ssp_socket)
> - sounsplice(so, so->so_sp->ssp_socket, 1);
> + sounsplice(so, so->so_sp->ssp_socket, 0);
>   sbunlock(so, >so_rcv);
>   return (0);
>   }
> @@ -1227,7 +1228,7 @@ sosplice(struct socket *so, int fd, off_
>  }
> 
>  void
> -sounsplice(struct socket *so, struct socket *sosp, int wakeup)
> +sounsplice(struct socket *so, struct socket *sosp, int freeing)
>  {
>   soassertlocked(so);
> 
> @@ -1236,8 +1237,11 @@ sounsplice(struct socket *so, struct soc
>   sosp->so_snd.sb_flags &= ~SB_SPLICE;
>   so->so_rcv.sb_flags &= ~SB_SPLICE;
>   so->so_sp->ssp_socket = sosp->so_sp->ssp_soback = NULL;
> - if (wakeup && soreadable(so))
> + /* Do not wakeup a socket that is about to be freed. */
> + if ((freeing & 1) == 0 && soreadable(so))
>   sorwakeup(so);
> + if ((freeing & 2) == 0 && sowriteable(sosp))
> + sowwakeup(sosp);

Would it be possible to use some #defined flags here instead of 1,2,3?
Maybe use FREAD/FWRITE or define something new.

>  }
> 
>  void
> @@ -1249,7 +1253,7 @@ soidle(void *arg)
>   s = solock(so);
>   if (so->so_rcv.sb_flags & SB_SPLICE) {
>   so->so_error = ETIMEDOUT;
> - sounsplice(so, so->so_sp->ssp_socket, 1);
> + sounsplice(so, so->so_sp->ssp_socket, 0);
>   }
>   sounlock(so, s);
>  }
> @@ -1574,7 +1578,7 @@ somove(struct socket *so, int wait)
>   so->so_error = error;
>   if (((so->so_state & SS_CANTRCVMORE) && so->so_rcv.sb_cc == 0) ||
>   (sosp->so_state & SS_CANTSENDMORE) || maxreached || error) {
> - sounsplice(so, sosp, 1);
> + sounsplice(so, sosp, 0);
>   return (0);
>   }
>   if (timerisset(>so_idletv))
> @@ -1620,6 +1624,8 @@ sowwakeup(struct socket *so)
>  #ifdef SOCKET_SPLICE
>   if (so->so_snd.sb_flags & SB_SPLICE)
>   task_add(sosplice_taskq, >so_sp->ssp_soback->so_splicetask);
> + if (issplicedback(so))
> + return;
>  #endif
>   sowakeup(so, >so_snd);
>  }
> Index: share/man/man9/sosplice.9
> ===
> RCS file: /data/mirror/openbsd/cvs/src/share/man/man9/sosplice.9,v
> retrieving revision 1.9
> diff -u -p -r1.9 sosplice.9
> --- share/man/man9/sosplice.9 15 Aug 2018 12:10:49 -  1.9
> +++ share/man/man9/sosplice.9 3 Jul 2019 21:42:34 -
> @@ -206,10 +206,13 @@ will call
>  to trigger the transfer when new data or buffer space is available.
>  While socket splicing is active, any
>  .Xr read 2
> -from the source socket will block and the wakeup will not be delivered
> -to the file descriptor.
> -A read event or a socket error is signaled to userland after
> -dissolving.
> +from the source socket will block.
> +Neither read nor write wakeups will be delivered to the file
> 

Re: ospfd: point-to-point on ethernet interfaces

2019-07-04 Thread Remi Locherer
On Thu, Jul 04, 2019 at 09:20:59AM +0300, Kapetanakis Giannis wrote:
> Hi,
> 
> This does not work for me with IOS.
> 
> neighbor is full,
> rib is ok
> fib does not list the routes to IOS and
> routing table is not updated on BSD
> 
> On IOS I do have the loopback route the BSD is announcing.

Thank you for testing!

Can you send me your ospfd.conf, the output from ospfd -dv and the output
from tcpdump showing the ospf traffic?

> On 24/06/2019 01:33, Remi Locherer wrote:
> > Diff below adds to ospfd point to point support for Ethernet interfaces.
> > I successfully tested this against Junos and FastIron.
> >
> > I first made the key word in the config "point-to-point". But then I
> > changed to "type p2p". The later would allow for "type nbma" or "type p2mp"
> > should we implement these types.
> >
> > On Junos it looks like this:
> >
> > area 0.0.0.0 {
> > interface ge-0/0/1.0 {
> > interface-type p2p;
> > }
> > }
> >
> > On FastIron it's similar to IOS:
> >
> > interface ethernet 1/2/1
> >  ip address 10.10.10.5 255.255.255.0
> >  ip ospf area 0
> >  ip ospf network point-to-point
> >
> > Comments, test reports and OKs are welcome.
> >
> > Remi
> >
> >
> > Index: interface.c
> > ===
> > RCS file: /cvs/src/usr.sbin/ospfd/interface.c,v
> > retrieving revision 1.82
> > diff -u -p -r1.82 interface.c
> > --- interface.c 11 Mar 2018 13:16:49 -  1.82
> > +++ interface.c 23 Jun 2019 11:27:57 -
> > @@ -190,6 +190,8 @@ if_new(struct kif *kif, struct kif_addr 
> > if (kif->flags & IFF_BROADCAST &&
> > kif->flags & IFF_MULTICAST)
> > iface->type = IF_TYPE_BROADCAST;
> > +   if (iface->p2p)
> > +   iface->type = IF_TYPE_POINTOPOINT;
> > if (kif->flags & IFF_LOOPBACK) {
> > iface->type = IF_TYPE_POINTOPOINT;
> > iface->passive = 1;
> > @@ -351,6 +353,9 @@ if_act_start(struct iface *iface)
> > orig_rtr_lsa(iface->area);
> > return (0);
> > }
> > +
> > +   if (iface->p2p)
> > +   iface->type = IF_TYPE_POINTOPOINT;
> >  
> > switch (iface->type) {
> > case IF_TYPE_POINTOPOINT:
> > Index: ospfd.c
> > ===
> > RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v
> > retrieving revision 1.108
> > diff -u -p -r1.108 ospfd.c
> > --- ospfd.c 16 May 2019 05:49:22 -  1.108
> > +++ ospfd.c 23 Jun 2019 21:06:44 -
> > @@ -911,6 +911,22 @@ merge_interfaces(struct area *a, struct 
> > if_fsm(i, IF_EVT_UP);
> > }
> >  
> > +   if (i->p2p != xi->p2p) {
> > +   /* re-add interface to enable or disable DR election */
> > +   if (ospfd_process == PROC_OSPF_ENGINE)
> > +   if_fsm(i, IF_EVT_DOWN);
> > +   else if (ospfd_process == PROC_RDE_ENGINE)
> > +   rde_nbr_iface_del(i);
> > +   LIST_REMOVE(i, entry);
> > +   if_del(i);
> > +   LIST_REMOVE(xi, entry);
> > +   LIST_INSERT_HEAD(>iface_list, xi, entry);
> > +   xi->area = a;
> > +   if (ospfd_process == PROC_OSPF_ENGINE)
> > +   xi->state = IF_STA_NEW;
> > +   continue;
> > +   }
> > +
> > strlcpy(i->dependon, xi->dependon,
> > sizeof(i->dependon));
> > i->depend_ok = xi->depend_ok;
> > Index: ospfd.conf.5
> > ===
> > RCS file: /cvs/src/usr.sbin/ospfd/ospfd.conf.5,v
> > retrieving revision 1.57
> > diff -u -p -r1.57 ospfd.conf.5
> > --- ospfd.conf.510 Jun 2019 06:07:15 -  1.57
> > +++ ospfd.conf.523 Jun 2019 22:10:32 -
> > @@ -419,6 +419,9 @@ Router.
> >  .It Ic transmit-delay Ar seconds
> >  Set the transmit delay.
> >  The default value is 1; valid range is 1\-3600 seconds.
> > +.It Ic type p2p
> > +Set the interface type to point to point.
> > +This disables the election of a DR and BDR for the given interface.
> >  .El
> >  .Sh FILES
> >  .Bl -tag -width "/etc/ospfd.conf" -compact
> > Index: ospfd.h
> > ===
> > RCS file: /cvs/src/usr.sbin/ospfd/ospfd.h,v
> > retrieving revision 1.104
> > diff -u -p -r1.104 ospfd.h
> > --- ospfd.h 16 May 2019 05:49:22 -  1.104
> > +++ ospfd.h 23 Jun 2019 11:28:24 -
> > @@ -363,6 +363,7 @@ struct iface {
> > u_int8_t linkstate;
> > u_int8_t priority;
> > u_int8_t passive;
> > +   u_int8_t p2p;
> >  };
> >  
> >  struct ifaddrchange {
> > Index: parse.y
> > ===
> > RCS file: /cvs/src/usr.sbin/ospfd/parse.y,v
> > retrieving revision 1.98
> > diff -u -p -r1.98 parse.y

Re: ospfd: point-to-point on ethernet interfaces

2019-07-04 Thread Kapetanakis Giannis
Hi,

This does not work for me with IOS.

neighbor is full,
rib is ok
fib does not list the routes to IOS and
routing table is not updated on BSD

On IOS I do have the loopback route the BSD is announcing.

G

On 24/06/2019 01:33, Remi Locherer wrote:
> Diff below adds to ospfd point to point support for Ethernet interfaces.
> I successfully tested this against Junos and FastIron.
>
> I first made the key word in the config "point-to-point". But then I
> changed to "type p2p". The later would allow for "type nbma" or "type p2mp"
> should we implement these types.
>
> On Junos it looks like this:
>
> area 0.0.0.0 {
> interface ge-0/0/1.0 {
> interface-type p2p;
> }
> }
>
> On FastIron it's similar to IOS:
>
> interface ethernet 1/2/1
>  ip address 10.10.10.5 255.255.255.0
>  ip ospf area 0
>  ip ospf network point-to-point
>
> Comments, test reports and OKs are welcome.
>
> Remi
>
>
> Index: interface.c
> ===
> RCS file: /cvs/src/usr.sbin/ospfd/interface.c,v
> retrieving revision 1.82
> diff -u -p -r1.82 interface.c
> --- interface.c   11 Mar 2018 13:16:49 -  1.82
> +++ interface.c   23 Jun 2019 11:27:57 -
> @@ -190,6 +190,8 @@ if_new(struct kif *kif, struct kif_addr 
>   if (kif->flags & IFF_BROADCAST &&
>   kif->flags & IFF_MULTICAST)
>   iface->type = IF_TYPE_BROADCAST;
> + if (iface->p2p)
> + iface->type = IF_TYPE_POINTOPOINT;
>   if (kif->flags & IFF_LOOPBACK) {
>   iface->type = IF_TYPE_POINTOPOINT;
>   iface->passive = 1;
> @@ -351,6 +353,9 @@ if_act_start(struct iface *iface)
>   orig_rtr_lsa(iface->area);
>   return (0);
>   }
> +
> + if (iface->p2p)
> + iface->type = IF_TYPE_POINTOPOINT;
>  
>   switch (iface->type) {
>   case IF_TYPE_POINTOPOINT:
> Index: ospfd.c
> ===
> RCS file: /cvs/src/usr.sbin/ospfd/ospfd.c,v
> retrieving revision 1.108
> diff -u -p -r1.108 ospfd.c
> --- ospfd.c   16 May 2019 05:49:22 -  1.108
> +++ ospfd.c   23 Jun 2019 21:06:44 -
> @@ -911,6 +911,22 @@ merge_interfaces(struct area *a, struct 
>   if_fsm(i, IF_EVT_UP);
>   }
>  
> + if (i->p2p != xi->p2p) {
> + /* re-add interface to enable or disable DR election */
> + if (ospfd_process == PROC_OSPF_ENGINE)
> + if_fsm(i, IF_EVT_DOWN);
> + else if (ospfd_process == PROC_RDE_ENGINE)
> + rde_nbr_iface_del(i);
> + LIST_REMOVE(i, entry);
> + if_del(i);
> + LIST_REMOVE(xi, entry);
> + LIST_INSERT_HEAD(>iface_list, xi, entry);
> + xi->area = a;
> + if (ospfd_process == PROC_OSPF_ENGINE)
> + xi->state = IF_STA_NEW;
> + continue;
> + }
> +
>   strlcpy(i->dependon, xi->dependon,
>   sizeof(i->dependon));
>   i->depend_ok = xi->depend_ok;
> Index: ospfd.conf.5
> ===
> RCS file: /cvs/src/usr.sbin/ospfd/ospfd.conf.5,v
> retrieving revision 1.57
> diff -u -p -r1.57 ospfd.conf.5
> --- ospfd.conf.5  10 Jun 2019 06:07:15 -  1.57
> +++ ospfd.conf.5  23 Jun 2019 22:10:32 -
> @@ -419,6 +419,9 @@ Router.
>  .It Ic transmit-delay Ar seconds
>  Set the transmit delay.
>  The default value is 1; valid range is 1\-3600 seconds.
> +.It Ic type p2p
> +Set the interface type to point to point.
> +This disables the election of a DR and BDR for the given interface.
>  .El
>  .Sh FILES
>  .Bl -tag -width "/etc/ospfd.conf" -compact
> Index: ospfd.h
> ===
> RCS file: /cvs/src/usr.sbin/ospfd/ospfd.h,v
> retrieving revision 1.104
> diff -u -p -r1.104 ospfd.h
> --- ospfd.h   16 May 2019 05:49:22 -  1.104
> +++ ospfd.h   23 Jun 2019 11:28:24 -
> @@ -363,6 +363,7 @@ struct iface {
>   u_int8_t linkstate;
>   u_int8_t priority;
>   u_int8_t passive;
> + u_int8_t p2p;
>  };
>  
>  struct ifaddrchange {
> Index: parse.y
> ===
> RCS file: /cvs/src/usr.sbin/ospfd/parse.y,v
> retrieving revision 1.98
> diff -u -p -r1.98 parse.y
> --- parse.y   7 Jun 2019 04:57:45 -   1.98
> +++ parse.y   23 Jun 2019 22:04:22 -
> @@ -129,7 +129,7 @@ typedef struct {
>  %token   AREA INTERFACE ROUTERID FIBPRIORITY FIBUPDATE REDISTRIBUTE 
> RTLABEL
>  %token   RDOMAIN RFC1583COMPAT STUB ROUTER SPFDELAY SPFHOLDTIME EXTTAG
>  %token   AUTHKEY AUTHTYPE AUTHMD AUTHMDKEYID
> -%token