From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tb-mx1.topicbox.com (localhost.local [127.0.0.1]) by tb-mx1.topicbox.com (Postfix) with ESMTP id DA41222CD200 for <9fans@9fans.net>; Mon, 4 May 2020 16:05:49 -0400 (EDT) (envelope-from ole.hjalmar.kristensen@gmail.com) Received: from tb-mx1.topicbox.com (localhost [127.0.0.1]) by tb-mx1.topicbox.com (Authentication Milter) with ESMTP id 081F77BE46A; Mon, 4 May 2020 16:05:49 -0400 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1588622749; b=ynW1jRkhH2/bGMnuShXaDC74J3ZR9q3OX7fhWqgPujuMVbeh48 xSsI6HoTIAOsRU2n5PSRgHPofyCjjL4etQxGLBur0KZHijBTp0Z1AjDweSAgpc6g 9GCrzVhU4v3vmg5dynmnGxLyDoRsDYUynQ4rDrvVp+/GEflV6sCRohLm21XeFMEi 28Kot/2ud9K5yQtvgiQY05QB+lM+BGmUe29/yRniRvrvk8EnhQ1AoXmGaXiwyOTx BMqNXahqAWJu3pIsFzVdDwCEtjB2Ri9xBtW4KMppdoS+boaCyboxJadEKpRku+iq C62Xd4B0cUR/KUxhrA/X7/7jDjq8B3g14tsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:from:date:message-id:subject:to :content-type; s=arcseal; t=1588622749; bh=yg9t0LOXyPRTwC0h+e5hc JQsaK3MBpwsGF/Om2H/yeU=; b=hhZxvMaqoaBavxbNTME2lOo5pBWgwJqVreToi WRJYACL3036dKAT6CZjC6ge3e/eieBGgbWEuMMHf9BIXcPf3JVp+zxm29gbO/ww+ hh9soOHCwZkSnrKgIngEl1a07N3eegrQb0DA6VzsFRXU+LRCKHBcJchvCznIfuRA ZDs2bc/p1fpMPIPOw03vhpaJCYXJJtStYWm3WDo/YtCAL8Ci875oQCjisPfDpn/o ZjHQ0U9Qk+VDEO3e+RmpJtzhuJWpMVKcmdhzeR4bOPwDuqweqeIzG+YFOdCkDYTV c5Qk7WQahwBLlCJuiYWDLvfkVz0AWPL64XHtCqKVCNunrEavQ== ARC-Authentication-Results: i=1; tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=q3AkHxyX header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.68 (mail-lf1-f68.google.com); spf=pass smtp.mailfrom=ole.hjalmar.kristensen@gmail.com smtp.helo=mail-lf1-f68.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=Lso+mxr6; x-ptr=pass smtp.helo=mail-lf1-f68.google.com policy.ptr=mail-lf1-f68.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-50 state=0 Authentication-Results: tb-mx1.topicbox.com; arc=none (no signatures found); bimi=none (Domain is not BIMI enabled); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=q3AkHxyX header.a=rsa-sha256 header.s=20161025 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.167.68 (mail-lf1-f68.google.com); spf=pass smtp.mailfrom=ole.hjalmar.kristensen@gmail.com smtp.helo=mail-lf1-f68.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=Lso+mxr6; x-ptr=pass smtp.helo=mail-lf1-f68.google.com policy.ptr=mail-lf1-f68.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.2 smtp.cipher=ECDHE-RSA-AES256-GCM-SHA384 smtp.bits=256/256; x-vs=clean score=-50 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeduhedrjeeggddvgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenufhushhpihgtihhouhhsucgftffnucdlhedtmdenucfjughrpegg hfffkffuvfgtsegrtderredttdejnecuhfhrohhmpefqlhgvqdfjjhgrlhhmrghrucfmrh hishhtvghnshgvnhcuoeholhgvrdhhjhgrlhhmrghrrdhkrhhishhtvghnshgvnhesghhm rghilhdrtghomheqnecuggftrfgrthhtvghrnhepvdeikeeuiedtgeejleehheeiueehfe ejfeegfeehtdfgfeeftefgudefleejfefgnecuffhomhgrihhnpeduvdejrddtrddtrddu necukfhppedvtdelrdekhedrudeijedrieeknecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehinhgvthepvddtledrkeehrdduieejrdeikedphhgvlhhopehmrghilhdq lhhfuddqfheikedrghhoohhglhgvrdgtohhmpdhmrghilhhfrhhomhepoeholhgvrdhhjh grlhhmrghrrdhkrhhishhtvghnshgvnhesghhmrghilhdrtghomhequcfukfgkgfepuddt keehvd X-ME-VSScore: -50 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'ole.hjalmar.kristensen@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=tb-mx1.topicbox.com; identity=mailfrom; envelope-from="ole.hjalmar.kristensen@gmail.com"; helo=mail-lf1-f68.google.com; client-ip=209.85.167.68 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tb-mx1.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Mon, 4 May 2020 16:05:49 -0400 (EDT) (envelope-from ole.hjalmar.kristensen@gmail.com) Received: by mail-lf1-f68.google.com with SMTP id h26so7939695lfg.6 for <9fans@9fans.net>; Mon, 04 May 2020 13:05:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=yg9t0LOXyPRTwC0h+e5hcJQsaK3MBpwsGF/Om2H/yeU=; b=q3AkHxyXlV8QML1VQu9lhcZ2lwCoy3WEm9+TWV0VxaVp7ARB1QHoy71BqEvWMDE7LQ aILYKOP/5YHiBkXGxBGXbz8h7whcVIu220DaG2fASs/tsfpcQp49LMeODeTNKxx9z+KQ QOCkU/NtXPGwErotPtKSLGQEhrIzcNVG4vBXUyQqChkYWxyDmM/VcZpvqg56ho2pIGkS Dzp1P4dN2iubaYgVqYKlfKjT5oF/GcnDsnFzvtAdzYBqPA2PxkU5fWMjTp8DqOC3V10f emnhKsAyOfv+9g0A5jG4M4chzgp0IQjPeP97ZTOCUwvYB53cIYqcyutrsg49tEwswGLX rpSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=yg9t0LOXyPRTwC0h+e5hcJQsaK3MBpwsGF/Om2H/yeU=; b=Lso+mxr65Ua4cG24VWS/GmdF2YSvz8LjcSlqxw+gnXjO8RKmdWLtokCl2ZppsXQw1R jvoMmIJzUQRjkqm6LQmUvrzVrBMe7awW2LGmU/jEwy31f5Ks2YOwT/Xjw1Z5e1llA+Af xc9uIYIDK57YcdqECXgz80BeFsOSn9by2vOqI4wsmJPO5S3pJxEfdnZpcc+KY71mgynH 7lLxpe1fDOWMInN5/p/u0rdsbuBRfe/PuGwo1to2zyeibOVl3a2US6LA+7+Wts6xw7MK 3rO+hgLjB6oE3Hm2zq5bbf1ZfT4Qx+hcfH4gcDXvv6VSDNMR0JXrNOvQb38SrGefCP7A P5mg== X-Gm-Message-State: AGi0PuY6KXFo/a2+ia93zAHM5iHHsF/4/Ib2qIL4Jigeb5fuLvvEQyAN lS2b8QnX/9FtOj5t9Udp9pacfPVDfnfwrjjYBI5tOpoDWYRBQw== X-Google-Smtp-Source: APiQypJCP52DM6uKKzQo1BaDGs7/aJGSwa8SlI7NLYW464+Jc+1pnFoDnQHHFx2XjWc1TVvsIB6btbKVHvmQkRECEHo= X-Received: by 2002:a19:ee19:: with SMTP id g25mr9007714lfb.124.1588622747247; Mon, 04 May 2020 13:05:47 -0700 (PDT) MIME-Version: 1.0 From: Ole-Hjalmar Kristensen Date: Mon, 4 May 2020 22:05:36 +0200 Message-ID: Subject: Venti on OpenBSD - some information and a question To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary="00000000000088281705a4d80ed4" Topicbox-Policy-Reasoning: allow: sender is a member Topicbox-Message-UUID: a9a15444-8e42-11ea-968b-fc68c6ec62b0 --00000000000088281705a4d80ed4 Content-Type: text/plain; charset="UTF-8" I am in the process of moving a venti from Linux to OpenBSD. First, unless int _p9dir(struct stat *lst, struct stat *st, char *name, Dir *d, char **str, char *estr) is patched, it will always return size 0 for raw partitions. We need to allow character devices as well, not just block devices: diff --git a/src/lib9/_p9dir.c b/src/lib9/_p9dir.c index 58c63573..0fb3410e 100644 --- a/src/lib9/_p9dir.c +++ b/src/lib9/_p9dir.c @@ -230,7 +230,7 @@ _p9dir(struct stat *lst, struct stat *st, char *name, Dir *d, char **str, char * d->qid.path = ('c'<<16)|st->st_rdev; } /* fetch real size for disks */ - if(S_ISBLK(lst->st_mode)){ + if(S_ISBLK(lst->st_mode) || S_ISCHR(lst->st_mode)){ if((fd = open(name, O_RDONLY)) >= 0){ d->length = disksize(fd, st); close(fd); dell-openbsd$ git log | head commit c1c1b5267fd5e14be531a4b22ed0124b35d427cb Author: sean Date: Wed Apr 29 11:21:35 2020 +0100 Second, if your raw partitions are MBR partitions, not OpenBSD disk labels, you will still get 0 size, so venti will not run. Disk with only MBR partitions: dell-openbsd# disklabel sd1 16 partitions: # size offset fstype [fsize bsize cpg] c: 488378645 0 unused i: 460800000 256 unknown j: 25600000 460800256 unknown k: 1834980 486400770 unknown In this case you will need to run disklabel and edit the label to get BSD partitions: dell-openbsd# disklabel sd1. 16 partitions: # size offset fstype [fsize bsize cpg] c: 488378645 0 unused d: 460800000 256 4.2BSD 4096 32768 1 e: 25600000 460800256 4.2BSD 4096 32768 1 f: 1834980 486400770 4.2BSD 4096 32768 1 i: 460800000 256 unknown j: 25600000 460800256 unknown k: 1834980 486400770 unknown Now for the question. For some reason, the venti running on OpenBSD is refusing connections, both on port 80 and on 17034. No error messages from venti that I can see. dell-openbsd# bin/venti/venti -d -c /home/ole/venti/v2.conf 2020/0504 21:48:08 venti: conf...httpd tcp!*!80...init...icache 1,895,825,408 bytes = 18,850,537 entries; 16 scache sync...announce tcp!*!17034...serving. I can connect to the venti from localhost, but not from any other machine. However, if I run nc -l on ports 17034 and 80, I can connect from any machine. It is definitely not the packet filter, since the problem persists even if I disable the packet filter. Any suggestions about what might be blocking the connection? The only real clue I have is that even on localhost I get "connection refused", but telnet switches to IPv6 and that attempt is accepted: dell-openbsd$ telnet localhost 17034 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused Trying ::1... Connected to localhost. Escape character is '^]'. venti-04:02-libventi Is it possible that venti somehow is listening only on the IPv6 address? Ole-Hj. --00000000000088281705a4d80ed4 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am in the process of moving a venti from Linux to OpenBS= D.
First, unless int _p9dir(struct stat *lst, struct stat *st, char *na= me, Dir *d, char **str, char *estr) is patched, it will always return size = 0 for raw partitions.
We need to allow character devices as well,= not just block devices:

diff --git a/src/lib9/_p9= dir.c b/src/lib9/_p9dir.c
index 58c63573..0fb3410e 100644
--- a/src/l= ib9/_p9dir.c
+++ b/src/lib9/_p9dir.c
@@ -230,7 +230,7 @@ _p9dir(struc= t stat *lst, struct stat *st, char *name, Dir *d, char **str, char *
=C2= =A0 d->qid.path =3D ('c'<<16)|st->st_rdev;
=C2=A0 = }
=C2=A0 /* fetch real size for disks */
- if(S_ISBLK(lst->st_m= ode)){
+ if(S_ISBLK(lst->st_mode) || S_ISCHR(lst->st_mode)){
= =C2=A0 if((fd =3D open(name, O_RDONLY)) >=3D 0){
=C2=A0 d->le= ngth =3D disksize(fd, st);
=C2=A0 close(fd);
dell-openbsd$ git log= | head
commit c1c1b5267fd5e14be531a4b22ed0124b35d427cb
Author: sean = <phonologus@gmail.com>Date: =C2=A0 Wed Apr 29 11:21:35 2020 +0100

Second, if y= our raw partitions are MBR partitions, not OpenBSD disk labels, you will st= ill get 0 size, so venti will not run.
Disk with only MBR partiti= ons:

dell-openbsd# disklabel sd1
16 partitions:=
# =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 offset =C2=A0fstype [fsize bsize =C2=A0 cpg]=C2=A0 c: =C2=A0 =C2=A0 =C2=A0 =C2=A0488378645 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A0 =C2=A00 =C2=A0unused =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 i: =C2=A0 =C2=A0 =C2=A0 = =C2=A0460800000 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0256 unknown= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
= =C2=A0 j: =C2=A0 =C2=A0 =C2=A0 =C2=A0 25600000 =C2=A0 =C2=A0 =C2=A0 =C2=A04= 60800256 unknown =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0
=C2=A0 k: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01834980 =C2=A0= =C2=A0 =C2=A0 =C2=A0486400770 unknown =C2=A0=C2=A0

In this case you will need to run disklabel and edit the label to get BSD= partitions:=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<= br>dell-openbsd# disklabel sd1.=C2=A0
16 partitions:
# =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0size =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 offset =C2=A0fstype [fsize bsize =C2=A0 cpg]
=C2=A0 c: =C2= =A0 =C2=A0 =C2=A0 =C2=A0488378645 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A00 =C2=A0unused =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 d: =C2=A0 =C2=A0 =C2=A0 =C2=A0460800000 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0256 =C2=A04.2BSD =C2=A0 409= 6 32768 =C2=A0 =C2=A0 1
=C2=A0 e: =C2=A0 =C2=A0 =C2=A0 =C2=A0 25600000 = =C2=A0 =C2=A0 =C2=A0 =C2=A0460800256 =C2=A04.2BSD =C2=A0 4096 32768 =C2=A0 = =C2=A0 1
=C2=A0 f: =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A01834980 =C2=A0 =C2= =A0 =C2=A0 =C2=A0486400770 =C2=A04.2BSD =C2=A0 4096 32768 =C2=A0 =C2=A0 1 <= br>=C2=A0 i: =C2=A0 =C2=A0 =C2=A0 =C2=A0460800000 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0256 unknown =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 j: =C2=A0 =C2=A0 =C2=A0 =C2=A0 25= 600000 =C2=A0 =C2=A0 =C2=A0 =C2=A0460800256 unknown =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0
=C2=A0 k: =C2=A0 =C2=A0= =C2=A0 =C2=A0 =C2=A01834980 =C2=A0 =C2=A0 =C2=A0 =C2=A0486400770 unknown= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=C2=A0

Now for t= he question. For some reason, the venti running on OpenBSD is refusing conn= ections, both on port 80 and on 17034. No error messages from venti that I = can see.
dell-openbsd# bin/venti/venti -d -c /home/ole/venti/v2.c= onf
2020/0504 21:48:08 venti: conf...httpd tcp!*!80...init...icach= e 1,895,825,408 bytes =3D 18,850,537 entries; 16 scache
sync...announce = tcp!*!17034...serving.

I can connect to the venti fr= om localhost, but not from any other machine. However, if I run nc -l on po= rts 17034 and 80, I can connect from any machine. It is definitely not the = packet filter, since the problem persists even if I disable the packet filt= er. Any suggestions about what might be blocking the connection?
=
The only real clue I have is that even on localhost I get &q= uot;connection refused", but telnet switches to IPv6 and that attempt = is accepted:
dell-openbsd$ telnet localhost 17034
Trying 127.0= .0.1...
telnet: connect to address 127.0.0.= 1: Connection refused
Trying ::1...
Connected to localhost.
Es= cape character is '^]'.
venti-04:02-libventi

<= /div>
Is it possible that venti somehow is listening only on the IPv6 a= ddress?

Ole-Hj.

--00000000000088281705a4d80ed4--