refactor UDP handling in tcpdump

2018-07-03 Thread David Gwynne
i just wanted to make the udp payload printing line up nicely, but i noticed some issues and went a bit further. the biggest problem i noticed was that a lot of the udp printing code assumes that it is encapsulated in ipv4. this is not true, it could be ipv6, and some other parts give the

avoid vfprintf NULL errors in ldape.c log_debug()

2018-07-03 Thread Rob Pierce
Running the current ldapd regression tests result in the following (repeated) errors in my /var/log/messages: ... ldapd: vfprintf %s NULL in "current bind dn = %s " This is because regress/usr.sbin/ldapd/run-tests.pl is performing unnecessary unbinds in END { }. Though the regression test

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 05:38:18PM -0400, Rob Pierce wrote: > On Tue, Jul 03, 2018 at 09:25:06PM +0100, Stuart Henderson wrote: > > On 2018/07/03 22:17, Claudio Jeker wrote: > > > I have a hard time to understand why this is needed in snmpd. > > > For single char reads ber_readbuf(b, c, 1) and

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Rob Pierce
On Tue, Jul 03, 2018 at 09:25:06PM +0100, Stuart Henderson wrote: > On 2018/07/03 22:17, Claudio Jeker wrote: > > I have a hard time to understand why this is needed in snmpd. > > For single char reads ber_readbuf(b, c, 1) and ber_read(b, c, 1) should do > > exaclty the same. At least in the old

Re: realpath(3) on a dangling symlink

2018-07-03 Thread Stuart Henderson
On 2018/06/28 08:52, Martijn van Duren wrote: > - If realpath fails the content of resolved is undefined, so why waste > cycles setting it to ".". If anyone thinks we should return something > sensible I reckon we should make it an empty string. Not sure if it's important or not, but if someone

bgpd softreconf in optimisation

2018-07-03 Thread Claudio Jeker
There is no need to run against both input filters. path_update() and prefix_remove() are both smart enough to handle all cases (similar to a regular update). Should make reloads a bit faster. More precise - prefix_remove() of a non existing prefix is a NOP - path_update() does itself a

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Stuart Henderson
On 2018/07/03 22:17, Claudio Jeker wrote: > I have a hard time to understand why this is needed in snmpd. > For single char reads ber_readbuf(b, c, 1) and ber_read(b, c, 1) should do > exaclty the same. At least in the old code. I see that snmpd added br_offs > in a way that causes this breakage.

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Claudio Jeker
On Tue, Jul 03, 2018 at 03:45:49PM -0400, Rob Pierce wrote: > On Sat, Jun 30, 2018 at 02:04:16PM -0400, Rob Pierce wrote: > > I recently committed a piece of BER code synchronizing in the wrong > > direction > > (i.e. from the ldap instances to the snmpd instance). sthen@ noticed a break > > in

Re: call ber_read() from ber_getc() in ldap, ldapd, and ypldap

2018-07-03 Thread Rob Pierce
On Sat, Jun 30, 2018 at 02:04:16PM -0400, Rob Pierce wrote: > I recently committed a piece of BER code synchronizing in the wrong direction > (i.e. from the ldap instances to the snmpd instance). sthen@ noticed a break > in SNMPv3 authentication and reverted that part of the change. Thanks Stuart!

Re: vmctl: improve error message

2018-07-03 Thread Mike Larkin
On Tue, Jul 03, 2018 at 08:59:29AM -0600, Theo de Raadt wrote: > This incorrect codepath occurs in other places also. I think it > ends up using an EINVAL from some other operation. Quite a ways > earlier inside vmmaction(). Which is unrelated to the actual failure. > > The same problem is in

Re: ioctl(2) & fcntl(2) tweaks

2018-07-03 Thread Theo Buehler
On Tue, Jul 03, 2018 at 12:38:37PM +0200, Martin Pieuchot wrote: > The next important step towards removing the KERNEL_LOCK() from the > kernel is to be able to execute ioctl(2)s without it. > > The first area that can benefit from this is obviously the Network > Stack. tb@ and kn@ are working

Re: ioctl(2) & fcntl(2) tweaks

2018-07-03 Thread Theo de Raadt
> While here I'm also getting rid of M_IOCTLOPS, all other places where > an allocation is needed for a syscall are using M_TEMP. So less is > more. The reason for this malloc object typing is (a) an lookup optimization for KMEMSTATS, and (2) to catch certain types of bugs. It has also been

Re: vmctl: improve error message

2018-07-03 Thread Theo de Raadt
This incorrect codepath occurs in other places also. I think it ends up using an EINVAL from some other operation. Quite a ways earlier inside vmmaction(). Which is unrelated to the actual failure. The same problem is in vm_start_complete() pause_vm_complete() and unpause_vm_complete() use a

Re: teach tcpdump about gre-in-udp encapsulation

2018-07-03 Thread Alexander Bluhm
On Tue, Jul 03, 2018 at 12:51:26PM +1000, David Gwynne wrote: > this is the simplest diff i could make that adds gre in udp handling > to tcpdump. > > ok? OK bluhm@ > Index: print-udp.c > === > RCS file:

Re: style fixes for tcpdump udp code

2018-07-03 Thread Alexander Bluhm
On Tue, Jul 03, 2018 at 05:00:35PM +1000, David Gwynne wrote: > no functional change. ok? OK bluhm@ > Index: print-udp.c > === > RCS file: /cvs/src/usr.sbin/tcpdump/print-udp.c,v > retrieving revision 1.41 > diff -u -p -r1.41

Re: Use LIST_FOREACH construct instead of homebrew loop

2018-07-03 Thread Alexander Bluhm
On Tue, Jul 03, 2018 at 04:27:30PM +0800, Kevin Lo wrote: > Diff below replaces hand rolled code with LIST_FOREACH. ok? OK bluhm@ > Index: sys/dev/ic/smc83c170.c > === > RCS file: /cvs/src/sys/dev/ic/smc83c170.c,v > retrieving

ioctl(2) & fcntl(2) tweaks

2018-07-03 Thread Martin Pieuchot
The next important step towards removing the KERNEL_LOCK() from the kernel is to be able to execute ioctl(2)s without it. The first area that can benefit from this is obviously the Network Stack. tb@ and kn@ are working on this area so they'll soon need a way to test really test their diffs.

tag semantics: deletion of supporting package

2018-07-03 Thread Marc Espie
So, I'm oscillatting a bit. Basically, you've got a package A that defines a tag, e.g., in the PLIST: @define-tag f at-end %D/bin/f f normally, this gets %D/bin/f to run at the end of the installation. What happens if you delete A ? The current idea was to have @tag f also in A, before

0 bytes-long struct definitions

2018-07-03 Thread Martin Pieuchot
Our kernel contains multiple of such definitions that are generally a sign for dead code. Most of them are related to some DRM glue so I wouldn't touch them. But you might be interested by the others. $ ctfconv -d obj/bsd.gdb |grep "(0 bytes)" [282] STRUCT

vmctl: improve error message

2018-07-03 Thread Anton Lindqvist
Hi, Stopping a VM owned by root as a non-root user fails with the following error message: $ vmctl stop test vmctl: terminate vm command failed: Invalid argument I think favoring warnc() with the appropriate errno number passed along improves things. This of course is under the assumption

Use LIST_FOREACH construct instead of homebrew loop

2018-07-03 Thread Kevin Lo
Hi, Diff below replaces hand rolled code with LIST_FOREACH. ok? Index: sys/dev/ic/smc83c170.c === RCS file: /cvs/src/sys/dev/ic/smc83c170.c,v retrieving revision 1.27 diff -u -p -u -p -r1.27 smc83c170.c --- sys/dev/ic/smc83c170.c

Re: /etc/services lines for gre-in-udp

2018-07-03 Thread Sebastian Benoit
i think since we can tcpdump it now, we want this too ;) ok David Gwynne(da...@gwynne.id.au) on 2018.07.03 16:34:10 +1000: > On Tue, Jul 03, 2018 at 09:56:30AM +1000, David Gwynne wrote: > > RFC8086 and IANA say that the following ports are defined for gre > > in udp encapsulations. > > > > ok?

Re: readable usbdevs(8)

2018-07-03 Thread Mark Kettenis
> Date: Tue, 3 Jul 2018 09:35:09 +0200 > From: Martin Pieuchot > > Here's the next iteration on my work on usbdevs(8). It is now printing > the USB IDs by default with the expected Vendor:Device order. > > Additional information is printed on a second line. Port status are > still missing but

readable usbdevs(8)

2018-07-03 Thread Martin Pieuchot
Here's the next iteration on my work on usbdevs(8). It is now printing the USB IDs by default with the expected Vendor:Device order. Additional information is printed on a second line. Port status are still missing but are coming in the next diff. Examples: $ ./obj/usbdevs Controller

style fixes for tcpdump udp code

2018-07-03 Thread David Gwynne
no functional change. ok? Index: print-udp.c === RCS file: /cvs/src/usr.sbin/tcpdump/print-udp.c,v retrieving revision 1.41 diff -u -p -r1.41 print-udp.c --- print-udp.c 3 Jul 2018 06:56:52 - 1.41 +++ print-udp.c 3 Jul 2018

per-TDB & global IPsec counters

2018-07-03 Thread Martin Pieuchot
Diff below adds & exports per-TDB counters via ipsecctl(8) and adds & exports global IPsec counters via netstat(1). The goal of this diff is to introduce a new framework to improve monitoring & error reporting of IPsec traffic. Here's an example of "# ipsecctl -s sa -v": ipcomp tunnel from

Re: add a bunch of logitech webcam ids to usbdevs

2018-07-03 Thread Landry Breuil
On Mon, Jul 02, 2018 at 09:29:04PM +0200, Mark Kettenis wrote: > > Date: Mon, 2 Jul 2018 21:10:26 +0200 > > From: Landry Breuil > > > > ok ? > > Why? How do they show up right now? We typically only add USB IDs > for hardware that needs quirks or doesn't have a useful string > embedded in the

Re: /etc/services lines for gre-in-udp

2018-07-03 Thread David Gwynne
On Tue, Jul 03, 2018 at 09:56:30AM +1000, David Gwynne wrote: > RFC8086 and IANA say that the following ports are defined for gre > in udp encapsulations. > > ok? mpi@ points out i didnt actually add the diff. Index: services ===