Re: PF: can't make queueing and priority work as expected

2016-01-13 Thread Marko Cupać
On Tue, 12 Jan 2016 16:40:58 +0100
Claudio Jeker  wrote:

> On Tue, Jan 12, 2016 at 05:33:06AM -0700, Daniel Melameth wrote:
> > On Mon, Jan 11, 2016 at 9:37 PM, David Gwynne 
> > wrote:
> > >> On 11 Jan 2016, at 22:43, Daniel Melameth 
> > >> wrote: On Sun, Jan 10, 2016 at 7:58 AM, Marko Cupa??
> > >> 
> > wrote:
> > >>> On Sat, 9 Jan 2016 11:11:27 -0700
> > >>> Daniel Melameth  wrote:
> >  You NEED to set a max on your ROOT queues.
> > >>> I came to this conclusion as well. But not only on root queues.
> > >>> For example, when max is set on root queue but only bandwidth
> > >>> on child queues, no shaping takes place...
> > >> This works for me.
> > >>> Or, to cut the long story short, if someone can paste queue
> > >>> definition which accomplishes 'give both queues max bandwidth,
> > >>> but throttle traffic from first queue when traffic from the
> > >>> second one arrives', I will be more than happy to quit
> > >>> bothering misc@ list readers with my rants and observations.
> > >> I would expect this to be possible with prio alone, but I've
> > >> never been able to get it to work.  Perhaps I'm misunderstanding
> > >> how prio works.
> > > prio is basically an array of lists of packets to be transmitted.
> > > high
> > priority packets go on a different list to low priority packets.
> > >
> > > the problem is the way packets go on and off these lists.
> > > basically as soon
> > as a packet is queued on one of these lists for transmission, we
> > call the driver immediately to send it. generally as soon as a
> > packet is queued on the interface, it immediately gets dequeued by
> > the driver and transmitted on the hardware.
> > >
> > > it is only when you build up a backlog of packets that priq can
> > > come into
> > effect. the only way you can build up a backlog of packets is if
> > your hardware is slower at transmitting packets than the thing that
> > generates these packets to send.
> > >
> > > in your case you're probably getting packets from a relatively
> > > slow internet
> > connection and transmitting them on a high speed local network. the
> > transmit hardware is almost certainly going to be faster than your
> > source of packets, so you'll never build up a queue of backlogged
> > packets, so prio is effectively a nop.
> > >
> > > dlg
> >
> > Thanks for taking the time to chime in guys.  Prior to implementing
> > any queueing, I tested this stuff out on a LAN--so no slower
> > connectionswere involved--and I was unable to see prio in action, at
> > least not with any observable similarity to ALTQ's PRIQ.
> >
> > A simple rule set:
> >
> > match out on egress proto tcp to port 12345 set prio 7
> > match out on egress proto tcp to port 12346 set prio 0
> > pass
> >
> > Using tcpbench to push packets into both queues, I would have
> > expected the packets destined for port 12346 to get throttled, but
> > both flows simply reached an equilibrium, which I would have
> > expected without prio.  Under PRIQ, I would have seen the flow to
> > port 12346 get almost completely starved of bandwidth.  When doing
> > non-prio queuing with a similarly simple ruleset, both flows
> > properly matched their target bandwidth.
>
> This assumes that you manage to fill the TX interface queue to a level
> that it always fills the tx DMA rings before being empty. On high
> speed interfaces this most of the time not the case and so both
> sessions are able to reach the maximum bandwidth.
> To be honest prio queue only make sense when you have a slow interface
> (10Mbps) or a shaper in place that causes the queue to fill up.
> There is currently no shaper you can use together with the prio
> queues so only option one remains.
>

Have we come to conclusion that currently prio makes no sense at all?

Can I hope that saying 'currently' means this is not the intended
design? Or should I come to peace with the fact that with OpenBSD and
PF I can forget about shaping inbound TCP traffic in a way that
child queues can expand to max link bandwidth unless there is a
congestion, while in congestion admin can choose which child queues to
throttle and in which order?

--
Before enlightenment - chop wood, draw water.
After  enlightenment - chop wood, draw water.

Marko Cupać
https://www.mimar.rs/



Re: iwm0: could not initiate 2 GHz scan

2016-01-13 Thread Stefan Sperling
On Tue, Jan 12, 2016 at 07:11:55PM -0700, Chris Wojo wrote:
> So it appears that iwm0 does work on snapshot #1800 on my home wireless AP. 
> The errors previously reported still occur on the office network where 
> several AP's are using the same NWID. 
> I would be more than happy to troubleshoot this so others won't run into the 
> same problem.
> Thank you.

So it's clear we still have an issue here. This could be a problem
with frame protection settings, which if wrongly configured would
cause Tx failures and frames damaged while in flight. Protection
settings for the network are advertised by the AP and we must apply
them correctly or many things won't work.
(cf. 
http://www.testequipmentdepot.com/flukenetworks/pdf/802.11n-compatibility.pdf)

One issue I'm already aware of is that we currently don't update
protection settings in case the AP decides to change them while
we're associated. But your problem indicates that perhaps we're
not configuring frame protection correctly in the first place.

Can you please send one line showing a beacon for your AP at home,
and a few lines showing beacons from the various APs at your office?

You can print beacons as a line of text like this:

  tcpdump -n -i iwm0 -s 1500 -vvv -y IEEE802_11_RADIO subtype beacon
 
Note that if you run this command while associated to an AP (i.e. while
ifconfig iwm0 shows status: active) it will only show beacons for that AP.

Could you also compile and run a kernel with the follwing diff applied,
and show me what this prints while you're tyring to associate and DHCP
to the APs?

Thanks.

Index: if_iwm.c
===
RCS file: /cvs/src/sys/dev/pci/if_iwm.c,v
retrieving revision 1.75
diff -u -p -r1.75 if_iwm.c
--- if_iwm.c7 Jan 2016 23:08:38 -   1.75
+++ if_iwm.c13 Jan 2016 08:55:33 -
@@ -145,6 +145,7 @@
 #define le16_to_cpup(_a_) (le16toh(*(const uint16_t *)(_a_)))
 #define le32_to_cpup(_a_) (le32toh(*(const uint32_t *)(_a_)))
 
+#define IWM_DEBUG
 #ifdef IWM_DEBUG
 #define DPRINTF(x) do { if (iwm_debug > 0) printf x; } while (0)
 #define DPRINTFN(n, x) do { if (iwm_debug >= (n)) printf x; } while (0)
@@ -4948,6 +4949,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_s
if (ni->ni_flags & IEEE80211_NODE_HT) {
enum ieee80211_htprot htprot =
(ni->ni_htop1 & IEEE80211_HTOP1_PROT_MASK);
+   DPRINTF(("%s: htprot = %d\n", __func__, htprot));
switch (htprot) {
case IEEE80211_HTPROT_NONE:
break;



Re: anyone using msk(4) NICs?

2016-01-13 Thread Jan Stary
I have a "Marvell Yukon 88E8053" rev 0x22
which works without problems, on a MacBook:
http://stare.cz/dmesg/macbook2,1.20151109

Jan



Re: PF: can't make queueing and priority work as expected

2016-01-13 Thread Marko Cupać
On Wed, 13 Jan 2016 10:19:22 +0100
Marko Cupać  wrote:


> Can I hope that saying 'currently' means this is not the intended
> design? Or should I come to peace with the fact that with OpenBSD and
> PF I can forget about shaping inbound TCP traffic in a way that
> child queues can expand to max link bandwidth unless there is a
> congestion, while in congestion admin can choose which child queues to
> throttle and in which order?

Of course I didn't mean 'inbound' as 'incoming to NIC', but 'incoming
from the Internet'. Actual shaping would take place outbound on internal
interface.

I'm writing this so I don't get another set of mails which warn me I
can't shape inbound, but need to shape outbound traffic.

--
Before enlightenment - chop wood, draw water.
After  enlightenment - chop wood, draw water.

Marko Cupać
https://www.mimar.rs/



rum0: could not multi write MAC register: IOERROR

2016-01-13 Thread bluesun08
Hi,

i tried an HWGUSB2-54 and an TL-WN321G WLAN-Stick as AP. Both should be
compatible with OpenBSD:
http://www.openbsd.org/cgi-bin/man.cgi/OpenBSD-current/man4/rum.4?query=rum=4.

My /etc/hostname.rum0:
mediaopt hostap mode 11g nwid openbsd wpakey  up

But i get the error messages:
/bsd: rum0: could not multi write MAC register: IOERROR
last message repeated 2 times
savecore: no core dump
/bsd: rum0: could not multi write MAC register: IOERROR
last message repeated 2 times
/bsd: rum0: could not transmit buffer: IOERROR
last message repeated 6 times
/bsd: rum0: device timeout

What goes wrong??

_

dmesg:
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2015 OpenBSD. All rights reserved. 
http://www.OpenBSD.org

OpenBSD 5.8 (GENERIC) #651: Sun Aug 16 04:48:04 MDT 2015
dera...@macppc.openbsd.org:/usr/src/sys/arch/macppc/compile/GENERIC
real mem = 1073741824 (1024MB)
avail mem = 1031016448 (983MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root: model PowerMac10,1
cpu0 at mainbus0: 7447A (Revision 0x102): 1249 MHz: 512KB L2 cache
mem0 at mainbus0
spdmem0 at mem0: 1GB DDR SDRAM non-parity PC3200CL3.0
memc0 at mainbus0: uni-n rev 0xd2
"hw-clock" at memc0 not configured
kiic0 at memc0 offset 0xf8001000
iic0 at kiic0
mpcpcibr0 at mainbus0 pci: uni-north
pci0 at mpcpcibr0 bus 0
pchb0 at pci0 dev 11 function 0 "Apple UniNorth AGP" rev 0x00
radeondrm0 at pci0 dev 16 function 0 "ATI Radeon 9200" rev 0x01
drm0 at radeondrm0
radeondrm0: irq 48
mpcpcibr1 at mainbus0 pci: uni-north
pci1 at mpcpcibr1 bus 0
macobio0 at pci1 dev 23 function 0 "Apple Intrepid" rev 0x00
openpic0 at macobio0 offset 0x4: version 0x4614 feature 3f0302 LE
macgpio0 at macobio0 offset 0x50
"modem-reset" at macgpio0 offset 0x1d not configured
"modem-power" at macgpio0 offset 0x1c not configured
macgpio1 at macgpio0 offset 0x9: irq 47
"programmer-switch" at macgpio0 offset 0x11 not configured
"gpio5" at macgpio0 offset 0x6f not configured
"gpio6" at macgpio0 offset 0x70 not configured
"extint-gpio15" at macgpio0 offset 0x67 not configured
"escc-legacy" at macobio0 offset 0x12000 not configured
zsc0 at macobio0 offset 0x13000: irq 22,23
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
aoa0 at macobio0 offset 0x1: irq 30,1,2
audio0 at aoa0
"timer" at macobio0 offset 0x15000 not configured
adb0 at macobio0 offset 0x16000
apm0 at adb0: battery flags 0x0, 0% charged
piic0 at adb0
iic1 at piic0
maxtmp0 at iic1 addr 0xc8: max6642
kiic1 at macobio0 offset 0x18000
iic2 at kiic1
wdc0 at macobio0 offset 0x2 irq 24: DMA
bwi0 at pci1 dev 18 function 0 "Broadcom BCM4306" rev 0x03: irq 52, address
00:11:24:8f:fd:30
ohci0 at pci1 dev 26 function 0 "Apple Intrepid USB" rev 0x00: irq 29,
version 1.0, legacy support
ohci1 at pci1 dev 27 function 0 "NEC USB" rev 0x43: irq 63, version 1.0
ohci2 at pci1 dev 27 function 1 "NEC USB" rev 0x43: irq 63, version 1.0
ehci0 at pci1 dev 27 function 2 "NEC USB" rev 0x04: irq 63
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "NEC EHCI root hub" rev 2.00/1.00 addr 1
usb1 at ohci0: USB revision 1.0
uhub1 at usb1 "Apple OHCI root hub" rev 1.00/1.00 addr 1
usb2 at ohci1: USB revision 1.0
uhub2 at usb2 "NEC OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci2: USB revision 1.0
uhub3 at usb3 "NEC OHCI root hub" rev 1.00/1.00 addr 1
mpcpcibr2 at mainbus0 pci: uni-north
pci2 at mpcpcibr2 bus 0
kauaiata0 at pci2 dev 13 function 0 "Apple Intrepid ATA" rev 0x00
wdc1 at kauaiata0 irq 39: DMA
wd0 at wdc1 channel 0 drive 0: 
wd0: 1-sector PIO, LBA48, 114473MB, 234441648 sectors
atapiscsi0 at wdc1 channel 0 drive 1
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0:  ATAPI 5/cdrom
removable
wd0(wdc1:0:0): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2
cd0(wdc1:0:1): using PIO mode 4, DMA mode 2, Ultra-DMA mode 2
"Apple UniNorth Firewire" rev 0x81 at pci2 dev 14 function 0 not configured
gem0 at pci2 dev 15 function 0 "Apple Uni-N2 GMAC" rev 0x80: irq 41, address
00:11:24:75:0a:c4
bmtphy0 at gem0 phy 0: BCM5221 100baseTX PHY, rev. 4
rum0 at uhub0 port 1 configuration 1 interface 0 "Ralink 802.11 bg WLAN" rev
2.00/0.01 addr 2
rum0: MAC/BBP RT2573 (rev 0x2573a), RF RT2528, address 00:08:d3:07:3c:a1
uhidev0 at uhub1 port 1 configuration 1 interface 0 "Apple Computer
HID-proxy" rev 1.10/15.38 addr 2
uhidev0: iclass 3/1
ukbd0 at uhidev0: 8 variable keys, 6 key codes
wskbd0 at ukbd0 mux 1
uhidev1 at uhub1 port 1 configuration 1 interface 1 "Apple Computer
HID-proxy" rev 1.10/15.38 addr 2
uhidev1: iclass 3/1
ums0 at uhidev1: 5 buttons
wsmouse0 at ums0 mux 0
vscsi0 at root
scsibus2 at vscsi0: 256 targets
softraid0 at root
scsibus3 at softraid0: 256 targets
bootpath: /pci@f400/ata-6@d/disk@0:/bsd
root on wd0a (f9a7c387cf69a5d2.a) swap on wd0b dump on wd0b
error: [drm:pid0:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM
trying to bind memory to 

Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Stefan Sperling
On Wed, Jan 13, 2016 at 01:20:08PM +0100, Christoph R. Murauer wrote:
> OT and only for the archive : iwm0 works not (dhcp ends always with no
> link ... sleeping) with a TP-Link M7350 (4G / LTE modem)

Not very off-topic since development for 11n support is on-going.

Can you please check if it works as expected if you run one of
these commands?

  ifconfig iwm0 media autoselect mode 11a

  ifconfig iwm0 media autoselect mode 11g

If either command fixes it, you're probably seeing an interoperability
problem in 11n mode with this particular AP.



Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Christoph R. Murauer
Hello !

Yes, I know, there is a newer snapshot out already but I had no time
to update it. Dmesg is below.

Everything I tried, worked well but I have some questions / informations.

I use a 2TB drive, where I use for /home a 1,7TB disklabel. If I run
mount this disklabel is shown as FFS. What I readed, disklabels bigger
then something like 1TB should be FFS2. I am just curious, is FFS2
also shown as FFS (I found no information about it) ?

user@thinkpad-w541 ~ $ df -h
Filesystem SizeUsed   Avail Capacity  Mounted on
/dev/sd2a 1005M   58.4M896M 6%/
/dev/sd2k  1.7T3.1G1.6T 0%/home
/dev/sd2d  3.9G   12.0K3.7G 0%/tmp
/dev/sd2f  2.0G729M1.2G38%/usr
/dev/sd2g 1005M210M745M22%/usr/X11R6
/dev/sd2h  9.8G3.0G6.3G32%/usr/local
/dev/sd2j  2.0G2.0K1.9G 0%/usr/obj
/dev/sd2i  2.0G2.0K1.9G 0%/usr/src
/dev/sd2e 66.2G   15.5M   62.8G 0%/var
tmpfs  8.0G4.0K8.0G 0%/home/ports/wrkobjdir

user@thinkpad-w541 ~ $ mount
/dev/sd2a on / type ffs (local)
/dev/sd2k on /home type ffs (local, nodev, nosuid)
/dev/sd2d on /tmp type ffs (local, nodev, nosuid)
/dev/sd2f on /usr type ffs (local, nodev)
/dev/sd2g on /usr/X11R6 type ffs (local, nodev)
/dev/sd2h on /usr/local type ffs (local, nodev)
/dev/sd2j on /usr/obj type ffs (local, nodev, nosuid)
/dev/sd2i on /usr/src type ffs (local, nodev, nosuid)
/dev/sd2e on /var type ffs (local, nodev, nosuid)
tmpfs on /home/ports/wrkobjdir type tmpfs (local)

When I switch from X to ttyC0 the display brightness is set to a
minimum (near as if the display is blanked). The message *error:
[drm:pid0:intel_dp_set_idle_link_train] *ERROR* Timed out waiting for
DP idle patterns* is shown and if I press fn F6 it is back at 100 %.
This happened only at the first switch and also if I shutdown the
machine (xterm, shutdown). The change of the display brightness
doesn't happened with 5.8 -release.

Is there a simple way to automatically re-run /etc/rc.local after a
resume ? I run atactl there and, it looks as if it is not running
after resuming the machine (checked the load / unload cycle counts
with atactl after resuming) ?

OT and only for the archive : iwm0 works not (dhcp ends always with no
link ... sleeping) with a TP-Link M7350 (4G / LTE modem), also urndis0
produces error messages (posted before about it). I used as reference
a Nexus 7 with Android 4 where this things doesn't happened. This is
NOT a OpenBSD problem. Maybe I have a monday product - if not, save
the € 100 and invest it in other hardware.


Thanks for answers.

dmesg :

 OpenBSD 5.9-beta (GENERIC.MP) #1807: Sat Jan  9 13:46:21 MST 2016
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 33939300352 (32367MB)
avail mem = 32906575872 (31382MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.7 @ 0x7cd2d000 (69 entries)
bios0: vendor LENOVO version "GNET73WW (2.21 )" date 03/12/2015
bios0: LENOVO 20EFS00B00
acpi0 at bios0: rev 2
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP DBGP ECDT HPET APIC MCFG SSDT SSDT SSDT SSDT
SSDT SSDT SSDT PCCT SSDT UEFI POAT ASF! BATB FPDT UEFI
acpi0: wakeup devices LID_(S4) SLPB(S3) IGBE(S4) EXP2(S4) EXP3(S4)
XHCI(S3) EHC1(S3) EHC2(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpiec0 at acpi0
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz, 2794.07 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,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
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.2.4, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz, 2793.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,SMX,EST,TM2,SSSE3,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,LONG,LAHF,ABM,PERF,ITSC,FSGSBASE,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz, 2793.53 MHz
cpu2:

Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Christoph R. Murauer
> On Wed, Jan 13, 2016 at 01:20:08PM +0100, Christoph R. Murauer wrote:
>> OT and only for the archive : iwm0 works not (dhcp ends always with
>> no
>> link ... sleeping) with a TP-Link M7350 (4G / LTE modem)
>
> Not very off-topic since development for 11n support is on-going.
>
> Can you please check if it works as expected if you run one of
> these commands?
>
>   ifconfig iwm0 media autoselect mode 11a
>
>   ifconfig iwm0 media autoselect mode 11g
>
> If either command fixes it, you're probably seeing an interoperability
> problem in 11n mode with this particular AP.
>

Hello !

Thanks for your answer.
Default output after reboot using /etc/hostname.iwm0

ifconfig iwm0
iwm0: flags=8843 mtu 1500
lladdr cc:3d:82:52:2b:5a
priority: 4
groups: wlan
media: IEEE802.11 autoselect
status: no network
ieee80211: nwid TP-LINK_M7350_6D1625 wpakey 
wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp
wpagroupcipher tkip

more /etc/hostname.iwm0
nwid TP-LINK_M7350_6D1625
wpakey 21154320
dhcp

No worry, factory defaults. Content is a copy of /etc/hostname.urtwn0.

Booth lines have no effect with this AP.

Output for urtwn0 using /etc/hostname.urtwn0 also since reboot.

urtwn0: flags=8843 mtu 1500
lladdr c4:e9:84:06:6c:a7
priority: 4
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: nwid TP-LINK_M7350_6D1625 chan 9 bssid
3c:46:d8:6d:16:25 20dBm wpakey  wpaprotos
wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
inet 192.168.0.104 netmask 0xff00 broadcast 192.168.0.255

ifconfig iwm0 scan works.

If I switch back to b it works with the Nexus 7 (also not with a and g).

ifconfig iwm0 media autoselect mode 11b
dhclient iwm0
iwm0: no link ... got link
DHCPREQUEST on iwm0 to 255.255.255.255
DHCPACK from 192.168.43.1 (02:1a:11:f4:84:91)
bound to 192.168.43.89 -- renewal in 1800 seconds.

ifconfig iwm0
iwm0: flags=8843 mtu 1500
lladdr cc:3d:82:52:2b:5a
priority: 4
groups: wlan
media: IEEE802.11 autoselect mode 11b (DS1 mode 11b)
status: active
ieee80211: nwid AP chan 6 bssid 02:1a:11:f4:84:91 100% wpakey
 wpaprotos wpa1,wpa2 wpaakms psk wpaciphers
tkip,ccmp wpagroupcipher tkip
inet 192.168.43.89 netmask 0xff00 broadcast 192.168.43.255

Tried the TP-Link AP with b again with the same result.

Maybe it helps.



Re: doas(1) and $PATH

2016-01-13 Thread Ted Unangst
Philippe Meunier wrote:
> The same thing happens if I first move foo to / and add / at the
> beginning of $PATH, so it's not a permission problem with
> /home/meunier/bin, and foo itself has permissions 777.
> If I first move foo to /bin then doas(1) finds foo without problem.

5.8 was a little too restrictive about paths. It's been relaxed in 5.9.



athn causes crash when bringing interface up

2016-01-13 Thread Brendan Van Hook
Hello,

After upgrading to the most recent snapshot, a simple 'ifconfig athn0 up' sends
me to ddb:

kernel: integer divide fault trap, code=0
Stopped at: ar5008_set_delta_slope+0x40:idiv1   %ecx,%eax

Trace:

ar5008_set_delta_slop() at ar5008_set_delta_slope+0x40
athn_hw_reset() at athn_hw_reset+0x20e
athn_init() at athn_init+0x11c
athn_ioctl() at athn_ioctl+0x1de
ifioctl() at ifioctl+0x90c
sys_ioctl() at sys_ioctl+0x196
syscall() at syscall+0x368
--- syscall (number 54) ---
end of kernel
end trace frame:0x7f7d2490, count: -7
0x1ca1142212ca:

dmesg:

OpenBSD 5.9-beta (GENERIC.MP) #1822: Tue Jan 12 08:00:28 MST 2016
dera...@amd64.openbsd.org:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 6321795072 (6028MB)
avail mem = 6126055424 (5842MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.5 @ 0xaacef000 (40 entries)
bios0: vendor TOSHIBA version "Version 1.60" date 02/08/2012
bios0: TOSHIBA PORTEGE Z835
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP HPET APIC MCFG ASF! BOOT SLIC SSDT SSDT SSDT SSDT
acpi0: wakeup devices LANC(S4) HDEF(S3) RP04(S4) PXSX(S4) USBB(S4) EHC1(S4) 
EHC2(S4) PWRB(S4) LID_(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpihpet0 at acpi0: 14318179 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz, 1397.02 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,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC,SENSOR,ARAT
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.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz, 1396.83 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,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC,SENSOR,ARAT
cpu1: 256KB 64b/line 8-way L2 cache
cpu1: smt 1, core 0, package 0
cpu2 at mainbus0: apid 2 (application processor)
cpu2: Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz, 1396.83 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,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC,SENSOR,ARAT
cpu2: 256KB 64b/line 8-way L2 cache
cpu2: smt 0, core 1, package 0
cpu3 at mainbus0: apid 3 (application processor)
cpu3: Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz, 1396.84 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,x2APIC,POPCNT,DEADLINE,XSAVE,AVX,NXE,LONG,LAHF,PERF,ITSC,SENSOR,ARAT
cpu3: 256KB 64b/line 8-way L2 cache
cpu3: smt 1, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec0, version 20, 24 pins
acpimcfg0 at acpi0 addr 0xf800, bus 0-63
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (PEGP)
acpiprt2 at acpi0: bus 1 (RP01)
acpiprt3 at acpi0: bus -1 (RP02)
acpiprt4 at acpi0: bus 2 (RP03)
acpiprt5 at acpi0: bus -1 (RP04)
acpiprt6 at acpi0: bus 3 (RP05)
acpiprt7 at acpi0: bus -1 (RP06)
acpiprt8 at acpi0: bus -1 (RP07)
acpiprt9 at acpi0: bus -1 (RP08)
acpiprt10 at acpi0: bus -1 (PCIB)
acpicpu0 at acpi0: C2(350@104 mwait.1@0x20), C1(1000@1 mwait.1), PSS
acpicpu1 at acpi0: C2(350@104 mwait.1@0x20), C1(1000@1 mwait.1), PSS
acpicpu2 at acpi0: C2(350@104 mwait.1@0x20), C1(1000@1 mwait.1), PSS
acpicpu3 at acpi0: C2(350@104 mwait.1@0x20), C1(1000@1 mwait.1), PSS
acpipwrres0 at acpi0: PDOC, resource for DOCK
acpitz0 at acpi0: critical temperature is 102 degC
acpitoshiba0 at acpi0
acpiac0 at acpi0: AC unit online
acpibtn0 at acpi0: PWRB
acpibtn1 at acpi0: LID_
acpibat0 at acpi0: BAT1 model "G71C000CH310" serial 000755 type Li-ION   
oem "0"
acpidock0 at acpi0: DOCK not docked (0)
cpu0: Enhanced SpeedStep 1397 MHz: speeds: 1400, 1300, 1200, 1100, 1000, 900, 
800 MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel Core 2G Host" rev 0x09
inteldrm0 at pci0 dev 2 function 0 "Intel HD Graphics 3000" rev 0x09
drm0 at inteldrm0
inteldrm0: msi
inteldrm0: 1366x768
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 6 Series MEI" rev 0x04 at pci0 dev 22 function 0 not configured
em0 at pci0 dev 25 function 0 "Intel 82579V" rev 0x04: msi, address 
e8:9d:87:9c:dd:2f
ehci0 at pci0 dev 26 function 0 "Intel 6 Series USB" rev 

unbound(8) generating too many log messages

2016-01-13 Thread Philippe Meunier
Hello,

I have a laptop computer configured to use unbound(8) and ntpd(8) but
which does not have any network interface configured by default
(except lo0, obviously) since which interface needs to be configured
and how depends on where I'm using the computer.

After booting, unbound(8) and ntpd(8) both start without problem.
Then ntpd(8) automatically starts trying to contact NTP servers from
pool.ntp.org, which triggers DNS queries.  In turn unbound(8) tries to
contact root DNS servers and fails since no network interface is
configured.  Unbound(8) then logs messages to syslog:

Jan 14 10:07:58 mycomputer unbound: [2824:0] notice: sendto failed: Can't 
assign requested address
Jan 14 10:07:58 mycomputer unbound: [2824:0] notice: remote address is 
192.5.5.241 port 53

The problem is that unbound(8) generates such a pair of messages up to
20 times for each root server!  That's 2 lines * 20 times * 13 root
servers = 520 lines that end up going to syslog.  Then 15 seconds
later ntpd(8) tries again and you get another 520 lines, and so on.
This continues until a network interface is configured.  The result is
that I've accumulated over 16000 lines of log messages like the ones
above over just the past three days...

So is there a way to make unbound(8) more quiet (short of sending the
log messages to /dev/null)?

For info, this is the unbound(8) version 1.5.4 from OpenBSD
5.8-release.

Thank you,

Philippe



Re: Mg scroll-up issue in xterm

2016-01-13 Thread Christian Weisgerber
On 2016-01-10, Christian Weisgerber  wrote:

>>> I noticed issue with mg scroll-up keybinding when "xterm*locale: true" is 
>>> set in
>>> ~/.Xresources.
>>> When the above option is set, mg requires that you type C-v C-v to scroll-up
>>> instead of single C-v. I'm not sure if this is bug or feature.
>>
> I haven't had time to look into this further, but it happens when
> luit(1) is run.

I just committed a fix to luit.

-- 
Christian "naddy" Weisgerber  na...@mips.inka.de



Re: pfctl: DIOCGETQSTATS: Bad file descriptor

2016-01-13 Thread lists
I haven't done anything other than binary releases in some time,
although it's possible I may have fat fingered a terminal at some point.
I infrequently check these boxes other than biannual release updates and
mtier patches.

The checksums and timestamps of /bsd and /sbin/pfctl match another
working 5.8 box, and uname -a gives:
OpenBSD hostname 5.8 GENERIC.MP#0 amd64

The box is my home router and I'm very far away for the next few weeks,
so will leave it as-is since it's working for now.  If no one has seen
this before, I'll give it another go with a fresh binary install when
I'm able to get access to the box again.

Thanks all!



Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Stuart Henderson
On 2016-01-13, Christoph R. Murauer  wrote:
> Please give me a day or so. My nearest CVS (Vienna) is not really
> fast. The last time it refuses the connection during fetching.

Use a different one. anoncvs.fr.openbsd.org and anoncvs.spacehopper.org
update fairly fast.



Re: PF: can't make queueing and priority work as expected

2016-01-13 Thread Mihai Popescu
> I'm writing this so I don't get another set of mails which warn me I
> can't shape inbound, but need to shape outbound traffic.

Hello Marko,

Don't you think you are out of subject with this thread already?
Now, seriously, do you expect someone to teach you queues online?

Maybe the PF implementation part is not the swiss army knife of
traffic shapping, but your emails have no actual question.

My advice is to start a new thread, state your desires for traffic
shapping in a gateway handling p2p and http(s) and see if someone can
help.

Is is very interesting that you started learning traffic rules a few
days ago but you are up to question the implementation.

Regards.



Re: doas(1) -s argument; What's the benefit?

2016-01-13 Thread Adam Jeanguenat
pachl wrote:
> Other than compatibility with `sudo -s`, what are the benefits of
> `doas -s`?

According to the CVS log:

"Add doas -s as a shorthand for doas $SHELL. ok tedu" (by nicm)

ref:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/usr.bin/doas/doas.c?rev=1.8
ent-type=text/x-cvsweb-markup

--avj



Re: USB mouse detached when moving wheel fast

2016-01-13 Thread Marko Cupać
On Wed, 13 Jan 2016 13:39:25 + (GMT)
Roderich  wrote:

> Dear Sirs!
>
> When I move the mouse too fast / not slow enough, I get the following
> in dmesg, many times:
>
> >>
> wsmouse0 detached
> ums0 detached
> uhidev0 detached
> uhidev0 at uhub4 port 2 configuration 1 interface 0 "MOON AND" rev
> 1.00/0.10 addr 2 uhidev0: iclass 3/1
> ums0 at uhidev0: 3 buttons, Z dir
> wsmouse0 at ums0 mux 0
> <<
>
> This affects negatively the responsiveness of the mouse. It may
> also happen, that the mouse is not recognized again.
>
> I observed this behaviour with OpenBSD 4.8 and OpenBSD 5.8
> in different machines, as also with FreeBSD.
>
> I have little experience with USB mouses and use till today
> a PS/2 mouse: the wheel is with PS/2 very responsive independent
> of the speed.
>
> Is this normal? Is it a problem of the mouse? Is it the
> (automatic) configuration of X11? Can I do something against
> it?
>
> Thanks
> Rodrigo.
>

You can easily eliminate the possibility of a broken mouse by trying
another one ;)
--
Before enlightenment - chop wood, draw water.
After  enlightenment - chop wood, draw water.

Marko Cupać
https://www.mimar.rs/



USB mouse detached when moving wheel fast

2016-01-13 Thread Roderich

Dear Sirs!

When I move the mouse too fast / not slow enough, I get the following
in dmesg, many times:




wsmouse0 detached
ums0 detached
uhidev0 detached
uhidev0 at uhub4 port 2 configuration 1 interface 0 "MOON AND" rev 1.00/0.10 
addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
<<

This affects negatively the responsiveness of the mouse. It may
also happen, that the mouse is not recognized again.

I observed this behaviour with OpenBSD 4.8 and OpenBSD 5.8
in different machines, as also with FreeBSD.

I have little experience with USB mouses and use till today
a PS/2 mouse: the wheel is with PS/2 very responsive independent
of the speed.

Is this normal? Is it a problem of the mouse? Is it the
(automatic) configuration of X11? Can I do something against
it?

Thanks
Rodrigo.



Re: PF: can't make queueing and priority work as expected

2016-01-13 Thread Marko Cupać
On Wed, 13 Jan 2016 16:36:23 +0200
Mihai Popescu  wrote:

> > I'm writing this so I don't get another set of mails which warn me I
> > can't shape inbound, but need to shape outbound traffic.
>
> Hello Marko,
>
> Don't you think you are out of subject with this thread already?
> Now, seriously, do you expect someone to teach you queues online?
>
> Maybe the PF implementation part is not the swiss army knife of
> traffic shapping, but your emails have no actual question.
>
> My advice is to start a new thread, state your desires for traffic
> shapping in a gateway handling p2p and http(s) and see if someone can
> help.
>
> Is is very interesting that you started learning traffic rules a few
> days ago but you are up to question the implementation.
>
> Regards.

Ok, let's start insult each other.

I've setup my first PF on OpenBSD in 2006.

Stuck your advice up your ass and fuck off.
--
Before enlightenment - chop wood, draw water.
After  enlightenment - chop wood, draw water.

Marko Cupać
https://www.mimar.rs/



Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Stefan Sperling
On Wed, Jan 13, 2016 at 02:18:47PM +0100, Christoph R. Murauer wrote:
> > On Wed, Jan 13, 2016 at 01:20:08PM +0100, Christoph R. Murauer wrote:
> >> OT and only for the archive : iwm0 works not (dhcp ends always with
> >> no
> >> link ... sleeping) with a TP-Link M7350 (4G / LTE modem)
> >
> > Not very off-topic since development for 11n support is on-going.
> >
> > Can you please check if it works as expected if you run one of
> > these commands?
> >
> >   ifconfig iwm0 media autoselect mode 11a
> >
> >   ifconfig iwm0 media autoselect mode 11g
> >
> > If either command fixes it, you're probably seeing an interoperability
> > problem in 11n mode with this particular AP.
> >
> 
> Hello !
> 
> Thanks for your answer.
> Default output after reboot using /etc/hostname.iwm0
> 
> ifconfig iwm0
> iwm0: flags=8843 mtu 1500
> lladdr cc:3d:82:52:2b:5a
> priority: 4
> groups: wlan
> media: IEEE802.11 autoselect
> status: no network
> ieee80211: nwid TP-LINK_M7350_6D1625 wpakey 
> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp
> wpagroupcipher tkip
> 
> more /etc/hostname.iwm0
> nwid TP-LINK_M7350_6D1625
> wpakey 21154320
> dhcp
> 
> No worry, factory defaults. Content is a copy of /etc/hostname.urtwn0.
> 
> Booth lines have no effect with this AP.
> 
> Output for urtwn0 using /etc/hostname.urtwn0 also since reboot.
> 
> urtwn0: flags=8843 mtu 1500
> lladdr c4:e9:84:06:6c:a7
> priority: 4
> groups: wlan egress
> media: IEEE802.11 autoselect (OFDM54 mode 11g)
> status: active
> ieee80211: nwid TP-LINK_M7350_6D1625 chan 9 bssid
> 3c:46:d8:6d:16:25 20dBm wpakey  wpaprotos
> wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
> inet 192.168.0.104 netmask 0xff00 broadcast 192.168.0.255
> 
> ifconfig iwm0 scan works.
> 
> If I switch back to b it works with the Nexus 7 (also not with a and g).
> 
> ifconfig iwm0 media autoselect mode 11b
> dhclient iwm0
> iwm0: no link ... got link
> DHCPREQUEST on iwm0 to 255.255.255.255
> DHCPACK from 192.168.43.1 (02:1a:11:f4:84:91)
> bound to 192.168.43.89 -- renewal in 1800 seconds.
> 
> ifconfig iwm0
> iwm0: flags=8843 mtu 1500
> lladdr cc:3d:82:52:2b:5a
> priority: 4
> groups: wlan
> media: IEEE802.11 autoselect mode 11b (DS1 mode 11b)
> status: active
> ieee80211: nwid AP chan 6 bssid 02:1a:11:f4:84:91 100% wpakey
>  wpaprotos wpa1,wpa2 wpaakms psk wpaciphers
> tkip,ccmp wpagroupcipher tkip
> inet 192.168.43.89 netmask 0xff00 broadcast 192.168.43.255
> 
> Tried the TP-Link AP with b again with the same result.
> 
> Maybe it helps.

Please try this diff.
I suspect this bug is causing all sorts of problems.

Index: ieee80211.c
===
RCS file: /cvs/src/sys/net80211/ieee80211.c,v
retrieving revision 1.57
diff -u -p -r1.57 ieee80211.c
--- ieee80211.c 12 Jan 2016 09:28:09 -  1.57
+++ ieee80211.c 13 Jan 2016 14:19:26 -
@@ -749,8 +749,10 @@ ieee80211_setmode(struct ieee80211com *i
modeflags = chanflags[mode];
for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
c = >ic_channels[i];
-   if (mode == IEEE80211_MODE_AUTO ||
-   (c->ic_flags & modeflags) == modeflags)
+   if (mode == IEEE80211_MODE_AUTO) {
+   if (c->ic_flags != 0)
+   break;
+   } else if ((c->ic_flags & modeflags) == modeflags)
break;
}
if (i > IEEE80211_CHAN_MAX) {
@@ -764,8 +766,10 @@ ieee80211_setmode(struct ieee80211com *i
memset(ic->ic_chan_active, 0, sizeof(ic->ic_chan_active));
for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
c = >ic_channels[i];
-   if (mode == IEEE80211_MODE_AUTO ||
-   (c->ic_flags & modeflags) == modeflags)
+   if (mode == IEEE80211_MODE_AUTO) {
+   if (c->ic_flags != 0)
+   setbit(ic->ic_chan_active, i);
+   } else if ((c->ic_flags & modeflags) == modeflags)
setbit(ic->ic_chan_active, i);
}
/*



Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Christoph R. Murauer
Please give me a day or so. My nearest CVS (Vienna) is not really
fast. The last time it refuses the connection during fetching.

> On Wed, Jan 13, 2016 at 02:18:47PM +0100, Christoph R. Murauer wrote:
>> > On Wed, Jan 13, 2016 at 01:20:08PM +0100, Christoph R. Murauer
>> wrote:
>> >> OT and only for the archive : iwm0 works not (dhcp ends always
>> with
>> >> no
>> >> link ... sleeping) with a TP-Link M7350 (4G / LTE modem)
>> >
>> > Not very off-topic since development for 11n support is on-going.
>> >
>> > Can you please check if it works as expected if you run one of
>> > these commands?
>> >
>> >   ifconfig iwm0 media autoselect mode 11a
>> >
>> >   ifconfig iwm0 media autoselect mode 11g
>> >
>> > If either command fixes it, you're probably seeing an
>> interoperability
>> > problem in 11n mode with this particular AP.
>> >
>>
>> Hello !
>>
>> Thanks for your answer.
>> Default output after reboot using /etc/hostname.iwm0
>>
>> ifconfig iwm0
>> iwm0: flags=8843 mtu 1500
>> lladdr cc:3d:82:52:2b:5a
>> priority: 4
>> groups: wlan
>> media: IEEE802.11 autoselect
>> status: no network
>> ieee80211: nwid TP-LINK_M7350_6D1625 wpakey 
>> wpaprotos wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp
>> wpagroupcipher tkip
>>
>> more /etc/hostname.iwm0
>> nwid TP-LINK_M7350_6D1625
>> wpakey 21154320
>> dhcp
>>
>> No worry, factory defaults. Content is a copy of
>> /etc/hostname.urtwn0.
>>
>> Booth lines have no effect with this AP.
>>
>> Output for urtwn0 using /etc/hostname.urtwn0 also since reboot.
>>
>> urtwn0: flags=8843 mtu 1500
>> lladdr c4:e9:84:06:6c:a7
>> priority: 4
>> groups: wlan egress
>> media: IEEE802.11 autoselect (OFDM54 mode 11g)
>> status: active
>> ieee80211: nwid TP-LINK_M7350_6D1625 chan 9 bssid
>> 3c:46:d8:6d:16:25 20dBm wpakey  wpaprotos
>> wpa1,wpa2 wpaakms psk wpaciphers tkip,ccmp wpagroupcipher tkip
>> inet 192.168.0.104 netmask 0xff00 broadcast
>> 192.168.0.255
>>
>> ifconfig iwm0 scan works.
>>
>> If I switch back to b it works with the Nexus 7 (also not with a and
>> g).
>>
>> ifconfig iwm0 media autoselect mode 11b
>> dhclient iwm0
>> iwm0: no link ... got link
>> DHCPREQUEST on iwm0 to 255.255.255.255
>> DHCPACK from 192.168.43.1 (02:1a:11:f4:84:91)
>> bound to 192.168.43.89 -- renewal in 1800 seconds.
>>
>> ifconfig iwm0
>> iwm0: flags=8843 mtu 1500
>> lladdr cc:3d:82:52:2b:5a
>> priority: 4
>> groups: wlan
>> media: IEEE802.11 autoselect mode 11b (DS1 mode 11b)
>> status: active
>> ieee80211: nwid AP chan 6 bssid 02:1a:11:f4:84:91 100%
>> wpakey
>>  wpaprotos wpa1,wpa2 wpaakms psk wpaciphers
>> tkip,ccmp wpagroupcipher tkip
>> inet 192.168.43.89 netmask 0xff00 broadcast
>> 192.168.43.255
>>
>> Tried the TP-Link AP with b again with the same result.
>>
>> Maybe it helps.
>
> Please try this diff.
> I suspect this bug is causing all sorts of problems.
>
> Index: ieee80211.c
> ===
> RCS file: /cvs/src/sys/net80211/ieee80211.c,v
> retrieving revision 1.57
> diff -u -p -r1.57 ieee80211.c
> --- ieee80211.c   12 Jan 2016 09:28:09 -  1.57
> +++ ieee80211.c   13 Jan 2016 14:19:26 -
> @@ -749,8 +749,10 @@ ieee80211_setmode(struct ieee80211com *i
>   modeflags = chanflags[mode];
>   for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
>   c = >ic_channels[i];
> - if (mode == IEEE80211_MODE_AUTO ||
> - (c->ic_flags & modeflags) == modeflags)
> + if (mode == IEEE80211_MODE_AUTO) {
> + if (c->ic_flags != 0)
> + break;
> + } else if ((c->ic_flags & modeflags) == modeflags)
>   break;
>   }
>   if (i > IEEE80211_CHAN_MAX) {
> @@ -764,8 +766,10 @@ ieee80211_setmode(struct ieee80211com *i
>   memset(ic->ic_chan_active, 0, sizeof(ic->ic_chan_active));
>   for (i = 0; i <= IEEE80211_CHAN_MAX; i++) {
>   c = >ic_channels[i];
> - if (mode == IEEE80211_MODE_AUTO ||
> - (c->ic_flags & modeflags) == modeflags)
> + if (mode == IEEE80211_MODE_AUTO) {
> + if (c->ic_flags != 0)
> + setbit(ic->ic_chan_active, i);
> + } else if ((c->ic_flags & modeflags) == modeflags)
>   setbit(ic->ic_chan_active, i);
>   }
>   /*



Re: mbuf leak in carp with ipv6

2016-01-13 Thread Martin Hlavatý
I have same errors in log and same behavior on one of my firewall
cluster. Carp flapping is a result of master system lagging and not
sending carp packets on time. You can workaround it by setting advbase
to some larger value, e.g. 10, but it will obviously still keep
lagging and dropping packets on NIC when these lags occur.

On my graphs I noticed peak in pf match ratio, peak in packesloss on
wan iface, higher cpu load and utilization when this ocucrs. I am not
graphing mbufs, it is around 500-900 usually, kern.maxclusters was set
to 32768 and and peak in netstat -m was 32770, so I raised that to
64000. It had no effect, it did not peak above 32770 and lags still
occur.

Dont really know what to do with this, I am sort of just waiting for
5.9 release and its unlocked networking stack hoping that multicore
cpu will manage that load.

On Thu, Jan 7, 2016 at 10:52 AM, Håkon Lerring  wrote:
>> On 05 Jan 2016, at 13:06, Stefan Sperling  wrote:
>>
>> On Tue, Jan 05, 2016 at 12:29:43PM +0100, Håkon Lerring wrote:
>>> Hello misc.
>>>
>>> I was investigating a problem with a firewall that goes AWOL every week.
> It
>>> happens only if i activate an ipv6 address on a carp interface. The carp
> log
>>> has this message:
>>>
>>> Jan  5 12:10:06  /bsd: carp: packet size 48 too small
>>>
>>> I think i have narrowed down the leak to the handling of too small
>>> ipv6-packets:
>>>
>>> --- ip_carp.c.orig   2016-01-05 12:18:03.0 +0100
>>> +++ ip_carp.c2016-01-05 12:18:30.0 +0100
>>> @@ -562,6 +562,7 @@
>>>  if ((m = m_pullup(m, *offp + sizeof(*ch))) == NULL) {
>>>  carpstats.carps_badlen++;
>>>  CARP_LOG(LOG_INFO, sc, ("packet size %u too small", len));
>>> +m_freem(m);
>>>  return (IPPROTO_DONE);
>>>  }
>>>  ch = (struct carp_header *)(mtod(m, caddr_t) + *offp);
>>>
>>>
>>> I have not yet tested this patch since this is a production system. Why
> the
>>> other machine is sending incomplete packets is another question i'm
> currently
>>> investigating.
>>
>> Your patch effectively just calls m_freem(NULL);
>> And m_pullup already frees the mbuf on failure.
>>
>> Can you describe the actual problem you're seeing with more words than
> "AWOL"?
>
> Sorry for my hasty conclusion about my problem (i see that i might be wrong
> about the cause), i will explain it in more detail.
>
> I have 2 firewalls/routers with multiple carp interfaces (11). 1 on uplink
> (carp2) and the rest for different internal networks. All the carp
interfaces
> are set up as a preemptive failover in case the master goes down. The
problem
> has two symptoms but i believe they might have the same cause (as they
occur
> at the same time).
>
> The first symptom is that at what seems to be random times the carp2
interface
> (see ifconfig output below) on the backup-machine starts flapping between
> backup and master (the designated master does not do the same) and complain
> about too small packets:
>
> Jan  7 09:00:11 hostname /bsd: carp2: state transition: BACKUP -> MASTER
> Jan  7 09:00:12 hostname /bsd: carp2: state transition: MASTER -> BACKUP
> Jan  7 09:00:12 hostname /bsd: carp: packet size 48 too small
> Jan  7 09:00:18 hostname last message repeated 6 times
> Jan  7 09:00:19 hostname /bsd: carp2: state transition: BACKUP -> MASTER
> Jan  7 09:00:19 hostname /bsd: carp2: state transition: MASTER -> BACKUP
> Jan  7 09:00:19 hostname /bsd: carp: packet size 48 too small
> Jan  7 09:00:25 hostname last message repeated 6 times
> Jan  7 09:00:26 hostname /bsd: carp2: state transition: BACKUP -> MASTER
> Jan  7 09:00:26 hostname /bsd: carp2: state transition: MASTER -> BACKUP
>
> etc..
>
> The designated master does also log that "packet size 48 too small"
>
> MASTER carp2:
> carp2: flags=8843 mtu 1500
> lladdr 00:00:5e:00:01:02
> description: uplink
> priority: 15
> carp: MASTER carpdev bnx0 vhid 2 advbase 1 advskew 0
> groups: carp
> status: master
> inet  netmask 0xfff8 broadcast 
> inet6 fe80::200:5eff:fe00:102%carp2 prefixlen 64 scopeid 0x16
> inet6  prefixlen 64
>
> BACKUP carp2:
> carp2: flags=8843 mtu 1500
> lladdr 00:00:5e:00:01:02
> description: uplink
> priority: 15
> carp: BACKUP carpdev bnx0 vhid 2 advbase 2 advskew 128
> groups: carp
> status: backup
> inet  netmask 0xfff8 broadcast 
> inet6 fe80::200:5eff:fe00:102%carp2 prefixlen 64 scopeid 0x16
> inet6  prefixlen 64
>
> The other carp interfaces on the same machine does not have this problem.
The
> only things different about carp2 from the other interfaces is that carp2
has
> an IPv6 address and is backed by a bnx interface instead of an em interface
> (though this does not seem to be of significance as i have tried it with em
> interface 

doas

2016-01-13 Thread Donald Allen
My compliments to Ted Unangst and whoever else was involved in the
creation of doas. sudo configuration is such an incredible hairball
that I'll wager that few attempt to wade through the documentation to
get things set up so that innocuous things are convenient and the rest
is secure. I know I didn't. But doas makes it easy to do precisely
that. A very nice piece of work.

Don



Re: Questions to the snapshot from January 9 2016 ?

2016-01-13 Thread Stuart Henderson
On 2016-01-13, Christoph R. Murauer  wrote:
>
> Is there a simple way to automatically re-run /etc/rc.local after a
> resume ? I run atactl there and, it looks as if it is not running
> after resuming the machine (checked the load / unload cycle counts
> with atactl after resuming) ?

See the apmd(8) manual about /etc/apm/resume.



doas(1) and $PATH

2016-01-13 Thread Philippe Meunier
Hello,

Could someone be kind enough to explain to me the cause of the
following?

$ cat /home/meunier/bin/foo
#!/bin/ksh
echo "it works!"
$ /usr/bin/which foo
/home/meunier/bin/foo
$ foo
it works!
$ doas /usr/bin/which foo
Password:
/home/meunier/bin/foo
$ doas foo
Password:
doas: foo: command not found
$

It makes no sense to me.

The same thing happens if I first move foo to / and add / at the
beginning of $PATH, so it's not a permission problem with
/home/meunier/bin, and foo itself has permissions 777.
If I first move foo to /bin then doas(1) finds foo without problem.

For reference:

$ uname -a
OpenBSD something.somewhere 5.8 GENERIC#1066 i386
$ cat /etc/doas.conf
permit :wheel
$ egrep wheel /etc/group
wheel:*:0:root,meunier
$ doas /home/meunier/bin/foo
Password:
it works!
$

By the way, while playing with which(1) and doas(1) and $PATH, I
managed to get which(1) to core dump, twice, although I have not been
able to reproduce it reliably.  Here's gdb's output from the core
dump, for all it's worth:

$ gdb /usr/bin/which which.core
GNU gdb 6.3
[...]
This GDB was configured as "i386-unknown-openbsd5.8"...(no debugging symbols 
found)

Core was generated by `which'.
Program terminated with signal 11, Segmentation fault.
(no debugging symbols found)
Loaded symbols for /usr/bin/which
Reading symbols from /usr/lib/libc.so.80.1...done.
Loaded symbols for /usr/lib/libc.so.80.1
Reading symbols from /usr/libexec/ld.so...done.
Loaded symbols for /usr/libexec/ld.so
#0  0x1ab63feb in ?? () from /usr/bin/which
(gdb) bt
#0  0x1ab63feb in ?? () from /usr/bin/which
#1  0x87486000 in ?? ()
#2  0x3ab6303d in ?? () from /usr/bin/which
#3  0x02e6 in ?? ()
#4  0x in ?? ()
(gdb)

Thanks,

Philippe



Re: doas(1) and $PATH

2016-01-13 Thread Raul Miller
I do not see keepenv in your doas.conf

-- 
Raul


On Wed, Jan 13, 2016 at 11:17 AM, Philippe Meunier  wrote:
> Hello,
>
> Could someone be kind enough to explain to me the cause of the
> following?
>
> $ cat /home/meunier/bin/foo
> #!/bin/ksh
> echo "it works!"
> $ /usr/bin/which foo
> /home/meunier/bin/foo
> $ foo
> it works!
> $ doas /usr/bin/which foo
> Password:
> /home/meunier/bin/foo
> $ doas foo
> Password:
> doas: foo: command not found
> $
>
> It makes no sense to me.
>
> The same thing happens if I first move foo to / and add / at the
> beginning of $PATH, so it's not a permission problem with
> /home/meunier/bin, and foo itself has permissions 777.
> If I first move foo to /bin then doas(1) finds foo without problem.
>
> For reference:
>
> $ uname -a
> OpenBSD something.somewhere 5.8 GENERIC#1066 i386
> $ cat /etc/doas.conf
> permit :wheel
> $ egrep wheel /etc/group
> wheel:*:0:root,meunier
> $ doas /home/meunier/bin/foo
> Password:
> it works!
> $
>
> By the way, while playing with which(1) and doas(1) and $PATH, I
> managed to get which(1) to core dump, twice, although I have not been
> able to reproduce it reliably.  Here's gdb's output from the core
> dump, for all it's worth:
>
> $ gdb /usr/bin/which which.core
> GNU gdb 6.3
> [...]
> This GDB was configured as "i386-unknown-openbsd5.8"...(no debugging symbols 
> found)
>
> Core was generated by `which'.
> Program terminated with signal 11, Segmentation fault.
> (no debugging symbols found)
> Loaded symbols for /usr/bin/which
> Reading symbols from /usr/lib/libc.so.80.1...done.
> Loaded symbols for /usr/lib/libc.so.80.1
> Reading symbols from /usr/libexec/ld.so...done.
> Loaded symbols for /usr/libexec/ld.so
> #0  0x1ab63feb in ?? () from /usr/bin/which
> (gdb) bt
> #0  0x1ab63feb in ?? () from /usr/bin/which
> #1  0x87486000 in ?? ()
> #2  0x3ab6303d in ?? () from /usr/bin/which
> #3  0x02e6 in ?? ()
> #4  0x in ?? ()
> (gdb)
>
> Thanks,
>
> Philippe



Re: anyone using msk(4) NICs?

2016-01-13 Thread Peter Baldridge
I have one that seems to work fine.  I have some issues getting it to auto
negotiate the speed correctly on one of my switches but I've never looked
into that much as it works on other switches.  I'm not sure if its a switch
issue or nic issue.

mskc0 at pci2 dev 0 function 0 "Marvell Yukon 88E8040" rev 0x13, Yukon-2
FE+ rev. A0 (0x0)
I have one that works fine:

mskc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8053" rev 0x22, Yukon-2 EC
rev. A3 (0x2): apic 1 int 16

But there are several variants of this chip, and some are buggier than
others.  Problems have been reported before.  Unfortunately I have
never been able to reproduce them.



Re: anyone using msk(4) NICs?

2016-01-13 Thread Einfach Jemand
On Sat, Jan 09, 2016 at 04:52:24PM -0700, Devin Reade wrote:
> I reported a problem on the bugs@ list in that I have a machine that
> panics if the msk(4) interface is used, but works fine with an em(4)
> interface.
> 
> There is a possibility that I have bad hardware as I've been able to
> replicate this on 5.9 beta, 5.8 release, and now 5.7 release.  I find
> it unlikely that msk(4) has been broken that long.
> 
> Is anyone running a machine using the msk NIC, for any of those
> versions of OpenBSD?  If so and you can send traffic over your
> msk for more than a few minutes without causing a panic, I'll treat
> it as dead hardware and move along.
> 
> For that matter if you have msk running successfully on an earlier
> version of OpenBSD, let me know what version and I can test against it.
> 
> Thanks,
> Devin
> 

Hi,

the msk on a Panasonic CF-29 is doing fine here. (Dmesg below.)
Started with 4.8 in the beginning of 2011 and changed 
to following current on this machine when 5.4 came out. 
Pushed and pulled a few GB with current right now without panic.

HTH,
rru

OpenBSD 5.9-beta (GENERIC) #1495: Mon Jan 11 08:31:59 MST 2016
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Pentium(R) M processor 1.60GHz ("GenuineIntel" 686-class) 599 MHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,TM,PBE,NXE,EST,TM2,PERF
real mem  = 1600536576 (1526MB)
avail mem = 1557356544 (1485MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 08/03/06, BIOS32 rev. 0 @ 0xfd661, SMBIOS rev. 2.3 @ 
0xe5270 (46 entries)
bios0: vendor Phoenix Technologies K.K. version "V4.00L15" date 08/03/2006
bios0: Matsushita Electric Industrial Co.,Ltd. CF-29L3Q71BE
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC BOOT MCFG SSDT SSDT SSDT
acpi0: wakeup devices LID_(S4) RP01(S4) MODM(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 99MHz
ioapic0 at mainbus0: apid 1 pa 0xfec0, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 1
acpimcfg0 at acpi0 addr 0xe000, bus 0-255
bus 0
extent `pcimem' (0x0 - 0x), flags=0
 0x0 - 0x9
 0xc - 0xc
 0xe - 0x5fff
 0xfec0 - 0x
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (RP01)
acpiprt2 at acpi0: bus 6 (PCIB)
acpiec0 at acpi0
acpicpu0 at acpi0: !C3(100@185 io@0x1016), !C3(250@85 io@0x1015), !C2(500@1 
io@0x1014), C1(1000@1 halt), PSS
acpitz0 at acpi0: critical temperature is 106 degC
acpibtn0 at acpi0: LID_
acpibat0 at acpi0: BATA model "CF-VZSU29A" serial 0 type LION oem 
"Panasonic"
acpibat1 at acpi0: BATB not present
acpiac0 at acpi0: AC unit offline
acpibtn1 at acpi0: PWRB
acpivideo0 at acpi0: GFX0
bios0: ROM list: 0xc/0xf200! 0xe/0x1800! 0xe4000/0xc000!
cpu0: Enhanced SpeedStep 599 MHz: speeds: 1600, 1400, 1200, 1000, 800, 600 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82915GM Host" rev 0x04
inteldrm0 at pci0 dev 2 function 0 "Intel 82915GM Video" rev 0x04
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xc000, size 0x1000
inteldrm0: apic 1 int 16
inteldrm0: 1024x768
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 82915GM Video" rev 0x04 at pci0 dev 2 function 1 not configured
ppb0 at pci0 dev 28 function 0 "Intel 82801FB PCIE" rev 0x04: apic 1 int 17
pci1 at ppb0 bus 2
mskc0 at pci1 dev 0 function 0 "Marvell Yukon 88E8053" rev 0x19, Yukon-2 EC 
rev. A2 (0x1): apic 1 int 16
msk0 at mskc0 port A: address 00:0b:97:a1:c3:be
eephy0 at msk0 phy 0: 88E Gigabit PHY, rev. 2
uhci0 at pci0 dev 29 function 0 "Intel 82801FB USB" rev 0x04: apic 1 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801FB USB" rev 0x04: apic 1 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801FB USB" rev 0x04: apic 1 int 18
ehci0 at pci0 dev 29 function 7 "Intel 82801FB USB" rev 0x04: apic 1 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb1 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xd4
pci2 at ppb1 bus 6
cbb0 at pci2 dev 1 function 0 "Ricoh 5C476 CardBus" rev 0x8b: apic 1 int 20
cbb1 at pci2 dev 1 function 1 "Ricoh 5C476 CardBus" rev 0x8b: apic 1 int 21
sdhc0 at pci2 dev 1 function 2 "Ricoh 5C822 SD/MMC" rev 0x11: apic 1 int 19
sdmmc0 at sdhc0
iwi0 at pci2 dev 2 function 0 "Intel PRO/Wireless 2915ABG" rev 0x05: apic 1 int 
18, address 00:16:6f:89:07:f2
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 7 device 0 cacheline 0x0, lattimer 0x20
pcmcia0 at cardslot0
cardslot1 at cbb1 slot 1 flags 0
cardbus1 at cardslot1: bus 8 device 0 cacheline 0x0, lattimer 0x20
pcmcia1 at