Re: rmt

2017-02-17 Thread Alexander Hall


On February 17, 2017 11:53:44 PM GMT+01:00, Andrew Grillet 
 wrote:
>How do I actually use rmt?
>
>I want to backup a guest domain on a T2000 using a tape drive on the
>primary domain.
>Both domains run OpenBSD 6.0.
>
>The way I read the mt manual page, I should be able to do (from the
>guest,
>as root)
>> mt primary:/dev/rst0 status
>and this should deliver the command to rmt on the primary, execute the
>command
>and return the results, identical to if I did
>> mt -f /dev/rst0 status
>on the primary.
>Instead, it just hangs.
>Are there some preconditions, somewhere? Like - do I need to start rmt
>on
>the primary,
>somehow, or hack around with inetd.conf? or is it all about
>hosts.allow?

rmt is filesystem i/o tunneled over SSH (nowadays). If you can ssh to the 
remote machine, and have no magic ssh configuration, you should be able to 
access it. That said, I only ever use rmt via dump / restore. 

The rmt code is really simple and shows what's going on. 

/Alexander 

>
>Is there a magic FAQ for this stuff?
>
>Or am I the only person that has used magtape since it was 556 bpi?
>
>Help!
>
>Thanks.



rmt

2017-02-17 Thread Andrew Grillet
How do I actually use rmt?

I want to backup a guest domain on a T2000 using a tape drive on the
primary domain.
Both domains run OpenBSD 6.0.

The way I read the mt manual page, I should be able to do (from the guest,
as root)
> mt primary:/dev/rst0 status
and this should deliver the command to rmt on the primary, execute the
command
and return the results, identical to if I did
> mt -f /dev/rst0 status
on the primary.
Instead, it just hangs.
Are there some preconditions, somewhere? Like - do I need to start rmt on
the primary,
somehow, or hack around with inetd.conf? or is it all about hosts.allow?

Is there a magic FAQ for this stuff?

Or am I the only person that has used magtape since it was 556 bpi?

Help!

Thanks.


Re: nsd 4.1.15

2017-02-17 Thread Sebastian Benoit
Florian Obser(flor...@openbsd.org) on 2017.02.17 19:20:41 +:
> ... and in case you want to see what's actually going on,
> this is without the _t conversion churn:

thanks, and ok (for the one with the type stuff)

 
> commit 4cfab5a8d90abb380ae6a64da825883a2f360dc1
> Author: Florian Obser 
> Date:   Fri Feb 17 15:04:08 2017 +0100
> 
> log at verbosity 3.
> 
> diff --git nsec3.c nsec3.c
> index f24377d4259..960e7216dad 100644
> --- nsec3.c
> +++ nsec3.c
> @@ -855,7 +855,7 @@ nsec3_add_nonexist_proof(struct query* query, struct 
> answer* answer,
>   {
>   /* exact match, hash collision */
>   /* the hashed name of the query corresponds to an existing 
> name. */
> - VERBOSITY(2, (LOG_ERR, "nsec3 hash collision for name=%s",
> + VERBOSITY(3, (LOG_ERR, "nsec3 hash collision for name=%s",
>   dname_to_string(to_prove, NULL)));
>   RCODE_SET(query->packet, RCODE_SERVFAIL);
>   return;
> commit da0c808f5fd4a3a6d75083e57ff83125409cf63f
> Author: Florian Obser 
> Date:   Fri Feb 17 15:03:27 2017 +0100
> 
> Fix that nsec3 hash collisions only reported on
>  verbosity level 2.
> 
> diff --git nsec3.c nsec3.c
> index cbbc560feab..f24377d4259 100644
> --- nsec3.c
> +++ nsec3.c
> @@ -855,8 +855,8 @@ nsec3_add_nonexist_proof(struct query* query, struct 
> answer* answer,
>   {
>   /* exact match, hash collision */
>   /* the hashed name of the query corresponds to an existing 
> name. */
> - log_msg(LOG_ERR, "nsec3 hash collision for name=%s",
> - dname_to_string(to_prove, NULL));
> + VERBOSITY(2, (LOG_ERR, "nsec3 hash collision for name=%s",
> + dname_to_string(to_prove, NULL)));
>   RCODE_SET(query->packet, RCODE_SERVFAIL);
>   return;
>   }
> commit e704b0278dff9418494b01ad18e0aca6fcd041af
> Author: Florian Obser 
> Date:   Fri Feb 17 15:02:59 2017 +0100
> 
> layout
> 
> diff --git rbtree.h rbtree.h
> index 19330eac195..d6e54862a23 100644
> --- rbtree.h
> +++ rbtree.h
> @@ -19,11 +19,11 @@
>   */
>  typedef struct rbnode rbnode_type;
>  struct rbnode {
> - rbnode_type   *parent;
> - rbnode_type   *left;
> - rbnode_type   *right;
> - const void *key;
> - uint8_t color;
> + rbnode_type  *parent;
> + rbnode_type  *left;
> + rbnode_type  *right;
> + const void   *key;
> + uint8_t   color;
>  };
>  
>  #define  RBTREE_NULL &rbtree_null_node
> commit 86df8159cf9786a73d4f38384aae02b9ddc0dfa9
> Author: Florian Obser 
> Date:   Fri Feb 17 15:00:34 2017 +0100
> 
> Fix #1195: Fix so that NSD fails on non-compliant values for Serial
> 
> diff --git util.c util.c
> index db3d7ceddce..458f0946643 100644
> --- util.c
> +++ util.c
> @@ -487,6 +487,10 @@ strtoserial(const char* nptr, const char** endptr)
>   case '7':
>   case '8':
>   case '9':
> + if((i*10)/10 != i)
> + /* number too large, return i
> +  * with *endptr != 0 as a failure*/
> + return i;
>   i *= 10;
>   i += (**endptr - '0');
>   break;
> commit 504de18c0f56c4e3b117d6c268b6ca0e7a508d9b
> Author: Florian Obser 
> Date:   Fri Feb 17 15:00:08 2017 +0100
> 
> Squelch zone transfer error address family not supported by protocol
> at low verbosity levels.
> 
> diff --git xfrd-tcp.c xfrd-tcp.c
> index 506b2520589..bd9d64e6397 100644
> --- xfrd-tcp.c
> +++ xfrd-tcp.c
> @@ -521,7 +521,10 @@ xfrd_tcp_open(xfrd_tcp_set_t* set, struct 
> xfrd_tcp_pipeline* tp,
>   }
>   fd = socket(family, SOCK_STREAM, IPPROTO_TCP);
>   if(fd == -1) {
> - log_msg(LOG_ERR, "xfrd: %s cannot create tcp socket: %s",
> + /* squelch 'Address family not supported by protocol' at low
> +  * verbosity levels */
> + if(errno != EAFNOSUPPORT || verbosity > 2)
> + log_msg(LOG_ERR, "xfrd: %s cannot create tcp socket: %s",
>   zone->master->ip_address_spec, strerror(errno));
>   xfrd_set_refresh_now(zone);
>   return 0;
> commit 5c1a096cdf30ff6ea39317d733dcfbc431b137d9
> Author: Florian Obser 
> Date:   Fri Feb 17 14:59:29 2017 +0100
> 
> Fix nsd-control and ipv6 only.
> 
> diff --git nsd-control.c nsd-control.c
> index 0b482839b47..1cc54e8f4c2 100644
> --- nsd-control.c
> +++ nsd-control.c
> @@ -156,9 +156,13 @@ contact_server(const char* svr, nsd_options_t* cfg, int 
> statuscmd)
>   int port = cfg->control_port;
>   /* use svr or a config entry */
>   if(!svr) {
> - if(cfg->control_interface)
> + if(cfg->control_interface) {
>   svr = cfg->control_interface->address;
> - elsesvr = "127.0.0.1";
> + } else if(cf

Re: nsd 4.1.15

2017-02-17 Thread Stuart Henderson
On 2017/02/17 16:04, Florian Obser wrote:
> tests, OKs?

More _t to _type (I zoned out a bit reading that diff) :-)

I didn't spot anything concerning, there's only a small real change, and it's
working for me.  OK.



Re: nsd 4.1.15

2017-02-17 Thread Florian Obser
... and in case you want to see what's actually going on,
this is without the _t conversion churn:

commit 4cfab5a8d90abb380ae6a64da825883a2f360dc1
Author: Florian Obser 
Date:   Fri Feb 17 15:04:08 2017 +0100

log at verbosity 3.

diff --git nsec3.c nsec3.c
index f24377d4259..960e7216dad 100644
--- nsec3.c
+++ nsec3.c
@@ -855,7 +855,7 @@ nsec3_add_nonexist_proof(struct query* query, struct 
answer* answer,
{
/* exact match, hash collision */
/* the hashed name of the query corresponds to an existing 
name. */
-   VERBOSITY(2, (LOG_ERR, "nsec3 hash collision for name=%s",
+   VERBOSITY(3, (LOG_ERR, "nsec3 hash collision for name=%s",
dname_to_string(to_prove, NULL)));
RCODE_SET(query->packet, RCODE_SERVFAIL);
return;
commit da0c808f5fd4a3a6d75083e57ff83125409cf63f
Author: Florian Obser 
Date:   Fri Feb 17 15:03:27 2017 +0100

Fix that nsec3 hash collisions only reported on
 verbosity level 2.

diff --git nsec3.c nsec3.c
index cbbc560feab..f24377d4259 100644
--- nsec3.c
+++ nsec3.c
@@ -855,8 +855,8 @@ nsec3_add_nonexist_proof(struct query* query, struct 
answer* answer,
{
/* exact match, hash collision */
/* the hashed name of the query corresponds to an existing 
name. */
-   log_msg(LOG_ERR, "nsec3 hash collision for name=%s",
-   dname_to_string(to_prove, NULL));
+   VERBOSITY(2, (LOG_ERR, "nsec3 hash collision for name=%s",
+   dname_to_string(to_prove, NULL)));
RCODE_SET(query->packet, RCODE_SERVFAIL);
return;
}
commit e704b0278dff9418494b01ad18e0aca6fcd041af
Author: Florian Obser 
Date:   Fri Feb 17 15:02:59 2017 +0100

layout

diff --git rbtree.h rbtree.h
index 19330eac195..d6e54862a23 100644
--- rbtree.h
+++ rbtree.h
@@ -19,11 +19,11 @@
  */
 typedef struct rbnode rbnode_type;
 struct rbnode {
-   rbnode_type   *parent;
-   rbnode_type   *left;
-   rbnode_type   *right;
-   const void *key;
-   uint8_t color;
+   rbnode_type  *parent;
+   rbnode_type  *left;
+   rbnode_type  *right;
+   const void   *key;
+   uint8_t   color;
 };
 
 #defineRBTREE_NULL &rbtree_null_node
commit 86df8159cf9786a73d4f38384aae02b9ddc0dfa9
Author: Florian Obser 
Date:   Fri Feb 17 15:00:34 2017 +0100

Fix #1195: Fix so that NSD fails on non-compliant values for Serial

diff --git util.c util.c
index db3d7ceddce..458f0946643 100644
--- util.c
+++ util.c
@@ -487,6 +487,10 @@ strtoserial(const char* nptr, const char** endptr)
case '7':
case '8':
case '9':
+   if((i*10)/10 != i)
+   /* number too large, return i
+* with *endptr != 0 as a failure*/
+   return i;
i *= 10;
i += (**endptr - '0');
break;
commit 504de18c0f56c4e3b117d6c268b6ca0e7a508d9b
Author: Florian Obser 
Date:   Fri Feb 17 15:00:08 2017 +0100

Squelch zone transfer error address family not supported by protocol
at low verbosity levels.

diff --git xfrd-tcp.c xfrd-tcp.c
index 506b2520589..bd9d64e6397 100644
--- xfrd-tcp.c
+++ xfrd-tcp.c
@@ -521,7 +521,10 @@ xfrd_tcp_open(xfrd_tcp_set_t* set, struct 
xfrd_tcp_pipeline* tp,
}
fd = socket(family, SOCK_STREAM, IPPROTO_TCP);
if(fd == -1) {
-   log_msg(LOG_ERR, "xfrd: %s cannot create tcp socket: %s",
+   /* squelch 'Address family not supported by protocol' at low
+* verbosity levels */
+   if(errno != EAFNOSUPPORT || verbosity > 2)
+   log_msg(LOG_ERR, "xfrd: %s cannot create tcp socket: %s",
zone->master->ip_address_spec, strerror(errno));
xfrd_set_refresh_now(zone);
return 0;
commit 5c1a096cdf30ff6ea39317d733dcfbc431b137d9
Author: Florian Obser 
Date:   Fri Feb 17 14:59:29 2017 +0100

Fix nsd-control and ipv6 only.

diff --git nsd-control.c nsd-control.c
index 0b482839b47..1cc54e8f4c2 100644
--- nsd-control.c
+++ nsd-control.c
@@ -156,9 +156,13 @@ contact_server(const char* svr, nsd_options_t* cfg, int 
statuscmd)
int port = cfg->control_port;
/* use svr or a config entry */
if(!svr) {
-   if(cfg->control_interface)
+   if(cfg->control_interface) {
svr = cfg->control_interface->address;
-   elsesvr = "127.0.0.1";
+   } else if(cfg->do_ip4) {
+   svr = "127.0.0.1";
+   } else {
+   svr = "::1";
+   }
/* config 0 addr (everything), means ask localhost */
if(strcmp(svr, "0.0.0.0") == 0)
s

Re: Implement fork1_to_pid(). It's fork1(), but with pid as argument

2017-02-17 Thread Ossi Herrala
ping?

On Sun, Feb 12, 2017 at 07:58:27PM +0200, Ossi Herrala wrote:
> On Sun, Feb 12, 2017 at 01:34:14AM +0200, Ossi Herrala wrote:
> 
> > After couple of private mails with guenther@ we came up with the
> > following patch.
> > 
> > Introduce new flag FORK_PID1 for fork1(9).
> > 
> > This flag is special and only for forking init(8) which wants to be
> > PID 1.
> > 
> > With this flag in place, it's possible to remove global randompid
> > variable which was used to control if allocpid() returns random PIDs
> > or PID 1 for init(8). Now allocpid() can also be simplified.
> >
> 
> New patch which works with latest changes to fork1(9).
> 
> This version also documents FORK_PID1 flag in fork1(9) man page.
> 
> 
> ---
>  share/man/man9/fork1.9 |  3 +++
>  sys/kern/init_main.c   |  5 ++---
>  sys/kern/kern_fork.c   | 24 ++--
>  sys/sys/proc.h |  2 +-
>  4 files changed, 16 insertions(+), 18 deletions(-)
> 
> diff --git a/share/man/man9/fork1.9 b/share/man/man9/fork1.9
> index c22c9800aa4..21175416ed4 100644
> --- a/share/man/man9/fork1.9
> +++ b/share/man/man9/fork1.9
> @@ -109,6 +109,9 @@ must also be set.
>  .It Dv FORK_PTRACE
>  The child will start with tracing enabled, as if
>  ptrace(PT_TRACE_ME, 0, 0, 0) had been invoked in the child.
> +.It Dv FORK_PID1
> +Special flag to assign PID 1 for
> +.Xr init 8 process.
>  .El
>  .Pp
>  If
> diff --git a/sys/kern/init_main.c b/sys/kern/init_main.c
> index faa74aa4244..f1975a6aa89 100644
> --- a/sys/kern/init_main.c
> +++ b/sys/kern/init_main.c
> @@ -437,13 +437,12 @@ main(void *framep)
>   {
>   struct proc *initproc;
>  
> - if (fork1(p, FORK_FORK, start_init, NULL, NULL, &initproc))
> + if (fork1(p, FORK_FORK|FORK_PID1, start_init, NULL, NULL,
> + &initproc))
>   panic("fork init");
>   initprocess = initproc->p_p;
>   }
>  
> - randompid = 1;
> -
>   /*
>* Create any kernel threads whose creation was deferred because
>* initprocess had not yet been created.
> diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c
> index 38c1be4a981..b5f99d3c4dc 100644
> --- a/sys/kern/kern_fork.c
> +++ b/sys/kern/kern_fork.c
> @@ -71,7 +71,6 @@
>  
>  int  nprocesses = 1; /* process 0 */
>  int  nthreads = 1;   /* proc 0 */
> -int  randompid;  /* when set to 1, pid's go random */
>  struct   forkstat forkstat;
>  
>  void fork_return(void *);
> @@ -220,7 +219,11 @@ process_new(struct proc *p, struct process *parent, int 
> flags)
>   (caddr_t)&pr->ps_endcopy - (caddr_t)&pr->ps_startcopy);
>  
>   process_initialize(pr, p);
> - pr->ps_pid = allocpid();
> +
> + if (flags & FORK_PID1)
> + pr->ps_pid = 1;
> + else
> + pr->ps_pid = allocpid();
>  
>   /* post-copy fixups */
>   pr->ps_pptr = parent;
> @@ -332,7 +335,7 @@ fork1(struct proc *curp, int flags, void (*func)(void *), 
> void *arg,
>  
>   KASSERT((flags & ~(FORK_FORK | FORK_VFORK | FORK_PPWAIT | FORK_PTRACE
>   | FORK_IDLE | FORK_SHAREVM | FORK_SHAREFILES | FORK_NOZOMBIE
> - | FORK_SYSTEM | FORK_SIGHAND)) == 0);
> + | FORK_SYSTEM | FORK_SIGHAND | FORK_PID1)) == 0);
>   KASSERT((flags & FORK_SIGHAND) == 0 || (flags & FORK_SHAREVM));
>   KASSERT(func != NULL);
>  
> @@ -631,19 +634,12 @@ ispidtaken(pid_t pid)
>  pid_t
>  allocpid(void)
>  {
> - static pid_t lastpid;
>   pid_t pid;
>  
> - if (!randompid) {
> - /* only used early on for system processes */
> - pid = ++lastpid;
> - } else {
> - /* Find an unused pid satisfying lastpid < pid <= PID_MAX */
> - do {
> - pid = arc4random_uniform(PID_MAX - lastpid) + 1 +
> - lastpid;
> - } while (ispidtaken(pid));
> - }
> + /* Find an unused pid satisfying 1 < pid <= PID_MAX */
> + do {
> + pid = 2 + arc4random_uniform(PID_MAX - 1);
> + } while (ispidtaken(pid));
>  
>   return pid;
>  }
> diff --git a/sys/sys/proc.h b/sys/sys/proc.h
> index 4f015f2eeb0..b3b3ac4bb0d 100644
> --- a/sys/sys/proc.h
> +++ b/sys/sys/proc.h
> @@ -449,6 +449,7 @@ struct uidinfo *uid_find(uid_t);
>  #define FORK_SHAREVM 0x0080
>  #define FORK_SIGHAND 0x0200
>  #define FORK_PTRACE  0x0400
> +#define FORK_PID10x0800
>  
>  #define EXIT_NORMAL  0x0001
>  #define EXIT_THREAD  0x0002
> @@ -470,7 +471,6 @@ extern struct proc proc0; /* Process slot for 
> swapper. */
>  extern struct process process0;  /* Process slot for kernel 
> threads. */
>  extern int nprocesses, maxprocess;   /* Cur and max number of processes. */
>  extern int nthreads, maxthread;  /* Cur and max number of 
> threads. */
> -extern int randompid;/* fork() should create random 
> pid's */
>  
>  LIST_HEAD(proclist, proc);
>

Re: arm64 pmap fix: CANFAIL logic

2017-02-17 Thread Dale Rahn
On Fri, Feb 17, 2017 at 08:18:36PM +1100, Jonathan Gray wrote:
> On Fri, Feb 17, 2017 at 02:11:55AM -0500, Dale Rahn wrote:
> > The logic to handle PMAP_CANFAIL, the logic was inverted originally.
> > 
> > Code has been simplified so that it is test for if !CANFAIL then panic
> 
> Looks good, but how about using __func__?  Avoids going > 80 in one case.

This is a nice improvement over my proposal.

Thanks
Dale
> 
> Index: pmap.c
> ===
> RCS file: /cvs/src/sys/arch/arm64/arm64/pmap.c,v
> retrieving revision 1.20
> diff -u -p -r1.20 pmap.c
> --- pmap.c7 Feb 2017 23:05:33 -   1.20
> +++ pmap.c17 Feb 2017 09:13:44 -
> @@ -370,8 +370,9 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
>   vp1 = pool_get(&pmap_vp_pool, vp_pool_flags);
>   if (vp1 == NULL) {
>   if ((flags & PMAP_CANFAIL) == 0)
> - return ENOMEM;
> - panic("unable to allocate L1");
> + panic("%s: unable to allocate L1",
> + __func__);
> + return ENOMEM;
>   }
>   pmap_set_l1(pm, va, vp1, 0);
>   }
> @@ -384,8 +385,8 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
>   vp2 = pool_get(&pmap_vp_pool, vp_pool_flags);
>   if (vp2 == NULL) {
>   if ((flags & PMAP_CANFAIL) == 0)
> - return ENOMEM;
> - panic("unable to allocate L2");
> + panic("%s: unable to allocate L2", __func__);
> + return ENOMEM;
>   }
>   pmap_set_l2(pm, va, vp2, 0);
>   }
> @@ -395,8 +396,8 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
>   vp3 = pool_get(&pmap_vp_pool, vp_pool_flags);
>   if (vp3 == NULL) {
>   if ((flags & PMAP_CANFAIL) == 0)
> - return ENOMEM;
> - panic("unable to allocate L3");
> + panic("%s: unable to allocate L3", __func__);
> + return ENOMEM;
>   }
>   pmap_set_l3(pm, va, vp3, 0);
>   }
> @@ -503,19 +504,17 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_
>   if (pted == NULL) {
>   pted = pool_get(&pmap_pted_pool, PR_NOWAIT | PR_ZERO);
>   if (pted == NULL) {
> - if ((flags & PMAP_CANFAIL) == 0) {
> - error = ENOMEM;
> - goto out;
> - }
> - panic("pmap_enter: failed to allocate pted");
> + if ((flags & PMAP_CANFAIL) == 0)
> + panic("%s: failed to allocate pted", __func__);
> + error = ENOMEM;
> + goto out;
>   }
>   if (pmap_vp_enter(pm, va, pted, flags)) {
> - if ((flags & PMAP_CANFAIL) == 0) {
> - error = ENOMEM;
> - pool_put(&pmap_pted_pool, pted);
> - goto out;
> - }
> - panic("pmap_enter: failed to allocate L2/L3");
> + if ((flags & PMAP_CANFAIL) == 0)
> + panic("%s: failed to allocate L2/L3", __func__);
> + error = ENOMEM;
> + pool_put(&pmap_pted_pool, pted);
> + goto out;
>   }
>   }
>  
> 
Dale Rahn   dr...@dalerahn.com



Re: ipcomp ipv6 output

2017-02-17 Thread David Hill
OK.

On Fri, Feb 17, 2017 at 03:09:25PM +0100, Alexander Bluhm wrote:
> Hi,
> 
> When using ipcomp(4) with IPv6 transport mode I get this error:
> 
> ping6: sendmsg: Protocol family not supported
> 
> The break in the switch statement is missing since rev 1.1 from 2001.
> So I am the first one testing this.
> 
> ok?
> 
> bluhm
> 
> Index: netinet/ip_ipcomp.c
> ===
> RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipcomp.c,v
> retrieving revision 1.54
> diff -u -p -r1.54 ip_ipcomp.c
> --- netinet/ip_ipcomp.c   9 Feb 2017 00:43:58 -   1.54
> +++ netinet/ip_ipcomp.c   17 Feb 2017 13:44:11 -
> @@ -411,6 +411,7 @@ ipcomp_output(struct mbuf *m, struct tdb
>   ipcompstat.ipcomps_toobig++;
>   return EMSGSIZE;
>   }
> + break;
>  #endif /* INET6 */
>  
>   default:
> 



ipcomp ipv6 output

2017-02-17 Thread Alexander Bluhm
Hi,

When using ipcomp(4) with IPv6 transport mode I get this error:

ping6: sendmsg: Protocol family not supported

The break in the switch statement is missing since rev 1.1 from 2001.
So I am the first one testing this.

ok?

bluhm

Index: netinet/ip_ipcomp.c
===
RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/ip_ipcomp.c,v
retrieving revision 1.54
diff -u -p -r1.54 ip_ipcomp.c
--- netinet/ip_ipcomp.c 9 Feb 2017 00:43:58 -   1.54
+++ netinet/ip_ipcomp.c 17 Feb 2017 13:44:11 -
@@ -411,6 +411,7 @@ ipcomp_output(struct mbuf *m, struct tdb
ipcompstat.ipcomps_toobig++;
return EMSGSIZE;
}
+   break;
 #endif /* INET6 */
 
default:



Re: unbound 1.6.1rc1

2017-02-17 Thread Stuart Henderson
On 2017/02/17 08:43, Florian Obser wrote:
> On Tue, Feb 14, 2017 at 10:45:08PM +, Stuart Henderson wrote:
> > On 2017/02/09 15:59, Stuart Henderson wrote:
> > > Here's an update to the release candidate for 1.6.1. Tests/feedback 
> > > welcome.
> > > Diff is 600K so it's at https://junkpile.org/unbound-1.6.1rc1.diff rather
> > > than inline.
> > 
> > Updated for rc3 at https://junkpile.org/unbound-1.6.1rc3.diff. I've had
> 
> hmm, that is a 404. But the rc1 diff is still up. Had a look, and it
> doesn't stop scrolling... No idea how to review this. Also I don't
> run unbound in production. Not feeling too confident OK'ing this.
> Not fundamentally opposed either 

Thanks for looking. Typo in filename fixed, it'll work now.

The diff is pretty huge both from real changes and from things like
typedef changes (lots of "foo_t" -> "foo_type").  I've just put together
https://junkpile.org/unbound-1.6.1rc3.diff.trimmed which is not suitable
for applying but has the worst of the junk removed (typedef changes,
autoconf bits). It's still a big diff, 10k lines, though.

> > a few positive test reports from the earlier one, and no substantial changes
> > for us in the update (and I don't expect any before the release).
> > 
> > Any OKs to commit this? (then I'd merge release changes over the top,
> > presumably just version number changes for the final release).
> > 
> 
> -- 
> I'm not entirely sure you are real.
> 



Re: arm64 ddb support improvement

2017-02-17 Thread Jonathan Gray
On Fri, Feb 17, 2017 at 02:14:29AM -0500, Dale Rahn wrote:
> Fix pieces of aarch64 ddb support:
> kernel vs user mode detection
> implement (optimize) 8 byte reads
> cast address pointers to vaddr_t, not uint32_t (do not truncate)
> remove db_fetch_reg(), not used by OpenBSD
> implement ddb backtrace
> 
> note that "ddb> trace " expects a stack address, not a frame pointer
> address. These two addresses are offset by 16 bytes (frame = *(sp+16))

Here are a few different traces with this

boot> boot -d
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 3381268+473986+382632+668448 [95+403776+208655]=0x5445b8
[ using 613360 bytes of bsd ELF symbol table ]
Stopped at  initarm+0x390:
ddb> trace
Debugger() at initarm+0x38c

panic: root device (e209950d424910b9) not found
Stopped at  panic+0x158:TIDPIDUID PRFLAGS PFLAGS  C
PU  COMMAND
* 0  0  0 0x1  0x2000  swapper
Debugger() at panic+0x154
panic() at diskconf+0xac
diskconf() at main+0x490
main() at $x.2+0x70
https://www.openbsd.org/ddb.html describes the minimum info required in bug
reports.  Insufficient info makes it difficult to find and fix bugs.
ddb> tr
Debugger() at panic+0x154
panic() at diskconf+0xac
diskconf() at main+0x490

# sysctl ddb.trigger=1
Stopped at  ddb_sysctl+0x1a4:
ddb> tr
Debugger() at ddb_sysctl+0x1a0
ddb_sysctl() at svc_handler+0x1cc
svc_handler() at handle_el0_sync+0x68
handle_el0_sync() at __ALIGN_SIZE+0x400248
--- trap ---
ddb>



Re: arm64 pmap fix: CANFAIL logic

2017-02-17 Thread Jonathan Gray
On Fri, Feb 17, 2017 at 02:11:55AM -0500, Dale Rahn wrote:
> The logic to handle PMAP_CANFAIL, the logic was inverted originally.
> 
> Code has been simplified so that it is test for if !CANFAIL then panic

Looks good, but how about using __func__?  Avoids going > 80 in one case.

Index: pmap.c
===
RCS file: /cvs/src/sys/arch/arm64/arm64/pmap.c,v
retrieving revision 1.20
diff -u -p -r1.20 pmap.c
--- pmap.c  7 Feb 2017 23:05:33 -   1.20
+++ pmap.c  17 Feb 2017 09:13:44 -
@@ -370,8 +370,9 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
vp1 = pool_get(&pmap_vp_pool, vp_pool_flags);
if (vp1 == NULL) {
if ((flags & PMAP_CANFAIL) == 0)
-   return ENOMEM;
-   panic("unable to allocate L1");
+   panic("%s: unable to allocate L1",
+   __func__);
+   return ENOMEM;
}
pmap_set_l1(pm, va, vp1, 0);
}
@@ -384,8 +385,8 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
vp2 = pool_get(&pmap_vp_pool, vp_pool_flags);
if (vp2 == NULL) {
if ((flags & PMAP_CANFAIL) == 0)
-   return ENOMEM;
-   panic("unable to allocate L2");
+   panic("%s: unable to allocate L2", __func__);
+   return ENOMEM;
}
pmap_set_l2(pm, va, vp2, 0);
}
@@ -395,8 +396,8 @@ pmap_vp_enter(pmap_t pm, vaddr_t va, str
vp3 = pool_get(&pmap_vp_pool, vp_pool_flags);
if (vp3 == NULL) {
if ((flags & PMAP_CANFAIL) == 0)
-   return ENOMEM;
-   panic("unable to allocate L3");
+   panic("%s: unable to allocate L3", __func__);
+   return ENOMEM;
}
pmap_set_l3(pm, va, vp3, 0);
}
@@ -503,19 +504,17 @@ pmap_enter(pmap_t pm, vaddr_t va, paddr_
if (pted == NULL) {
pted = pool_get(&pmap_pted_pool, PR_NOWAIT | PR_ZERO);
if (pted == NULL) {
-   if ((flags & PMAP_CANFAIL) == 0) {
-   error = ENOMEM;
-   goto out;
-   }
-   panic("pmap_enter: failed to allocate pted");
+   if ((flags & PMAP_CANFAIL) == 0)
+   panic("%s: failed to allocate pted", __func__);
+   error = ENOMEM;
+   goto out;
}
if (pmap_vp_enter(pm, va, pted, flags)) {
-   if ((flags & PMAP_CANFAIL) == 0) {
-   error = ENOMEM;
-   pool_put(&pmap_pted_pool, pted);
-   goto out;
-   }
-   panic("pmap_enter: failed to allocate L2/L3");
+   if ((flags & PMAP_CANFAIL) == 0)
+   panic("%s: failed to allocate L2/L3", __func__);
+   error = ENOMEM;
+   pool_put(&pmap_pted_pool, pted);
+   goto out;
}
}
 



Re: unbound 1.6.1rc1

2017-02-17 Thread Florian Obser
On Tue, Feb 14, 2017 at 10:45:08PM +, Stuart Henderson wrote:
> On 2017/02/09 15:59, Stuart Henderson wrote:
> > Here's an update to the release candidate for 1.6.1. Tests/feedback welcome.
> > Diff is 600K so it's at https://junkpile.org/unbound-1.6.1rc1.diff rather
> > than inline.
> 
> Updated for rc3 at https://junkpile.org/unbound-1.6.1rc3.diff. I've had

hmm, that is a 404. But the rc1 diff is still up. Had a look, and it
doesn't stop scrolling... No idea how to review this. Also I don't
run unbound in production. Not feeling too confident OK'ing this.
Not fundamentally opposed either 

> a few positive test reports from the earlier one, and no substantial changes
> for us in the update (and I don't expect any before the release).
> 
> Any OKs to commit this? (then I'd merge release changes over the top,
> presumably just version number changes for the final release).
> 

-- 
I'm not entirely sure you are real.