Re: Rename rt_ifa_addloop(9)

2014-11-24 Thread Mike Belopuhov
On 20 November 2014 at 15:37, Martin Pieuchot mpieuc...@nolizard.org wrote: When I decided to use in6_ifaddloop() for IPv4 I barely though about the name of the function. Recently mikeb@ told me that the name is confusing, especially because I'm trying to turn the loopback hack into local

Re: Make every interface with a watchdog register it's own timeout

2014-11-24 Thread Mike Belopuhov
On Sun, Nov 23, 2014 at 13:39 +0100, Claudio Jeker wrote: On Sun, Nov 23, 2014 at 02:10:24AM +0100, Mike Belopuhov wrote: Hi, This removes the system wide if_slowtimo timeout and lets every interface with a valid if_watchdog method register it's own. The rational is to get rid of the

patch: correct double-free in dc(1)

2014-11-24 Thread Sébastien Marie
Hi, Starting to play with afl-fuzz, I test it with dc(1), and it found a Bus error. Basically: $ echo '1 2:x1Lx1:x1:x' | dc Bus error (core dumped) I traced the bug, and the code before do a double-free (resulting the Bus error). Thanks to malloc(3) junk :) The problem is a lack of

Re: Make every interface with a watchdog register it's own timeout

2014-11-24 Thread Mike Belopuhov
On Sun, Nov 23, 2014 at 12:06 +0100, Martin Pieuchot wrote: On 23/11/14(Sun) 02:10, Mike Belopuhov wrote: Hi, This removes the system wide if_slowtimo timeout and lets every interface with a valid if_watchdog method register it's own. The rational is to get rid of the ifnet loop in the

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Otto Moerbeek
On Mon, Nov 24, 2014 at 01:38:40PM +0100, S??bastien Marie wrote: Hi, Starting to play with afl-fuzz, I test it with dc(1), and it found a Bus error. Basically: $ echo '1 2:x1Lx1:x1:x' | dc Bus error (core dumped) I traced the bug, and the code before do a double-free (resulting the

Mail: remove undocumented -T flag

2014-11-24 Thread Todd C. Miller
The -T flag just creates a temporary file for use with netnews that contains the article ids of messages that have been read or deleted. This is obsolete and should just be removed... - todd Index: usr.bin/mail/glob.h === RCS file:

Kill if_lladdr

2014-11-24 Thread Martin Pieuchot
This field is really only used by enc(4) in order to have an ifa to attach the encap routes to. Diff below adds an struct ifaddr to this driver and kill if_lladdr. There's one place where if_lladdr was temporarily used, in ifa_ifwithroute(). But the destination of a route is cannot be of type

Re: ip_input() refactoring

2014-11-24 Thread Martin Pieuchot
On 13/11/14(Thu) 15:42, Martin Pieuchot wrote: In order to do *only one* route lookup without using a global variable (yes, I'm looking at you netinet6) and without doing too much spaghetti, here's a refactoring of ip_input(). It basically merges in_ouraddr() into ip_input(), but some

patch: fix segfault on revision + empty file

2014-11-24 Thread Tobias Stoeckmann
Hi, patch will fail with a segmentation fault in plan a if it encounters a diff with a revision (Prereq line) when the input file is empty. i_womp will be set to NULL to avoid mmapping 0 bytes, but later on it will be scanned for the supplied revision. The fix is simple: avoid scanning i_womp

Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
Hi, I've been trying to fix a bug in tcpdump but the rottenness of the current code base with it's horrendous APIs is just getting in the way. What if we trimmed it a bit, say killed all those pesky 'register' values, kill protocols that we cannot really test (appletalk, fddi, etc.), kill

Re: Trimming tcpdump a bit

2014-11-24 Thread Theo de Raadt
On 2014/11/24 16:42, Mike Belopuhov wrote: Hi, I've been trying to fix a bug in tcpdump but the rottenness of the current code base with it's horrendous APIs is just getting in the way. What if we trimmed it a bit, say killed all those pesky 'register' values, kill protocols that we

Re: patch: correct double-free in dc(1)

2014-11-24 Thread Otto Moerbeek
On Mon, Nov 24, 2014 at 01:38:40PM +0100, S??bastien Marie wrote: Hi, Starting to play with afl-fuzz, I test it with dc(1), and it found a Bus error. Basically: $ echo '1 2:x1Lx1:x1:x' | dc Bus error (core dumped) I traced the bug, and the code before do a double-free (resulting the

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 17:20, Mike Belopuhov m...@belopuhov.com wrote: On 24 November 2014 at 16:42, Mike Belopuhov m...@belopuhov.com wrote: Hi, I've been trying to fix a bug in tcpdump but the rottenness of the current code base with it's horrendous APIs is just getting in the way. What

Re: Trimming tcpdump a bit

2014-11-24 Thread Mike Belopuhov
On 24 November 2014 at 16:42, Mike Belopuhov m...@belopuhov.com wrote: Hi, I've been trying to fix a bug in tcpdump but the rottenness of the current code base with it's horrendous APIs is just getting in the way. What if we trimmed it a bit, say killed all those pesky 'register' values,

paste: release file descriptors earlier

2014-11-24 Thread Tobias Stoeckmann
Hi, the function parallel() should release file descriptors just like sequential() does: If we reach EOF, close it -- except we were reading stdin. Tobias Index: paste.c === RCS file: /cvs/src/usr.bin/paste/paste.c,v retrieving

tcpdump: Ethernet header is not dumped with -xX if IP header is unaligned

2014-11-24 Thread Mike Belopuhov
Hi, IP header is not always aligned since bpf copies out the mbuf chain into the contigous buffer provided by the userland. I've seen this with large packet sizes on VLANs. ip_print will then copy the packet but the Ethernet header into the internal buffer so that it can cast it to the IP

Re: Mail: fix handling of -f flag

2014-11-24 Thread Jason McIntyre
On Mon, Nov 24, 2014 at 09:56:33AM -0700, Todd C. Miller wrote: The handling of the argument to the -f option is a hack. Currently, this works: $ mail -f mbox2 But this does not: $ mail -fmbox2 Instead of fooling around with argv behind getopt()'s back we can just treat

Re: patch: make ed's 'l' command more posixly correct

2014-11-24 Thread Theo de Raadt
Seems like, Theo was ok with this over in misc@. First patch (utterly trivial) am I doing this right? I wasn't ok with your change at all. Your process seems to be I don't understand the problem, so here is a diff --- /usr/src/bin/ed/io.c Wed Nov 12 08:50:07 2014 +++

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Nicolas Bedos
Tobias Stoeckmann wrote: I would recommend using fgetln for the actual line parsing. Then this kinda fragile code can be avoided (fragile: fgets and its users have a hard time to properly handle '\0' chars inside a file). Thank you for the advice. Here is an updated diff. It does indeed look

Re: tcpdump: Ethernet header is not dumped with -xX if IP header is unaligned

2014-11-24 Thread Mike Belopuhov
On Nov 24, 2014 7:10 PM, Mike Belopuhov m...@belopuhov.com wrote: Hi, IP header is not always aligned since bpf copies out the mbuf chain into the contigous buffer provided by the userland. I've seen this with large packet sizes on VLANs. ip_print will then copy the packet but the

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Bertrand Janin
Florian Obser wrote : On Sun, Nov 23, 2014 at 08:15:47PM -0500, Bertrand Janin wrote: Hi, This patch updates server_abort_http() to only send the body of default http error if the method is not HEAD. I first noticed that with curl -v -I which complains about the excess data: *

Re: locate(1): ignore paths longer than MAXPATHLEN

2014-11-24 Thread Tobias Stoeckmann
On Mon, Nov 24, 2014 at 08:37:47PM +0100, Nicolas Bedos wrote: In locate.code.c 'mbuf' is never free()d: it is only allocated for the last line of input and after processing this line the program ends. I hope it is ok. I would free() it nontheless outside the while loop. For the sake of

Re: httpd: don't send error body with HEAD method

2014-11-24 Thread Philip Guenther
On Mon, Nov 24, 2014 at 11:24 AM, Florian Obser flor...@openbsd.org wrote: ... Since we are probably not supposed to send a Content-Type header I think it makes sense to duplicate the httpmsg generating code in this case; If a GET of that resource would have a Content-Type, then the HEAD of it

Re: crypt_newhash

2014-11-24 Thread Ted Unangst
On Sun, Nov 23, 2014 at 01:42, Jonas 'Sortie' Termansen wrote: This can be easily solved if crypt_checkpass checks the hash doesn't start with '$' and then calls the utility crypt_hashpass directly (will need to be visible from outside its current translation unit), and storing the temporary