Re: 4-ports router under $150

2018-04-09 Thread Predrag Punosevac
On 04/07/18 14:59, Anatoli wrote:
> Hi All!
>
> I'm looking for a modest 4-5 ports router under $150 that works well 
> with OpenBSD. I don't need WiFi, USB or console port, and the 
> throughput don't need to exceed 100Mbps. The ideal device would be 
> EdgeRouter X (compact, 5 ports, $50) but I know it's not supported at 
> this moment and probably never will be.
>
> EdgeRouter (ER) Lite only has 3 ports and the switch ports (eth2-4) of

> ERPOE-5 are not yet supported.
>
> ER-4 would be great, but the 4th port is SFP, I'd need to by an SFP 
> NIC for one of my devices and I'm not sure it's supported as the 
> octeon page says ER PRO SFP ports are not supported yet. Also it's a 
> bit expensive ($190).
>
> Banana Pi R2 would be great too, but I couldn't find if it's supported

> by OpenBSD (it has MediaTek MT7623N, Quad-core ARM Cortex-A7).
>
> Are there 4-5 port devices that are known to work well with OpenBSD?
>
> Thanks,
> Anatoli
>

This is slightly over your price range but I have a bunch of these
deployed in few startups.

https://www.amazon.com/Firewall-Micro-Appliance-Gigabit-Barebone/dp/B01GIVQI3M
This one looks even better but it is more expensive. 

https://www.amazon.com/Firewall-Appliance-Gigabit-AES-NI-Barebone/dp/B072ZTCNLK
I don't have any of those models. 

I do have EdgeRouter Lite  Ubiquiti Networks but it has 3 ports in
total. 

Predrag

P.S. I would really like to hear from OpenBSD users who own one of these
devices

https://www.openbsd.org/armv7.html



Re: is there foomatic-rip for lpd on openBSD 6.3?

2018-04-09 Thread Predrag Punosevac
On Mon, Apr 09, 2018 at 04:52:36PM +0200, Rudolf Sykora wrote:
> > Hello,
> > 
> > I want to print from openBSD 6.3. I tried to use lpd and found
> > some information on the web about setting up /etc/printcap.

Around here we actually read man pages and pkg-readmes

predrag@oko$ uname -a
OpenBSD oko.bagdala2.net 6.3 GENERIC.MP#107 amd64

Please check for foomatic-rip filters explanation which was
intensionally broken by upstream for LPD spooling 

/usr/local/share/doc/pkg-readmes/cups-filters-1.20.1

You should also try to find your answer by searching first 

misc@openbsd and ports@openbsd

Here is my post which would have answered your question.

https://marc.info/?l=openbsd-ports&m=141490031517069&w=2


> > Many texts use the foomatic-rip program. I can't find one
> > in ports. Is there anything instead? What's the recommended
> > way to set up printing?
> 
> i've been using cups and works.

Most of OpenBSD guys I personally know are big believers in KISS
principle. Answering original question with a suggestion that a simple
functionality available from the base should be replaced with a very
complicated external program is a bad advise.

Predrag



> 
> > 
> > Thanks for any comments
> > Ruda



Re: Date of yesterday

2018-04-09 Thread Jordan Geoghegan

On 04/09/18 13:58, Stephane HUC "PengouinBSD" wrote:

Excuse-me, but i dont really understand this!
(perhaps, because it's in english).

If you don't understand how Daylight Savings time works, or how time 
works on computers in general, then you should just trust the expert 
advice offered to you by Philip- he even went to the trouble of 
explaining it to you several different ways; and Daniel linked to all 
the information you could ever need regarding Daylight Savings.




Having problems sleeping a used computer

2018-04-09 Thread Peter J. Philipp
Hi,

I inherited a computer which I want to make a sleeping backup computer.  The
idea is that it sleeps during the day and then I wake it with arp -W and it
receives backups and then it goes back to sleep, but I'm running into problems.

First with a snapshot kernel when I wake the box I get this, and the system
is inoperable (due to the ahci not coming ready, 3rd line from top, sorry
about the flash on my camera, I had one shot and I didn't want to repeat the
moment). The screenshot is here:

http://centroid.eu/private/ahci-problem.jpg

Then I added a longer timeout on ahci and it at least put the wake state into
a stable state, here is my patch but it's far from perfect:


Index: ahci.c
===
RCS file: /cvs/src/sys/dev/ic/ahci.c,v
retrieving revision 1.32
diff -u -p -u -r1.32 ahci.c
--- ahci.c  21 Aug 2017 21:43:46 -  1.32
+++ ahci.c  9 Apr 2018 21:36:47 -
@@ -1504,7 +1504,7 @@ retry:
 
/* Wait for device to become ready */
if (ahci_pwait_clr(ap, AHCI_PREG_TFD, AHCI_PREG_TFD_STS_BSY |
-   AHCI_PREG_TFD_STS_DRQ | AHCI_PREG_TFD_STS_ERR, 3)) {
+   AHCI_PREG_TFD_STS_DRQ | AHCI_PREG_TFD_STS_ERR, 10)) {
/* even if the device doesn't wake up, check if there's
 * a port multiplier there
 */

It could be perfect, but there is still a problem.  When I put the box back to
sleep it goes shortly for a blip second and then it wakes again, almost like
there is data in its wake buffer that was never flushed.  I'm suspecting it's
probably caused by the drm WARNINGS.

At last under my signature I'm going to have the dmesg with 2 wake sessions.
So I'm wondering if anyone has hints, patches to try, or otherwise?

Best Regards,
-peter


OpenBSD 6.3-current (GENERIC.MP) #0: Mon Apr  9 22:50:34 CEST 2018
p...@theta.centroid.eu:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4259340288 (4062MB)
avail mem = 4123148288 (3932MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xeafb0 (100 entries)
bios0: vendor American Megatrends Inc. version "E7728MLN.208" date 08/15/2011
bios0: MEDIONPC MS-7728
acpi0 at bios0: rev 2
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC SSDT MCFG SLIC HPET
acpi0: wakeup devices BR20(S3) EUSB(S3) USBE(S3) PEX0(S4) RTL_(S1) PEX1(S4) 
PEX2(S4) PEX3(S4) PEX4(S4) PEX5(S4) PEX6(S4) PEX7(S4) P0P1(S4) P0P2(S3) 
P0P3(S3) P0P4(S3) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 3292.97 MHz
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
cpu0: 256KB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
cpu0: mwait min=64, max=64, C-substates=0.2.1.1, IBE
cpu1 at mainbus0: apid 2 (application processor)
cpu1: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 3292.53 MHz
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
cpu2 at mainbus0: apid 1 (application processor)
cpu2: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 3292.53 MHz
cpu2: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 1, core 0, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i3-2120 CPU @ 3.30GHz, 3292.53 MHz
cpu3: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,POPCNT,DEADLINE,XSAVE,AVX,NXE,RDTSCP,LONG,LAHF,PERF,ITSC,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 0 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (PEX0)
acpiprt2 at acpi0: bus -1 (PEX1)
acpiprt3 at acpi0: bus -1 (PEX2)
acpiprt4 

Re: Date of yesterday

2018-04-09 Thread Daniel Ouellet
On 4/9/18 4:36 PM, Stephane HUC "PengouinBSD" wrote:
> what?
> 
> please, explain-me!

EDT EST for example.

Some days are even 82800 long.

Some time zone even have 1/2 hour if these still exists, so the would be

84600 or 88200.



Re: Date of yesterday

2018-04-09 Thread Martin Schröder
2018-04-09 20:58 GMT+02:00 Stephane HUC "PengouinBSD" :
> get the current timestamp, subtracting 86400 seconds is not reliable to
> get yesterday's date to the nearest second?

Did they teach leap seconds in your school yet?

Best
Martin



Re: Date of yesterday

2018-04-09 Thread Allan Streib
Tom Smyth  writes:

> Howdy...
> Daylight savings time sucks...  :/...
>  Is there a way to Reference UTC and then do  the calculating
> n and then convert to local time zone if  you are worried about
> calculating yesterday on the edge case of the 2 hrs a year
> that this would make an impact...

Yes, use the perl example someone suggested hours ago.

You don't want to mess with this stuff yourself. Use a proper date
libarary to do date calculations.

Allan



Re: Date of yesterday

2018-04-09 Thread Daniel Ouellet
Here to confuse you even more, there is time zone that have 30 minutes
and even 45 minutes differences.

https://www.timeanddate.com/time/time-zones-interesting.html

Have fun.


On 4/9/18 4:44 PM, Daniel Ouellet wrote:
> On 4/9/18 4:36 PM, Stephane HUC "PengouinBSD" wrote:
>> what?
>>
>> please, explain-me!
> 
> EDT EST for example.
> 
> Some days are even 82800 long.
> 
> Some time zone even have 1/2 hour if these still exists, so the would be
> 
> 84600 or 88200.
> 



Re: Date of yesterday

2018-04-09 Thread Philip Guenther
On Mon, Apr 9, 2018 at 2:05 PM, Tom Smyth 
wrote:

> Howdy...
> Daylight savings time sucks...  :/...
>  Is there a way to Reference UTC and then do  the calculating
> n and then convert to local time zone if  you are worried about
> calculating yesterday on the edge case of the 2 hrs a year
> that this would make an impact...
>

What...why...why are you making this harder than it has to be?

mktime/localtime let you perform calculations based on time broken down
into years/months/days/etc.  "Yesterday" is a calculation based on days, so
do it in that form.  Those APIs exist to let you do that!  That's what the
solution I provided in my original reply does!



> as a side issue would  avoiding running this particular job
> between 11PM and 1am  prevent the edge case from having
> an impact
>

So you know how to do the Right Thing, but you're going to instead leave a
bug for you or your successor to hit months or years away?  Please do not
do that on any system that others might depend on.


Philip Guenther


Re: Date of yesterday

2018-04-09 Thread Stephane HUC "PengouinBSD"
Excuse-me, but i dont really understand this!
(perhaps, because it's in english).

Le 04/09/18 à 22:45, Philip Guenther a écrit :
> On Mon, Apr 9, 2018 at 1:36 PM, Stephane HUC "PengouinBSD" <
> b...@stephane-huc.net> wrote:
> 
>> what?
>>
>> please, explain-me!
>>
> As I wrote before, and you quoted before:
> 
>> | Did you test that after 11pm on the day when daylight-saving time ends
> and
>> | the clock is turned back, resulting in a 25 hour long day?
> 
> On the day when daylight-saving time ends, the clock is turned back an hour
> resulting in a day which is 25 hours long!
> 
>  : morgaine; date -r $((1541403000))
> Sun Nov  4 23:30:00 PST 2018
> : morgaine; date -r $((1541403000 - 86400))
> Sun Nov  4 00:30:00 PDT 2018
> : morgaine;
> 

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



Re: Date of yesterday

2018-04-09 Thread Tom Smyth
Howdy...
Daylight savings time sucks...  :/...
 Is there a way to Reference UTC and then do  the calculating
n and then convert to local time zone if  you are worried about
calculating yesterday on the edge case of the 2 hrs a year
that this would make an impact...

as a side issue would  avoiding running this particular job
between 11PM and 1am  prevent the edge case from having
an impact
Peace out
Tom Smyth

On 9 April 2018 at 21:45, Philip Guenther  wrote:
> On Mon, Apr 9, 2018 at 1:36 PM, Stephane HUC "PengouinBSD" <
> b...@stephane-huc.net> wrote:
>
>> what?
>>
>> please, explain-me!
>>
> As I wrote before, and you quoted before:
>
>> | Did you test that after 11pm on the day when daylight-saving time ends
> and
>> | the clock is turned back, resulting in a 25 hour long day?
>
> On the day when daylight-saving time ends, the clock is turned back an hour
> resulting in a day which is 25 hours long!
>
>  : morgaine; date -r $((1541403000))
> Sun Nov  4 23:30:00 PST 2018
> : morgaine; date -r $((1541403000 - 86400))
> Sun Nov  4 00:30:00 PDT 2018
> : morgaine;



-- 
Kindest regards,
Tom Smyth

Mobile: +353 87 6193172
The information contained in this E-mail is intended only for the
confidential use of the named recipient. If the reader of this message
is not the intended recipient or the person responsible for
delivering it to the recipient, you are hereby notified that you have
received this communication in error and that any review,
dissemination or copying of this communication is strictly prohibited.
If you have received this in error, please notify the sender
immediately by telephone at the number above and erase the message
You are requested to carry out your own virus check before
opening any attachment.



Re: Date of yesterday

2018-04-09 Thread Philip Guenther
On Mon, Apr 9, 2018 at 1:36 PM, Stephane HUC "PengouinBSD" <
b...@stephane-huc.net> wrote:

> what?
>
> please, explain-me!
>
As I wrote before, and you quoted before:

> | Did you test that after 11pm on the day when daylight-saving time ends
and
> | the clock is turned back, resulting in a 25 hour long day?

On the day when daylight-saving time ends, the clock is turned back an hour
resulting in a day which is 25 hours long!

 : morgaine; date -r $((1541403000))
Sun Nov  4 23:30:00 PST 2018
: morgaine; date -r $((1541403000 - 86400))
Sun Nov  4 00:30:00 PDT 2018
: morgaine;


Re: Date of yesterday

2018-04-09 Thread Michael Lambert
> On 9 Apr 2018, at 16:34, Philip Guenther  wrote:
> 
> On Mon, Apr 9, 2018 at 11:58 AM, Stephane HUC "PengouinBSD" <
> b...@stephane-huc.net> wrote:
> 
>> get the current timestamp, subtracting 86400 seconds is not reliable to
>> get yesterday's date to the nearest second?
>> terrible!
> 
> 
> Yes, some days are 9 seconds long.

But those make up for the days that are only 82800 seconds...



Re: Date of yesterday

2018-04-09 Thread Stephane HUC "PengouinBSD"
what?

please, explain-me!


Le 04/09/18 à 22:34, Philip Guenther a écrit :
> On Mon, Apr 9, 2018 at 11:58 AM, Stephane HUC "PengouinBSD"
> mailto:b...@stephane-huc.net>> wrote:
>
> get the current timestamp, subtracting 86400 seconds is not
> reliable to
> get yesterday's date to the nearest second?
> terrible!
>
>
> Yes, some days are 9 seconds long.
>

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



Re: Date of yesterday

2018-04-09 Thread Philip Guenther
On Mon, Apr 9, 2018 at 11:58 AM, Stephane HUC "PengouinBSD" <
b...@stephane-huc.net> wrote:

> get the current timestamp, subtracting 86400 seconds is not reliable to
> get yesterday's date to the nearest second?
> terrible!


Yes, some days are 9 seconds long.


Re: Date of yesterday

2018-04-09 Thread Stephane HUC "PengouinBSD"
get the current timestamp, subtracting 86400 seconds is not reliable to
get yesterday's date to the nearest second?
terrible!


Le 04/09/18 à 20:48, Philip Guenther a écrit :
> On Mon, Apr 9, 2018 at 2:04 AM, Stephane HUC "CIOTBSD" > wrote:
> 
>> as: date -r $(( $(date +%s) - 86400)) +%F
>> ;)
> 
> ...
> 
>>> On Sun, Apr 08, 2018 at 11:12:43PM -0700, Philip Guenther wrote:
>>> | Did you test that after 11pm on the day when daylight-saving time ends
>> and
>>> | the clock is turned back, resulting in a 25 hour long day?
>>
> 
> 
> The best part about top-posting is that you don't have to read the earlier
> comments which already explained why the solution you're proposing isn't
> reliable...
> 

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



Moving dhcp from CentOS to OpenBSD

2018-04-09 Thread Shawn Southern
I'm moving my DHCP services from CentOS to OpenBSD. The OpenBSD dhcpd
service appears to work perfectly during testing, but I want to confirm
a few things:

1. In the dhcpd.conf on CentOS, the host definitions with fixed-address
set for static IPs need to be excluded from the range statement for
the subnet they are in. Is this the case for OpenBSD's dhcpd?

2. How do I move the dhcpd.leases database from CentOS to OpenBSD?
I've parsed the existing CentOS file to pull out the leases, starts,
end, hardware ethernet, and client-hostname lines, but the uid line is
very different in CentOS's dhcpd vs OpenBSD's. Can I just create new uid's
in the format that the dhcpd on OpenBSD uses based on the MAC address?

Thank you in advance!

dhcpd.conf:
default-lease-time 604800;  # 7 days (604800 seconds)
max-lease-time 604800;
option domain-name "mydomain.com";
option domain-name-servers 10.0.0.5, 10.0.0.6;

shared-network mydomain.com-vlan20 {
default-lease-time 345600;  # 4 days (345600 seconds)
subnet 10.20.20.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.20.20.255;
option routers 10.20.20.1;
range 10.20.20.50 10.20.20.200;
host bob { hardware ethernet aa:bb:02:7e:2c:92;
   fixed-address 10.20.20.131;
   option host-name "bob.static.mydomain.com"; }
host roger { hardware ethernet cc:d3:d1:a6:38:b9;
   fixed-address 10.20.20.143; 
   option host-name "roger.static.mydomain.com"; }
host mary { hardware ethernet d0:11:e2:26:55:91;
   fixed-address 10.20.20.158; 
   option host-name "mary.static.mydomain.com"; }
host steve { hardware ethernet 34:1f:d9:83:3d:a5; 
   fixed-address 10.20.20.159; 
   option host-name "steve.static.mydomain.com"; }
}
}

shared-network mydomain.com {
subnet 10.0.0.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.0.0.255;
option routers 10.0.0.1;
range 10.0.0.50 10.0.0.200;
}
}

shared-network mydomain.com-vlan10 {
option domain-name "test.mydomain.com";
option domain-name-servers 10.10.10.5, 10.10.10.6;
subnet 10.10.10.0 netmask 255.255.255.0 {
option subnet-mask 255.255.255.0;
option broadcast-address 10.10.10.255;
option routers 10.10.10.1;
range 10.10.10.50 10.10.10.99;
}
}



Re: Date of yesterday

2018-04-09 Thread Philip Guenther
On Mon, Apr 9, 2018 at 2:04 AM, Stephane HUC "CIOTBSD"  wrote:

> as: date -r $(( $(date +%s) - 86400)) +%F
> ;)

...

> > On Sun, Apr 08, 2018 at 11:12:43PM -0700, Philip Guenther wrote:
> > | Did you test that after 11pm on the day when daylight-saving time ends
> and
> > | the clock is turned back, resulting in a 25 hour long day?
>


The best part about top-posting is that you don't have to read the earlier
comments which already explained why the solution you're proposing isn't
reliable...


Re: Serial port pci cards.

2018-04-09 Thread Jordan Geoghegan
I have found that any usb dongle with a PL-2303 chipset just works out 
of the box. I have had great success with many different brands which 
use that chipset. It works out of the box with OpenBSD and Linux.



On 04/08/18 09:19, Michael Price wrote:

I am unwise in the ways of serial port pci cards. Should I be avoiding any
particular brands? Any pointers to more information would be appreciated.

Michael




Re: 4-ports router under $150

2018-04-09 Thread Jordan Geoghegan


On 04/09/18 05:46, Karel Gardas wrote:

On Sun, 8 Apr 2018 08:52:52 -0700
Jordan Geoghegan  wrote:


The pc engines stuff will still have blobs in it. There's no way to have
fully open firmware on a modern i-series chip based rig. At the end of
the day, we all are still using proprietary hardware.

APU2/3/4 is not i-series rig. It's using AMD GX412TC SoC based on
Jaguar cores. AFAIK this is one of last AMD chips running freely and
not requiring any blob. *If* you do have your own experience with this
hardware, then please share your details about what blobs exactly APU2
needs to run to perform routing business.

Thanks!
Karel


From what I can tell, the APU2 needs the AGESA binary though I am not 
positive as I am not a coreboot expert.


In the coreboot github repo I found this regarding the apu2 though I may 
be missing something here.


https://github.com/coreboot/blobs/commit/8ad2d6385652e14b6f0d35ab9b474c31ddeb1773#diff-95561ed31bc3a00a0d78661fa7681eef

Cheers,

Jordan



Re: Serial port pci cards.

2018-04-09 Thread Jan Stary
On Apr 08 12:05:17, j...@openbsd.org wrote:
> On Sun, 08 Apr 2018 at 12:19:01 -0400, Michael Price wrote:
> > I am unwise in the ways of serial port pci cards. Should I be avoiding any
> > particular brands? Any pointers to more information would be appreciated.
> 
> The puc(4) man page has a lot of brands and models that are supported.

In my experience, USB serial dongles have worked
much better for me than the PCI serial cards.

Jan



Re: Cannot access internet with virtual switch

2018-04-09 Thread Aham Brahmasmi
> Sent: Saturday, April 07, 2018 at 5:02 AM
> From: "Ayaka Koshibe" 
> To: "Aham Brahmasmi" 
> Cc: misc@openbsd.org
> Subject: Re: Cannot access internet with virtual switch
>
> On Fri, Apr 6, 2018 at 4:40 PM, Aham Brahmasmi  wrote:
> > Hello misc,
> >
> > Problem
> > A physical server with a switch (add em0 up) cannot access the internet.
> > However, the same host with a bridge (add em0 up) can access the
> > internet.
> >
> > Steps
> > $ ifconfig
> > em0: flags=8843 mtu 1500
> > lladdr 22:22:22:22:22:22
> > index 1 priority 0 llprio 3
> > groups: egress
> > media: Ethernet autoselect (1000baseT full-duplex,master)
> > status: active
> > inet 20.20.20.20 netmask 0xff00 broadcast 20.20.20.255
> > ...
> > $ doas route -n show
> > Routing tables
> >
> > Internet:
> > Destination GatewayFlags   Refs  Use   Mtu  Prio Iface
> > default 20.20.20.1 UGS0 1XXX - 8 em0
> > 224/4   127.0.0.1  URS00 32768 8 lo0
> > 127/8   127.0.0.1  UGRS   00 32768 8 lo0
> > 127.0.0.1   127.0.0.1  UHhl   1X 32768 1 lo0
> > 20.20.20/24 20.20.20.20UCn1  9XX - 4 em0
> > 20.20.20.1  33:33:33:33:33:33  UHLch  1 1XXX - 3 em0
> > 20.20.20.20 44:44:44:44:44:44  UHLl   0X - 1 em0
> > 20.20.20.25520.20.20.20UHb00 - 1 em0
> > $ ping 8.8.8.8
> > PING 8.8.8.8 (8.8.8.8): 56 data bytes
> > 64 bytes from 8.8.8.8: icmp_seq=0 ttl=61 time=x.xxx ms
> > ...
> > $ doas ifconfig switch0 create
> > $ doas ifconfig switch0 add em0
> > $ doas ifconfig switch0 up
> > $ ping 8.8.8.8
> > PING 8.8.8.8 (8.8.8.8): 56 data bytes
> > ^C
> > --- 8.8.8.8 ping statistics ---
> > 31 packets transmitted, 0 packets received, 100.0% packet loss
> 
> Hi,
> 
> Seems you haven't started switchd(8), or connected your switch to it
> -- it shouldn't forward traffic until you do so.


Hi Koshibe-san,

Thank you for your reply.

I have started switchd and connected to it. However, I still cannot
ping 8.8.8.8. Starting switchd in debug mode results in output which
broadly says error and closes the switch.

Steps (after the above switch0 up)
$ cat /etc/switchd.conf
listen on 0.0.0.0 tls port 6633
$ doas switchd -d
listen on 0.0.0.0 6633

(On another session)
$ switchctl connect /dev/switch0

(Back to main session)
ofrelay_input_done: ...
/dev/switch0 > any: ...
switch_learn: ...
packet_input: ...
any > /dev/switch0: ...
(above block repeated multiple times)
...
ofrelay_input_done: connection 1.1: 76 bytes from switch 1
0401004c 0013 00020004 040d00a9 0013  0001 0010
 0010    00c88be2 d687ac1f 6b2e22ce
8100026f 08004500 006f42d2
/dev/switch0 > any: version 1_3 type ERROR length 76 xid 19
error type BAD_ACTION code 4
ofp13_input: message not supported: ERROR
ofrelay_close: connection 1.1 closed
switch_remove: switch 1 removed.

(Another session)
$ tail -10 /var/log/messages
Apr 9 XX:XX:XX MachineName /bsd: arp: attempt to add entry for GATEWAY_IP
on em0 by XX:XX:XX:XX:XX:XX on tap0
(above message repeated infrequently)

If it helps in any way, this machine is a dedicated/bare-metal machine
on a large dedicated/bare-metal machine provider's network. The em0
interface is in the egress group, has a public IP and is connected to
the internet via the provider's network equipment.

The end goal in using the switch is to enable multiple OpenBSD VM's with
with non-contiguous public IPs to be connected to the Internet as real
hosts. In https://www.openbsd.org/faq/faq6.html#VMMnet, this is the
Option 4, except using a switch instead of a bridge and public IPs
on the host network.

Regards,
ab
-|-|-|-|-|-|-|--

> 
> > $ ifconfig
> > em0: flags=8b43 
> > mtu 1500
> > lladdr 22:22:22:22:22:22
> > index 1 priority 0 llprio 3
> > groups: egress
> > media: Ethernet autoselect (1000baseT full-duplex,master)
> > status: active
> > inet 20.20.20.20 netmask 0xff00 broadcast 20.20.20.255
> > switch0: flags=41
> > index 6 llprio 3
> > groups: switch
> > datapath xx maxflow 1 maxgroup 1000
> > em0 flags=0<>
> > port 1 ifpriority 0 ifcost 0
> > ...
> > $ doas route -n show
> > Routing tables
> >
> > Internet:
> > Destination GatewayFlags   Refs  Use   Mtu  Prio Iface
> > default 20.20.20.1 UGS0 1XXX - 8 em0
> > 224/4   127.0.0.1  URS00 32768 8 lo0
> > 127/8   127.0.0.1  UGRS   00 32768 8 lo0
> > 127.0.0.1   127.0.0.1  UHhl   1X 32768 1 lo0
> > 20.20.20/24 20.20.20.20UCn1  9XX - 

is there foomatic-rip for lpd on openBSD 6.3?

2018-04-09 Thread Heppler, J. Scott

It is in print/cups-filters

http://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/ports/print/cups-filters/pkg/README?rev=1.9&content-type=text/plain


--
J. Scott Heppler



Re: Unable to use vmm on Xiaomi Air laptop: failed to enter VMM mode

2018-04-09 Thread Mike Larkin
On Mon, Apr 09, 2018 at 01:47:36AM +0800, Justin Yang wrote:
> Hi,all:
> 
> I just bought the Xiaomi Mi Air 12.5 laptop and installed OpenBSD-current
> after reading this blog: https://jcs.org/2017/05/22/xiaomiair.
> 
> Almost all the functions work except the vmm part. I am not able to start a
> guest with the error in dmesg:
> 
> cpu3: failed to enter VMM mode
> cpu2: failed to enter VMM mode
> cpu1: failed to enter VMM mode
> 
> 
> I have searched on Google and tried my best to overcome this error, but
> still could not figure it out. Could you help me please? I attach my dmesg
> and {pf, sysctl, vm}.conf files in this email. Tell me if you need more
> information. Thanks.
> 
>  --
> Justin Yang

You also have "failed to identify" lines during boot.

Can you try bumping the "10" in cpu_start_secondary (just bump both
occurrances, it's in cpu.c) to someting like 1000, and also in vmm_start
(in vmm.c0 and see if that fixes things?

I am wondering if we aren't waiting long enough in this machine for these IPIs
to complete.

-ml

> OpenBSD 6.3-current (GENERIC.MP) #147: Fri Apr  6 23:18:13 MDT 2018
> dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
> real mem = 4156014592 (3963MB)
> avail mem = 4022935552 (3836MB)
> mpath0 at root
> scsibus0 at mpath0: 256 targets
> mainbus0 at root
> bios0 at mainbus0: SMBIOS rev. 3.0 @ 0x8a6f1000 (64 entries)
> bios0: vendor INSYDE Corp. version "XMAKB200P0200" date 11/02/2017
> bios0: Timi TM1607
> acpi0 at bios0: rev 2
> acpi0: sleep states S0 S3 S4 S5
> acpi0: tables DSDT FACP UEFI UEFI MSDM SSDT SSDT TPM2 SSDT SSDT ASF! ASPT 
> BOOT DBGP HPET APIC MCFG SSDT SSDT LPIT WSMT SSDT SSDT SSDT SSDT DBGP DBG2 
> SSDT SSDT DMAR FPDT BGRT
> acpi0: wakeup devices PWRB(S4) LID0(S3) GLAN(S4) XHC_(S3) XDCI(S4) HDAS(S4) 
> RP01(S4) RP02(S4) RP03(S4) RP04(S4) RP05(S4) RP06(S4) RP07(S4) RP08(S4) 
> RP10(S4) RP11(S4) [...]
> acpitimer0 at acpi0: 3579545 Hz, 24 bits
> acpihpet0 at acpi0: 2399 Hz
> acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
> cpu0 at mainbus0: apid 0 (boot processor)
> cpu0: Intel(R) Core(TM) m3-7Y30 CPU @ 1.00GHz, 1197.63 MHz
> cpu0: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
> cpu0: 256KB 64b/line 8-way L2 cache
> cpu0: smt 0, core 0, package 0
> mtrr: Pentium Pro MTRR support, 10 var ranges, 88 fixed ranges
> cpu0: apic clock running at 23MHz
> cpu0: mwait min=64, max=64, C-substates=0.2.1.2.4.1.1.1, IBE
> cpu1 at mainbus0: apid 2 (application processor)
> cpu1: Intel(R) Core(TM) m3-7Y30 CPU @ 1.00GHz, 960.01 MHz
> cpu1: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
> cpu1: 256KB 64b/line cpu1: failed to identify
> 8-way L2 cachecpu2 at mainbus0
> : apid 1 (application processor)
> cpu1: smt 0, core 1, package 0
> cpu2: Intel(R) Core(TM) m3-7Y30 CPU @ 1.00GHz, 897.91 MHz
> cpu2: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
> cpu2: 256KB 64b/line 8-way L2 cache
> cpu2: failed to identify
> cpu2: smt 1, core 0, package 0
> cpu3 at mainbus0: apid 3 (application processor)
> cpu3: Intel(R) Core(TM) m3-7Y30 CPU @ 1.00GHz, 897.91 MHz
> cpu3: 
> FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,SGX,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,MPX,RDSEED,ADX,SMAP,CLFLUSHOPT,PT,IBRS,IBPB,STIBP,SENSOR,ARAT,MELTDOWN
> cpu3: 256KB 64b/line 8-way L2 cache
> cpu3: failed to identify
> cpu3: smt 1, core 1, package 0
> ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 120 pins
> acpimcfg0 at acpi0 addr 0xe000, bus 0-255
> acpiprt0 at acpi0: bus 0 (PCI0)
> acpiprt1 at acpi0: bus -1 (RP01)
> acpiprt2 at acpi0: bus -1 (

Re: Compilations errors with plan9port on 2018/04/05 snapshot

2018-04-09 Thread Gleydson Soares
On Sun, Apr 08, 2018 at 07:26:50PM -0400, Patrick Marchand wrote:
> On 04/08, Gleydson Soares wrote:
> > Hi Patrick,
> > could you please test this diff?
> > https://marc.info/?l=openbsd-ports&m=152160090624047&w=2
> 
> The diff worked, I was able to run plumber, factotum and acme without
> any aborts. 
> 
> Thanks!

i've committed it.
thanks for testing,



Re: is there foomatic-rip for lpd on openBSD 6.3?

2018-04-09 Thread Gleydson Soares
On Mon, Apr 09, 2018 at 04:52:36PM +0200, Rudolf Sykora wrote:
> Hello,
> 
> I want to print from openBSD 6.3. I tried to use lpd and found
> some information on the web about setting up /etc/printcap.
> Many texts use the foomatic-rip program. I can't find one
> in ports. Is there anything instead? What's the recommended
> way to set up printing?

i've been using cups and works.

> 
> Thanks for any comments
> Ruda
> 



is there foomatic-rip for lpd on openBSD 6.3?

2018-04-09 Thread Rudolf Sykora
Hello,

I want to print from openBSD 6.3. I tried to use lpd and found
some information on the web about setting up /etc/printcap.
Many texts use the foomatic-rip program. I can't find one
in ports. Is there anything instead? What's the recommended
way to set up printing?

Thanks for any comments
Ruda



Re: OpenBSD-based ISP

2018-04-09 Thread Guillermo Narvaez
Hello everyone!

>From the last email of this thread (August 17 2017) I'm running 2 OpenBSD
servers with 4x1G interfaces each one, configured with 2 trunk of 2G,
routing and making NAT to more than 3000 customers each one.

Thank you for the help!

On Thu, Aug 17, 2017 at 4:45 PM, Hrvoje Popovski  wrote:

> On 17.8.2017. 21:23, Juan Guillermo Narvaez wrote:
> > This is the dmesg.boot.
>
> nice box with nice cpu and interfaces ... :)
>
> if you can, disable Hyper Threading ..
>
> > In pf.conf:
> > set debug notice
>
> default is error
>
> when you do all that what people have told you, i would be interested if
> you see some performance improvement?
>
>
>
> > On Thu, Aug 17, 2017 at 3:46 PM, Hrvoje Popovski  wrote:
> >
> >> On 17.8.2017. 17:13, Chris Cappuccio wrote:
> >>> Juan Guillermo Narvaez [guille...@nrvz.net] wrote:
>  # sysctl | grep ifq
>  net.inet.ip.ifq.len=0
>  net.inet.ip.ifq.maxlen=1024
>  net.inet.ip.ifq.drops=46068291
>  net.inet6.ip6.ifq.len=0
>  net.inet6.ip6.ifq.maxlen=256
>  net.inet6.ip6.ifq.drops=0
> 
> >>>
> >>> The drops are high. You probably want a higher maxlen. I use 8192 on
> busy
> >>> forwarding boxes.
> >>>
>  # cat sysctl.conf
>  net.inet.ip.forwarding=1
>  kern.bufcachepercent=90
>  net.ip.ifq.maxlen=1024
> 
> >>>
> >>> You want net.inet.ip.ifq.maxlen=8192 not 'net.ip.ifq.maxlen=1024'
> >>>
> >>
> >> besides what chris told you maybe you could silence pf logging... your
> >> dmesg is full of pf logs, maybe you have pf debuging enabled?
> >>
> >> please send cat /var/run/dmesg.boot inline just to see which version of
> >> openbsd your running and on which hardware ...
> >>
> >> and set your pf states to some big number.. set limit states 10 or
> >> something like that ..
> >>
> >> and of course run at least openbsd 6.1 or if you brave enough run
> >> -current 
> >>
> >> just side note, openbsd on E5-2643 v2 @ 3.50GHz from around February
> >> 2017 had plain forwarding performance of 1.4Mpps and openbsd from today
> >> on same box can forward cca 1.7Mpps ...
> >>
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>


-- 
J. Guillermo Narvaez
Public Key: http://www.nrvz.net/pk/jgnrvz.asc


Re: 4-ports router under $150

2018-04-09 Thread Родин Максим

https://ru.aliexpress.com/item/QOTOM-310G4-3215U-Barebone-mini-pc-Dual-core-4-nics-Mini-pc-Ubuntu-Industrial-desktop-Computer/32769767156.html

This is what I bought for similar purposes.

It has 4 Intel Gigabit ports and their efficiency is 99%.


08.04.2018 00:59, Anatoli пишет:

Hi All!

I'm looking for a modest 4-5 ports router under $150 that works well 
with OpenBSD. I don't need WiFi, USB or console port, and the 
throughput don't need to exceed 100Mbps. The ideal device would be 
EdgeRouter X (compact, 5 ports, $50) but I know it's not supported at 
this moment and probably never will be.


EdgeRouter (ER) Lite only has 3 ports and the switch ports (eth2-4) of 
ERPOE-5 are not yet supported.


ER-4 would be great, but the 4th port is SFP, I'd need to by an SFP 
NIC for one of my devices and I'm not sure it's supported as the 
octeon page says ER PRO SFP ports are not supported yet. Also it's a 
bit expensive ($190).


Banana Pi R2 would be great too, but I couldn't find if it's supported 
by OpenBSD (it has MediaTek MT7623N, Quad-core ARM Cortex-A7).


Are there 4-5 port devices that are known to work well with OpenBSD?

Thanks,
Anatoli



--
С уважением,
Родин Максим



OpenBSD 6.3: Emulex 10G doesn't bring up

2018-04-09 Thread Guillermo Narvaez
Hello,

I'm installing 6.3 in Lenovo ThinkSystem SR530 with 2x10G ports (via PCI
card).
When I run 'ifconfig' the list doesn't show 'oce' ifaces only lo0, enc0 and
pflog0; neither the 1G onboard (Intel) ifaces.

This is the output of 'pcidump -v'

---
91:0:0: Emulex unknown
0x: Vendor ID: 10df Product ID: 0720
0x0004: Command: 0146 Status: 0010
0x0008: Class: 02 Subclass: 00 Interface: 00 Revision: 11
0x000c: BIST: 00 Header Type: 80 Latency Timer: 00 Cache Line Size: 10
0x0010: BAR mem prefetchable 64bit addr: 0x03a84000/0x4000
0x0018: BAR mem prefetchable 64bit addr: 0x03a6/0x0002
0x0020: BAR mem prefetchable 64bit addr: 0x03a4/0x0002
0x0028: Cardbus CIS: 
0x002c: Subsystem Vendor ID: 10df Product ID: e81c
0x0030: Expansion ROM Base Address: ede8
0x0038: 
0x003c: Interrupt Pin: 01 Line: 0b Min Gnt: 00 Max Lat: 00
0x0040: Capability 0x01: Power Management
State: D0
0x0048: Capability 0x11: Extended Message Signalled Interrupts (MSI-X)
0x00c0: Capability 0x10: PCI Express
Link Speed: 5.0 / 8.0 GT/s Link Width: x8 / x8
0x0100: Enhanced Capability 0x01: Advanced Error Reporting
0x0180: Enhanced Capability 0x10: Single Root I/O Virtualization
0x0160: Enhanced Capability 0x0e: Alternate Routing ID
0x0168: Enhanced Capability 0x03: Device Serial Number
0x0210: Enhanced Capability 0x19: Secondary PCIe Capability
0x00b8: Capability 0x03: Vital Product Data (VPD)
 91:0:1: Emulex unknown
0x: Vendor ID: 10df Product ID: 0720
0x0004: Command: 0146 Status: 0010
0x0008: Class: 02 Subclass: 00 Interface: 00 Revision: 11
0x000c: BIST: 00 Header Type: 80 Latency Timer: 00 Cache Line Size: 10
0x0010: BAR mem prefetchable 64bit addr: 0x03a8/0x4000
0x0018: BAR mem prefetchable 64bit addr: 0x03a2/0x0002
0x0020: BAR mem prefetchable 64bit addr: 0x03a0/0x0002
0x0028: Cardbus CIS: 
0x002c: Subsystem Vendor ID: 10df Product ID: e81c
0x0030: Expansion ROM Base Address: ede0
0x0038: 
0x003c: Interrupt Pin: 02 Line: 0a Min Gnt: 00 Max Lat: 00
0x0040: Capability 0x01: Power Management
State: D0
0x0048: Capability 0x11: Extended Message Signalled Interrupts (MSI-X)
0x00c0: Capability 0x10: PCI Express
Link Speed: 5.0 / 8.0 GT/s Link Width: x8 / x8
0x0100: Enhanced Capability 0x01: Advanced Error Reporting
0x0180: Enhanced Capability 0x10: Single Root I/O Virtualization
0x0160: Enhanced Capability 0x0e: Alternate Routing ID
0x0168: Enhanced Capability 0x03: Device Serial Number
0x00b8: Capability 0x03: Vital Product Data (VPD)
--

Is this useful to troubleshoot?


-- 
J. Guillermo Narvaez
Public Key: http://www.nrvz.net/pk/jgnrvz.asc


Re: 4-ports router under $150

2018-04-09 Thread Родин Максим
https://ru.aliexpress.com/item/QOTOM-310G4-3215U-Barebone-mini-pc-Dual-core-4-nics-Mini-pc-Ubuntu-Industrial-desktop-Computer/32769767156.html 



This is what I bought for similar purposes.

It has 4 Intel Gigabit ports and their efficiency is 99%.


08.04.2018 00:59, Anatoli пишет:

Hi All!

I'm looking for a modest 4-5 ports router under $150 that works well 
with OpenBSD. I don't need WiFi, USB or console port, and the 
throughput don't need to exceed 100Mbps. The ideal device would be 
EdgeRouter X (compact, 5 ports, $50) but I know it's not supported at 
this moment and probably never will be.


EdgeRouter (ER) Lite only has 3 ports and the switch ports (eth2-4) of 
ERPOE-5 are not yet supported.


ER-4 would be great, but the 4th port is SFP, I'd need to by an SFP 
NIC for one of my devices and I'm not sure it's supported as the 
octeon page says ER PRO SFP ports are not supported yet. Also it's a 
bit expensive ($190).


Banana Pi R2 would be great too, but I couldn't find if it's supported 
by OpenBSD (it has MediaTek MT7623N, Quad-core ARM Cortex-A7).


Are there 4-5 port devices that are known to work well with OpenBSD?

Thanks,
Anatoli



--
С уважением,
Родин Максим



sigaltstack SIGSTKSZ with mmap/MAP_STACK

2018-04-09 Thread Ingo Feinerer
Hi,

is there an implicit maximum size (besides the size_t data type of
course) of the ss_size field in the sigaltstack struct when using
sigaltstack()? E.g., following example based on `man 2 sigaltstack`

---8<--
#include 

#include 
#include 

#define R_USAGE 1

static struct sigaltstack sigstk;

int main(int argc, char *argv[])
{
if ((sigstk.ss_sp = mmap(NULL, SIGSTKSIZE + R_USAGE, PROT_WRITE | 
PROT_READ,
MAP_PRIVATE | MAP_ANON | MAP_STACK, -1, 0)) == MAP_FAILED) {
perror("mmap");
}
sigstk.ss_size = SIGSTKSIZE + R_USAGE;
sigstk.ss_flags = 0;
if (sigaltstack(&sigstk, 0) == -1)
perror("sigaltstack");
return 0;
}
---8<--

works for R_USAGE == 0 but seems to fail for > 0 values (with "sigaltstack:
Invalid argument").

It is a pattern observed in math/R
(https://github.com/wch/r-source/blob/trunk/src/main/main.c#L641-L654) which
worked with malloc() but stopped working when switching to mmap() with
MAP_STACK.

Ideas? Comments?

Thank you.

Best regards,
Ingo



Re: 4-ports router under $150

2018-04-09 Thread Karel Gardas
On Sun, 8 Apr 2018 08:52:52 -0700
Jordan Geoghegan  wrote:

> The pc engines stuff will still have blobs in it. There's no way to have 
> fully open firmware on a modern i-series chip based rig. At the end of 
> the day, we all are still using proprietary hardware.

APU2/3/4 is not i-series rig. It's using AMD GX412TC SoC based on
Jaguar cores. AFAIK this is one of last AMD chips running freely and
not requiring any blob. *If* you do have your own experience with this
hardware, then please share your details about what blobs exactly APU2
needs to run to perform routing business.

Thanks!
Karel



Re: 4-ports router under $150

2018-04-09 Thread Mike Hammett
You have very much done something wrong if your 2011 can't handle 2 megabit. I 
suggest you seek out a more Mikrotik-specific group for assistance. 




- 
Mike Hammett 
Intelligent Computing Solutions 

Midwest Internet Exchange 

The Brothers WISP 

- Original Message -

From: "Karel Gardas"  
To: "Patrick Dohman"  
Cc: misc@openbsd.org 
Sent: Monday, April 9, 2018 7:42:18 AM 
Subject: Re: 4-ports router under $150 

On Sun, 8 Apr 2018 09:39:46 -0500 
Patrick Dohman  wrote: 

> As much as I’d rather not point the blame I found the APU platform buggy when 
> running OpenBSD. 
> Yes there are reports of stability with other O.S however subtle 
> hardware/firmware bugs appeared on several OpenBSD releases. 
> I’m actually in the other boat when it comes to hardware stability being an 
> excuse however openbsd'd excellent embedded footprint does well at disclosing 
> subtle hardware issues. 
> I’m currently running a MikroTik 2011UiAS that is built on A mips processor. 
> Quite honestly I’ve found the secret of stability on the network hardware 
> arena to be distinct/discrete hardware. 

I'm currently routing with MikroTik 2011L and I'm not satisfied at all. I do 
have just 2 Mbit ADSL and when I tried to limit bandwith of teenagers to 
512kbps I've basically put 
the board down to knees. E.g. it was running, but ping (from me!) went up to 
several seconds and whole internet was more dead then with teenagers 
downloading their stuff. 
This all with up-to-date RouterOS 6.40.6 from Feb 20 2018 to patch latest 
vulnerabilities in it. 

So as you have migrated from APU to MikroTik, I plan to do exactly reverse 
direction as soon as possible with OBSD on top of APU of course... 




Re: 4-ports router under $150

2018-04-09 Thread Karel Gardas
On Sun, 8 Apr 2018 09:39:46 -0500
Patrick Dohman  wrote:

> As much as I’d rather not point the blame I found the APU platform buggy when 
> running OpenBSD.
> Yes there are reports of stability with other O.S however subtle 
> hardware/firmware bugs appeared on several OpenBSD releases.
> I’m actually in the other boat when it comes to hardware stability being an 
> excuse however openbsd'd excellent embedded footprint does well at disclosing 
> subtle hardware issues.
> I’m currently running a MikroTik 2011UiAS that is built on A mips processor. 
> Quite honestly I’ve found the secret of stability on the network hardware 
> arena to be distinct/discrete hardware.

I'm currently routing with MikroTik 2011L and I'm not satisfied at all. I do 
have just 2 Mbit ADSL and when I tried to limit bandwith of teenagers to 
512kbps I've basically put
the board down to knees. E.g. it was running, but ping (from me!) went up to 
several seconds and whole internet was more dead then with teenagers 
downloading their stuff.
This all with up-to-date RouterOS 6.40.6 from Feb 20 2018 to patch latest 
vulnerabilities in it.

So as you have migrated from APU to MikroTik, I plan to do exactly reverse 
direction as soon as possible with OBSD on top of APU of course...



Re: using installboot to create a custom OpenBSD install on sd1

2018-04-09 Thread Torsten
I spent another three hours on this and now I've come to a point where
at least my kernel boots.



> Hi!
> 
> In short:
> I am trying to use installboot to make a new harddrive bootable that
> should contain a custom OpenBSD installation, however, when trying to
> boot from that new hd I always get "No O/S".
> 
> 
> Detailed:
> I successfully set up a standard OpenBSD6.3 (machine A) on sd0 using
> install.iso. Using custom scripts, I would like to create custom
> installations on sd1 to create individual installations (machine B, C
> and so on), each on a separate HD that I would swap for sd1 each time.
> 
> On (A) I did:
> 
> fdisk -iy sd1
> echo "a a\n\n2g\n\na b\n\n\n\n\nw\nq\n"|disklabel -E sd1
> newfs /dev/rsd1a
> 
> mount /dev/sd1a /mnt
> 
> cp -R /altroot  /mnt/altroot
> cp -R /bin  /mnt/bin
> cp -R /dev  /mnt/dev
> cp -R /etc  /mnt/etc
> cp -R /home /mnt/home
> cp -R /root /mnt/root
> cp -R /sbin /mnt/sbin
> cp -R /tmp  /mnt/tmp
> cp -R /usr  /mnt/usr
> cp -R /var  /mnt/var
> cp /bsd* /mnt/
> 
> cd /mnt/dev
> ./MAKEDEV std
> 
> installboot -v sd1 /usr/mdec/biosboot /usr/mdec/boot
> 
> (also tried
> installboot -v -r /mnt/ sd1 /usr/mdec/biosboot /usr/mdec/boot
> without success)
> 
> 
> Hints and help will be appreciated!
> 
> Regards,
> T.
> 



Re: Date of yesterday

2018-04-09 Thread Stephane HUC "CIOTBSD"
as: date -r $(( $(date +%s) - 86400)) +%F
;)

Le 04/09/18 à 10:26, Paul de Weerd a écrit :
> On Sun, Apr 08, 2018 at 11:12:43PM -0700, Philip Guenther wrote:
> | On Sun, Apr 8, 2018 at 10:54 PM, Robert Klein  wrote:
> | 
> | > this works for me:
> | >
> | > date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d
> | >
> | 
> | Did you test that after 11pm on the day when daylight-saving time ends and
> | the clock is turned back, resulting in a 25 hour long day?
> 
> For those special occassions there's:
> 
> date -j `date +%Y%m%d1200` +%s
> 
> Turning this into:
> 
> date -r $(($(date -j `date +%Y%m%d1200` +%s) - 86400)) +%Y_%m_%d
> 
> Less perl (and less typing) at the expense of a total of 3 invocations
> of date.  Although I loathe the natural language parsing options built
> into Linux date(1), this sort of thing is rather convenient.
> 
> | I would use this:
> |perl -MPOSIX=strftime,mktime -le '@d=localtime(); $d[3]--; mktime(@d);
> | print strftime("%Y_%m_%d",@d)'
> | 
> | Philip Guenther
> 
> Paul 'abolish DST now' de Weerd
> 

-- 
~ " Fully Basic System Distinguish Life! " ~ " Libre as a BSD " +=<<<

Stephane HUC as PengouinBSD or CIOTBSD
b...@stephane-huc.net



Re: Date of yesterday

2018-04-09 Thread Christophe Simon

Oh, sorry,

Thank your for having corrected me !

Regards.

Christophe

Le 04/09/18 à 12:56, Otto Moerbeek a écrit :

On Mon, Apr 09, 2018 at 12:50:33PM +0200, Christophe Simon wrote:


The command I executed was run on OpenBSD:

$ uname -a
OpenBSD XXX 6.3 GENERIC.MP#107 amd64

$ /bin/date -d 'now -1 day' '+%Y_%m_%d'
2018_04_09

$ /bin/date -d 'yesterday' '+%Y_%m_%d'
2018_04_09

I don't know when it was imported into BSD's date, but this extension is
available on OpenBSD, at least in 6.3...


There is a -d option, but it does not do what you expect. What
date is it now? Try other values than -1

-Otto



Regards.

Christophe

Le 04/09/18 à 10:54, Otto Moerbeek a écrit :

On Mon, Apr 09, 2018 at 10:38:11AM +0200, Christophe Simon wrote:


Hi,

You can use this form, which is a little simpler:

  date -d 'now -1 day' '+%Y_%m_%d'


Nope, this is a GNU extension.

-Otto



Regards

Christophe

Le 04/09/18 à 07:54, Robert Klein a écrit :

Hi Max,

this works for me:

date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d


Best regards
Robert

On Mon, 09 Apr 2018 07:45:05 +0200
Max Power  wrote:


Hi guys,
How can I do to get yesterday's date?
I need for create a backup directory.
On Linux:
yesterday=backup_$(date -d "yesterday" '+%Y_%m_%d')
mkdir -p /raid1/backup/$yesterday

Thanks for reply.












Re: Date of yesterday

2018-04-09 Thread Otto Moerbeek
On Mon, Apr 09, 2018 at 12:50:33PM +0200, Christophe Simon wrote:

> The command I executed was run on OpenBSD:
> 
> $ uname -a
> OpenBSD XXX 6.3 GENERIC.MP#107 amd64
> 
> $ /bin/date -d 'now -1 day' '+%Y_%m_%d'
> 2018_04_09
> 
> $ /bin/date -d 'yesterday' '+%Y_%m_%d'
> 2018_04_09
> 
> I don't know when it was imported into BSD's date, but this extension is
> available on OpenBSD, at least in 6.3...

There is a -d option, but it does not do what you expect. What
date is it now? Try other values than -1 

-Otto

> 
> Regards.
> 
> Christophe
> 
> Le 04/09/18 à 10:54, Otto Moerbeek a écrit :
> > On Mon, Apr 09, 2018 at 10:38:11AM +0200, Christophe Simon wrote:
> > 
> > > Hi,
> > > 
> > > You can use this form, which is a little simpler:
> > > 
> > >  date -d 'now -1 day' '+%Y_%m_%d'
> > 
> > Nope, this is a GNU extension.
> > 
> > -Otto
> > 
> > > 
> > > Regards
> > > 
> > > Christophe
> > > 
> > > Le 04/09/18 à 07:54, Robert Klein a écrit :
> > > > Hi Max,
> > > > 
> > > > this works for me:
> > > > 
> > > > date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d
> > > > 
> > > > 
> > > > Best regards
> > > > Robert
> > > > 
> > > > On Mon, 09 Apr 2018 07:45:05 +0200
> > > > Max Power  wrote:
> > > > 
> > > > > Hi guys,
> > > > > How can I do to get yesterday's date?
> > > > > I need for create a backup directory.
> > > > > On Linux:
> > > > > yesterday=backup_$(date -d "yesterday" '+%Y_%m_%d')
> > > > > mkdir -p /raid1/backup/$yesterday
> > > > > 
> > > > > Thanks for reply.
> > > > > 
> > > > 
> > > > 
> > 



Re: Date of yesterday

2018-04-09 Thread Christophe Simon

The command I executed was run on OpenBSD:

$ uname -a
OpenBSD XXX 6.3 GENERIC.MP#107 amd64

$ /bin/date -d 'now -1 day' '+%Y_%m_%d'
2018_04_09

$ /bin/date -d 'yesterday' '+%Y_%m_%d'
2018_04_09

I don't know when it was imported into BSD's date, but this extension is 
available on OpenBSD, at least in 6.3...


Regards.

Christophe

Le 04/09/18 à 10:54, Otto Moerbeek a écrit :

On Mon, Apr 09, 2018 at 10:38:11AM +0200, Christophe Simon wrote:


Hi,

You can use this form, which is a little simpler:

 date -d 'now -1 day' '+%Y_%m_%d'


Nope, this is a GNU extension.

-Otto



Regards

Christophe

Le 04/09/18 à 07:54, Robert Klein a écrit :

Hi Max,

this works for me:

date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d


Best regards
Robert

On Mon, 09 Apr 2018 07:45:05 +0200
Max Power  wrote:


Hi guys,
How can I do to get yesterday's date?
I need for create a backup directory.
On Linux:
yesterday=backup_$(date -d "yesterday" '+%Y_%m_%d')
mkdir -p /raid1/backup/$yesterday

Thanks for reply.










Re: 4-ports router under $150

2018-04-09 Thread Максим
It has a compatible Intel Ethernet adapter (82583V)
https://man.openbsd.org/man4/em.4
I don't know what else can be a problem.

-- 
С уважением,
Родин Максим


09.04.2018, 11:29, "Anatoli" :
> Thanks, Maxim.
>
> Have you tried it with OpenBSD? Or should all these j1900 devices work well?
>
> *From:* Максим
> *Sent:* Monday, April 09, 2018 02:30
> *To:* Anatoli, Misc
> *Subject:* Re: 4-ports router under $150
>
> Hi Anatoli,
> Another good device for $165 in basic setup:
> https://ru.aliexpress.com/item/Mini-Industrial-PC-Max-8G-DDR3-Dual-Core-Mini-Desktop-Computer-x86-4-Lan-port-12v/32692470253.html?spm=a2g0v.search0104.3.23.1e1e2025iFZAQt&ws_ab_test=searchweb0_0,searchweb201602_2_10152_10151_10065_10344_10068_10342_5722912_10343_10340_5722612_10341_10698_10697_10696_5722812_10084_10083_10618_5722712_10307_10301_10059_10534_308_100031_10103_441_10624_10623_10622_10621_5723012_10620_5722512,searchweb201603_25,ppcSwitch_3&algo_expid=55575e8e-990d-4e17-80a8-5eec917361f0-3&algo_pvid=55575e8e-990d-4e17-80a8-5eec917361f0&transAbTest=ae803_1&priceBeautifyAB=0
>
> --
> С уважением,
> Родин Максим
>
> 08.04.2018, 02:45, "Anatoli" :
>
>>  Hi All!
>>
>>  I'm looking for a modest 4-5 ports router under $150 that works well
>>  with OpenBSD. I don't need WiFi, USB or console port, and the throughput
>>  don't need to exceed 100Mbps. The ideal device would be EdgeRouter X
>>  (compact, 5 ports, $50) but I know it's not supported at this moment and
>>  probably never will be.
>>
>>  EdgeRouter (ER) Lite only has 3 ports and the switch ports (eth2-4) of
>>  ERPOE-5 are not yet supported.
>>
>>  ER-4 would be great, but the 4th port is SFP, I'd need to by an SFP NIC
>>  for one of my devices and I'm not sure it's supported as the octeon page
>>  says ER PRO SFP ports are not supported yet. Also it's a bit expensive
>>  ($190).
>>
>>  Banana Pi R2 would be great too, but I couldn't find if it's supported
>>  by OpenBSD (it has MediaTek MT7623N, Quad-core ARM Cortex-A7).
>>
>>  Are there 4-5 port devices that are known to work well with OpenBSD?
>>
>>  Thanks,
>>  Anatoli



Re: Date of yesterday

2018-04-09 Thread Otto Moerbeek
On Mon, Apr 09, 2018 at 10:38:11AM +0200, Christophe Simon wrote:

> Hi,
> 
> You can use this form, which is a little simpler:
> 
> date -d 'now -1 day' '+%Y_%m_%d'

Nope, this is a GNU extension.

-Otto

> 
> Regards
> 
> Christophe
> 
> Le 04/09/18 à 07:54, Robert Klein a écrit :
> > Hi Max,
> > 
> > this works for me:
> > 
> > date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d
> > 
> > 
> > Best regards
> > Robert
> > 
> > On Mon, 09 Apr 2018 07:45:05 +0200
> > Max Power  wrote:
> > 
> > > Hi guys,
> > > How can I do to get yesterday's date?
> > > I need for create a backup directory.
> > > On Linux:
> > > yesterday=backup_$(date -d "yesterday" '+%Y_%m_%d')
> > > mkdir -p /raid1/backup/$yesterday
> > > 
> > > Thanks for reply.
> > > 
> > 
> > 



Re: Date of yesterday

2018-04-09 Thread Christophe Simon

Hi,

You can use this form, which is a little simpler:

date -d 'now -1 day' '+%Y_%m_%d'

Regards

Christophe

Le 04/09/18 à 07:54, Robert Klein a écrit :

Hi Max,

this works for me:

date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d


Best regards
Robert

On Mon, 09 Apr 2018 07:45:05 +0200
Max Power  wrote:


Hi guys,
How can I do to get yesterday's date?
I need for create a backup directory.
On Linux:
yesterday=backup_$(date -d "yesterday" '+%Y_%m_%d')
mkdir -p /raid1/backup/$yesterday

Thanks for reply.








Re: Date of yesterday

2018-04-09 Thread Paul de Weerd
On Sun, Apr 08, 2018 at 11:12:43PM -0700, Philip Guenther wrote:
| On Sun, Apr 8, 2018 at 10:54 PM, Robert Klein  wrote:
| 
| > this works for me:
| >
| > date -r $(( $(date +%s) - 1 * 24 * 60 * 60 )) +%Y_%m_%d
| >
| 
| Did you test that after 11pm on the day when daylight-saving time ends and
| the clock is turned back, resulting in a 25 hour long day?

For those special occassions there's:

date -j `date +%Y%m%d1200` +%s

Turning this into:

date -r $(($(date -j `date +%Y%m%d1200` +%s) - 86400)) +%Y_%m_%d

Less perl (and less typing) at the expense of a total of 3 invocations
of date.  Although I loathe the natural language parsing options built
into Linux date(1), this sort of thing is rather convenient.

| I would use this:
|perl -MPOSIX=strftime,mktime -le '@d=localtime(); $d[3]--; mktime(@d);
| print strftime("%Y_%m_%d",@d)'
| 
| Philip Guenther

Paul 'abolish DST now' de Weerd

-- 
>[<++>-]<+++.>+++[<-->-]<.>+++[<+
+++>-]<.>++[<>-]<+.--.[-]
 http://www.weirdnet.nl/ 



Re: 4-ports router under $150

2018-04-09 Thread Anatoli

Thanks, Maxim.

Have you tried it with OpenBSD? Or should all these j1900 devices work well?

*From:* Максим
*Sent:* Monday, April 09, 2018 02:30
*To:* Anatoli, Misc
*Subject:* Re: 4-ports router under $150

Hi Anatoli,
Another good device for $165 in basic setup:
https://ru.aliexpress.com/item/Mini-Industrial-PC-Max-8G-DDR3-Dual-Core-Mini-Desktop-Computer-x86-4-Lan-port-12v/32692470253.html?spm=a2g0v.search0104.3.23.1e1e2025iFZAQt&ws_ab_test=searchweb0_0,searchweb201602_2_10152_10151_10065_10344_10068_10342_5722912_10343_10340_5722612_10341_10698_10697_10696_5722812_10084_10083_10618_5722712_10307_10301_10059_10534_308_100031_10103_441_10624_10623_10622_10621_5723012_10620_5722512,searchweb201603_25,ppcSwitch_3&algo_expid=55575e8e-990d-4e17-80a8-5eec917361f0-3&algo_pvid=55575e8e-990d-4e17-80a8-5eec917361f0&transAbTest=ae803_1&priceBeautifyAB=0

--
С уважением,
Родин Максим


08.04.2018, 02:45, "Anatoli" :


Hi All!

I'm looking for a modest 4-5 ports router under $150 that works well
with OpenBSD. I don't need WiFi, USB or console port, and the throughput
don't need to exceed 100Mbps. The ideal device would be EdgeRouter X
(compact, 5 ports, $50) but I know it's not supported at this moment and
probably never will be.

EdgeRouter (ER) Lite only has 3 ports and the switch ports (eth2-4) of
ERPOE-5 are not yet supported.

ER-4 would be great, but the 4th port is SFP, I'd need to by an SFP NIC
for one of my devices and I'm not sure it's supported as the octeon page
says ER PRO SFP ports are not supported yet. Also it's a bit expensive
($190).

Banana Pi R2 would be great too, but I couldn't find if it's supported
by OpenBSD (it has MediaTek MT7623N, Quad-core ARM Cortex-A7).

Are there 4-5 port devices that are known to work well with OpenBSD?

Thanks,
Anatoli







using installboot to create a custom OpenBSD install on sd1

2018-04-09 Thread Torsten
Hi!

In short:
I am trying to use installboot to make a new harddrive bootable that
should contain a custom OpenBSD installation, however, when trying to
boot from that new hd I always get "No O/S".


Detailed:
I successfully set up a standard OpenBSD6.3 (machine A) on sd0 using
install.iso. Using custom scripts, I would like to create custom
installations on sd1 to create individual installations (machine B, C
and so on), each on a separate HD that I would swap for sd1 each time.

On (A) I did:

fdisk -iy sd1
echo "a a\n\n2g\n\na b\n\n\n\n\nw\nq\n"|disklabel -E sd1
newfs /dev/rsd1a

mount /dev/sd1a /mnt

cp -R /altroot  /mnt/altroot
cp -R /bin  /mnt/bin
cp -R /dev  /mnt/dev
cp -R /etc  /mnt/etc
cp -R /home /mnt/home
cp -R /root /mnt/root
cp -R /sbin /mnt/sbin
cp -R /tmp  /mnt/tmp
cp -R /usr  /mnt/usr
cp -R /var  /mnt/var
cp /bsd* /mnt/

cd /mnt/dev
./MAKEDEV std

installboot -v sd1 /usr/mdec/biosboot /usr/mdec/boot

(also tried
installboot -v -r /mnt/ sd1 /usr/mdec/biosboot /usr/mdec/boot
without success)


Hints and help will be appreciated!

Regards,
T.