snmpd flags

2015-01-09 Thread Martijn van Duren
Hello tech@, I saw @tedu's post here about the grep flags (http://marc.info/?l=openbsd-tech&m=142084440918276&w=2) and realised I saw something similar just last night in snmpd. And since the verbose level is overwritten in log_verbose() anyway remove that line as well. Index: snmpd.c ==

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Theo de Raadt
> On Fri, Jan 09, 2015 at 22:02, Theo de Raadt wrote: > >> There is something funny though. parse.y is checking host() for -1, > >> but the function never returns that. I think the return (0) is wrong, > >> and that's what should be changed. Or change parse.y to check for 0. > > > > Nope -- you gu

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Ted Unangst
On Fri, Jan 09, 2015 at 22:02, Theo de Raadt wrote: >> There is something funny though. parse.y is checking host() for -1, >> but the function never returns that. I think the return (0) is wrong, >> and that's what should be changed. Or change parse.y to check for 0. > > Nope -- you guys aren't te

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Theo de Raadt
> There is something funny though. parse.y is checking host() for -1, > but the function never returns that. I think the return (0) is wrong, > and that's what should be changed. Or change parse.y to check for 0. Nope -- you guys aren't testing your work.

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Ted Unangst
On Fri, Jan 09, 2015 at 19:58, Brent Cook wrote: > On Fri, Jan 9, 2015 at 7:40 PM, Theo de Raadt > wrote: >>>From: Brent Cook >>> >>>Match what parse.y and probably anything else would expect. >>> >>>Noted by AC on slashdot, but I think it's probably a bug. >> >> Nope! You did not test this. Th

tcpdrop usage()

2015-01-09 Thread Lawrence Teo
This diff replaces "goto fail" in tcpdrop with a proper usage() to be consistent with other programs in the tree. ok? Index: tcpdrop.c === RCS file: /cvs/src/usr.sbin/tcpdrop/tcpdrop.c,v retrieving revision 1.15 diff -u -p -r1.15 tc

net80211: fix excessive newassoc calls in IBSS mode

2015-01-09 Thread Stefan Sperling
A wifi driver's newassoc routine gets invoked excessively often in IBSS mode. It runs whenever a probe response is received. Showing output from a patched newassoc routine which prints "new node ": Jan 10 02:01:09 jim /bsd: new node 00:24:fe:44:07:bb Jan 10 02:01:09 jim /bsd: new node 88:25:2c:bf:

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Brent Cook
On Fri, Jan 9, 2015 at 7:40 PM, Theo de Raadt wrote: >>From: Brent Cook >> >>Match what parse.y and probably anything else would expect. >> >>Noted by AC on slashdot, but I think it's probably a bug. > > Nope! You did not test this. This breaks it. You are completely right. I did not test this

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Theo de Raadt
>From: Brent Cook > >Match what parse.y and probably anything else would expect. > >Noted by AC on slashdot, but I think it's probably a bug. Nope! You did not test this. This breaks it.

ntpd -s failure logging level

2015-01-09 Thread Paul B. Henson
First off, thanks to everybody involved in releasing a new portable openntpd (and of course developing native openbsd ntpd), it is much appreciated. One of the changes I had made to the old portable openntpd in the gentoo linux specific patchset was to change the log level for when ntpd fails to s

Re: grep flags

2015-01-09 Thread Todd C. Miller
On Fri, 09 Jan 2015 17:59:45 -0500, Ted Unangst wrote: > 1. They're flags, not counters. Set to one instead of incrementing. > 2. The G flag is useless and never checked. Remove it. Sure. OK millert@ - todd

Re: better implicit warnings in kernel

2015-01-09 Thread Mark Kettenis
> Date: Thu, 08 Jan 2015 19:00:30 -0500 > From: Ted Unangst > > I think -Wimplicit-function-declaration is a better fit for the > desired warning here. We don't want implicit function declarations. > This is the same warning we recently added to userland in a few places. > > -Wstrict-prototypes

grep flags

2015-01-09 Thread Ted Unangst
1. They're flags, not counters. Set to one instead of incrementing. 2. The G flag is useless and never checked. Remove it. Index: grep.c === RCS file: /cvs/src/usr.bin/grep/grep.c,v retrieving revision 1.48 diff -u -p -r1.48 grep.c --

Re: ntpd: call reallocarray with the sizeof the thing we're actually allocating

2015-01-09 Thread Ted Unangst
On Fri, Jan 09, 2015 at 15:45, Brent Cook wrote: > From: Brent Cook > > Yeah yeah, a pointer is a pointer (except when it isn't :). I think this > looks nicer, since idx2peer is really the thing we're allocating to. what about the bzero ten lines later? I think the sizeof(*idx2peer) idiom is al

Re: ntpd: fix some memory leaks in dns handling

2015-01-09 Thread Todd C. Miller
On Fri, 09 Jan 2015 15:45:51 -0600, Brent Cook wrote: > - If imsg_add fails, it frees buf. But, so does imsg_close. Punt for >now and just die if imsg_add fails (maybe this should be handled more >nicely?) I think it makes sense to treat imsg_add() failure the same as imsg_create returni

Re: ntpd: don't dereference NULL p->addr - fixed

2015-01-09 Thread Todd C. Miller
On Fri, 09 Jan 2015 16:03:36 -0600, Brent Cook wrote: > Here is a revised version that doesn't break initial queries, > and puts the check in the correct place I think. I think this is now correct. OK millert@ - todd

Re: ntpd: call reallocarray with the sizeof the thing we're actually allocating

2015-01-09 Thread Todd C. Miller
On Fri, 09 Jan 2015 15:45:50 -0600, Brent Cook wrote: > Yeah yeah, a pointer is a pointer (except when it isn't :). I think this > looks nicer, since idx2peer is really the thing we're allocating to. OK millert@ - todd

Re: ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Todd C. Miller
On Fri, 09 Jan 2015 15:45:52 -0600, Brent Cook wrote: > From: Brent Cook > > Match what parse.y and probably anything else would expect. > > Noted by AC on slashdot, but I think it's probably a bug. OK millert@. - todd

Re: probing for device - question

2015-01-09 Thread sven falempin
On Wed, Jan 7, 2015 at 5:49 PM, Mark Kettenis wrote: >> From: sven falempin >> Date: Wed, 7 Jan 2015 13:59:12 -0500 >> >> Dear Tech, >> >> As you may know I am activating the watchdog function of a chip in >> my mainboard. I encouter a little problem as the current is using a >> undersize 8bit I

Re: ntpd: don't dereference NULL p->addr - fixed

2015-01-09 Thread Brent Cook
Here is a revised version that doesn't break initial queries, and puts the check in the correct place I think. ok? Index: client.c === RCS file: /cvs/src/usr.sbin/ntpd/client.c,v retrieving revision 1.96 diff -u -p -u -p -r1.96 clien

Re: ntpd: don't dereference NULL p->addr

2015-01-09 Thread Brent Cook
On Fri, Jan 9, 2015 at 3:45 PM, Brent Cook wrote: > From: Brent Cook > > client_nextaddr() dereferences p->addr looking for a loop. Don't call it > if p->addr is NULL. Maybe the NULL check belongs directly in > client_nextaddr()? If not, is this ok? Bah, I screwed this one up - please ignore it.

ntpd: fix some memory leaks in dns handling

2015-01-09 Thread Brent Cook
From: Brent Cook These are all sort of related, so they're merged into one. - Nothing seems to free the result of host_dns(), so add host_dns_free() and call after each query. - If imsg_add fails, it frees buf. But, so does imsg_close. Punt for now and just die if imsg_add fails (maybe t

ntpd: don't dereference NULL p->addr

2015-01-09 Thread Brent Cook
From: Brent Cook client_nextaddr() dereferences p->addr looking for a loop. Don't call it if p->addr is NULL. Maybe the NULL check belongs directly in client_nextaddr()? If not, is this ok? --- src/usr.sbin/ntpd/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/us

ntpd: call reallocarray with the sizeof the thing we're actually allocating

2015-01-09 Thread Brent Cook
From: Brent Cook Yeah yeah, a pointer is a pointer (except when it isn't :). I think this looks nicer, since idx2peer is really the thing we're allocating to. ok? --- src/usr.sbin/ntpd/ntp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr.sbin/ntpd/ntp.c b/src/usr.sb

ntpd: return -1 on host() failure, not 1

2015-01-09 Thread Brent Cook
From: Brent Cook Match what parse.y and probably anything else would expect. Noted by AC on slashdot, but I think it's probably a bug. ok? --- src/usr.sbin/ntpd/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/usr.sbin/ntpd/config.c b/src/usr.sbin/ntpd/config.c

Re: ifconfig rssi printing should be signed

2015-01-09 Thread Stuart Henderson
On 2015/01/09 20:48, Stefan Sperling wrote: > On Fri, Jan 09, 2015 at 03:52:44PM +, Stuart Henderson wrote: > > This has been bugging me for ages but I forgot about it for quite a > > while (mostly because iwn scanning was broken on my laptop for ages). > > RSSI is a signed value, but various p

Re: ifconfig rssi printing should be signed

2015-01-09 Thread Stefan Sperling
On Fri, Jan 09, 2015 at 03:52:44PM +, Stuart Henderson wrote: > This has been bugging me for ages but I forgot about it for quite a > while (mostly because iwn scanning was broken on my laptop for ages). > RSSI is a signed value, but various places are storing it unsigned, > in particular ifcon

Re: Fewer malloc() & memcpy() in USB land

2015-01-09 Thread Martin Pieuchot
On 09/01/15(Fri) 12:36, David Higgs wrote: > On Fri, Jan 9, 2015 at 9:00 AM, Martin Pieuchot > wrote: > > As pointed out by David Higgs, uhidev report functions do a lot of > > memory allocations and copies between buffers. This is not uncommon > > in USB land due to way DMA buffers are handled.

Re: Fewer malloc() & memcpy() in USB land

2015-01-09 Thread David Higgs
On Fri, Jan 9, 2015 at 9:00 AM, Martin Pieuchot wrote: > As pointed out by David Higgs, uhidev report functions do a lot of > memory allocations and copies between buffers. This is not uncommon > in USB land due to way DMA buffers are handled. > > One way to reduce the number of copies is to subm

Loosing characters on Dell R420 Drac console

2015-01-09 Thread Matthieu Herrb
Hi, I've an issue on a Dell R420 server running OpenBSD. I tried both 5.6-stable and -current on it with the same behavior. I'm using a DRAC 7 Enterprise remote access card to access the virtual console through their Java web start software. I'm running the latest Drac software for this platform

Re: reduce spamd memory usage by 3/4

2015-01-09 Thread Todd C. Miller
I'd especially appreciate feedback from large sites using spamd to protect SMTP. I've been running this version of spamd on my own mail server and the OpenBSD mailing list server so I'm quite confident in it, but more data points are always good. - todd

Re: reduce spamd memory usage by 3/4

2015-01-09 Thread Bob Beck
Oh I like this Todd.. nice. On Fri, Jan 9, 2015 at 9:19 AM, Todd C. Miller wrote: > spamd stores the IP addr/mask in a union that can hold either ipv4 > or ipv6. This simplifies the data structures but means that ipv4 > addrs/masks take up 4x as much space as they need to. This can > be an issu

reduce spamd memory usage by 3/4

2015-01-09 Thread Todd C. Miller
spamd stores the IP addr/mask in a union that can hold either ipv4 or ipv6. This simplifies the data structures but means that ipv4 addrs/masks take up 4x as much space as they need to. This can be an issue with very large blacklists, like we use on the mailing list server. It also means spamd c

slightly easier to read strlcpy/strlcat

2015-01-09 Thread Todd C. Miller
I've tabled the other strlcpy/strlcat version because it required that the strings be traversed twice. However, these files were originally written with register variables and can be simplified slightly now that we let the compiler decide what to put in registers. The changes are mostly cosmetic.

ifconfig rssi printing should be signed

2015-01-09 Thread Stuart Henderson
This has been bugging me for ages but I forgot about it for quite a while (mostly because iwn scanning was broken on my laptop for ages). RSSI is a signed value, but various places are storing it unsigned, in particular ifconfig prints it that way (so the displayed strength is unfeasibly large; rea

Fewer malloc() & memcpy() in USB land

2015-01-09 Thread Martin Pieuchot
As pointed out by David Higgs, uhidev report functions do a lot of memory allocations and copies between buffers. This is not uncommon in USB land due to way DMA buffers are handled. One way to reduce the number of copies is to submit a transfer with the USBD_NO_COPY flag. Without it the kernel

Re: Jan's crontab.5 diff

2015-01-09 Thread sven falempin
Same size more precise ? - If MAILTO is defined and non-empty, mail is sent to the user + If MAILTO is defined and non-empty, Output is mailed to the user so named. If MAILTO is defined but empty (MAILTO = ""), no - mail will be sent. Otherwise mail is sent to the owner of + output will be m

Re: freetype-2.5.5

2015-01-09 Thread David Coppa
On Wed, Jan 7, 2015 at 9:54 AM, David Coppa wrote: > > An update to freetype-2.5.5. > > They were faster this time! > > Btw, it's a bugfixing update so I think we do not need another bulk > build... > > I didn't see significant API/ABI changes and abi-compliance-checker > also reports 2.5.4_to_2.5

ftp-proxy man page: mention TLS caveat

2015-01-09 Thread Stefan Sperling
I found out the hard way that of course using ftp-proxy makes implicit TLS impossible for FTP clients. I'd like to note this under CAVEATS. While here, chrooting and dropping privs is a feature, not a bug, so move that paragraph up. OK? Index: ftp-proxy.8

Re: Jan's crontab.5 diff

2015-01-09 Thread Jason McIntyre
On Fri, Jan 09, 2015 at 01:14:23AM +0100, Jan Stary wrote: > On Jan 08 22:45:59, j...@kerhand.co.uk wrote: > > On Thu, Jan 08, 2015 at 10:21:03PM +, Craig Skinner wrote: > > > http://marc.info/?l=openbsd-misc&m=142031621606691&w=2 > > > > > > > i don;t see the discrepancy. crontab(5) explains