openbsd
6 years agoBump the read sockbuf of the routing socket to 2MB, may help reduce some of
claudio [Thu, 8 Feb 2018 00:16:54 +0000 (00:16 +0000)]
Bump the read sockbuf of the routing socket to 2MB, may help reduce some of
the desync cases. OK benno@

6 years agoBump the read sockbuf of the routing socket to 2MB, may help reduce some of
claudio [Thu, 8 Feb 2018 00:16:18 +0000 (00:16 +0000)]
Bump the read sockbuf of the routing socket to 2MB, may help reduce some of
the desync cases. OK benno@

6 years agorename var 's' -> 'fd' to ease finding it in a long function
procter [Wed, 7 Feb 2018 23:04:50 +0000 (23:04 +0000)]
rename var 's' -> 'fd' to ease finding it in a long function
ok tb@ deraadt@

6 years agoeliminate close()/fclose() dance.
procter [Wed, 7 Feb 2018 23:01:09 +0000 (23:01 +0000)]
eliminate close()/fclose() dance.
ok tb@ deraadt@

6 years agossh_free checks for and handles NULL args, remove NULL checks from remaining
dtucker [Wed, 7 Feb 2018 22:52:45 +0000 (22:52 +0000)]
ssh_free checks for and handles NULL args, remove NULL checks from remaining
callers.  ok djm@

6 years agocomment change only. ok bluhm@
procter [Wed, 7 Feb 2018 22:46:11 +0000 (22:46 +0000)]
comment change only. ok bluhm@

6 years agoadd SIOCSETKALIVE to the list of ioctls that need root and NET_LOCK
dlg [Wed, 7 Feb 2018 22:36:54 +0000 (22:36 +0000)]
add SIOCSETKALIVE to the list of ioctls that need root and NET_LOCK

6 years agoSporadically the network over gem(4) interface hang on sparc64 and
bluhm [Wed, 7 Feb 2018 22:35:14 +0000 (22:35 +0000)]
Sporadically the network over gem(4) interface hang on sparc64 and
macppc.  Receiving packets stopped, ifconfig down/up made it work
again.
In the tick timeout handler refill the receive ring if it is empty.
The logic is taken from hme(4).  Also protect the register access
and ifp counters with splnet().
In gem_rx_watchdog() is a workaround for a hardware bug.  It resets
the hardware when there is no progress.  If the fifo pointers
advanced a bit, it got stuck anyway.  So restart the receive watchdog
timeout in that case.
OK mpi@

6 years agoupdate the gre driver.
dlg [Wed, 7 Feb 2018 22:30:59 +0000 (22:30 +0000)]
update the gre driver.

the main new feature is gre keys, supported by the vnetid ioctls.
this also adds support for gre over ipv6, the use of hfsc, and
allows tx mitigation in the future.

this diff removes keepalive support, but i promised claudio@ and
patrick@ i would put it back after this goes in.

ok claudio@

6 years agodcoppa@ and bluhm@ noted that i accidentally removed POOL_DEBUG
dlg [Wed, 7 Feb 2018 22:10:17 +0000 (22:10 +0000)]
dcoppa@ and bluhm@ noted that i accidentally removed POOL_DEBUG

put it back.

6 years agoOutsource setting the backplane window into a specific function so it
patrick [Wed, 7 Feb 2018 22:08:24 +0000 (22:08 +0000)]
Outsource setting the backplane window into a specific function so it
can be called and reused in different places.

6 years agoMove parsing the BCDC header on RX into a protocol specific RX
patrick [Wed, 7 Feb 2018 22:02:48 +0000 (22:02 +0000)]
Move parsing the BCDC header on RX into a protocol specific RX
function so it can be shared with the SDIO attachment driver.

6 years agoMove parsing the BCDC header on RX into a protocol specific RX
patrick [Wed, 7 Feb 2018 22:01:04 +0000 (22:01 +0000)]
Move parsing the BCDC header on RX into a protocol specific RX
function so it can be shared with the SDIO attachment driver.

6 years agoMove SDIO bus and protocol definitions from the shared header
patrick [Wed, 7 Feb 2018 21:44:09 +0000 (21:44 +0000)]
Move SDIO bus and protocol definitions from the shared header
into one header specific to the SDIO attachment driver.  Also
add more register and protocol definitions to it.

6 years agoAdd helper to find out if the chip supports Save/Restore. Will be used
patrick [Wed, 7 Feb 2018 21:36:34 +0000 (21:36 +0000)]
Add helper to find out if the chip supports Save/Restore.  Will be used
in the SDIO bus glue.

6 years agothe SETUIDSCRIPTS define is no longer needed since the code was unifdef
tedu [Wed, 7 Feb 2018 20:31:57 +0000 (20:31 +0000)]
the SETUIDSCRIPTS define is no longer needed since the code was unifdef
a few years ago. spotted by tb.

6 years agoIn man(7) and cat pages, cut off excessive one line descriptions.
schwarze [Wed, 7 Feb 2018 20:31:32 +0000 (20:31 +0000)]
In man(7) and cat pages, cut off excessive one line descriptions.
An extreme example of how rogue files could mess up apropos(1) output
was reported by bentley@: qwtlicense(3) in the x11/qwt port.

6 years agoslightly reduce the difficulty of the adventure game that is reading
tedu [Wed, 7 Feb 2018 20:22:23 +0000 (20:22 +0000)]
slightly reduce the difficulty of the adventure game that is reading
the battlestar code by reformatting a few lines.
special request from mlarkin so he'll go back to fixing meltdown.

6 years agoFix the mandoc_strndup() utility function. All existing callers seem
schwarze [Wed, 7 Feb 2018 20:04:33 +0000 (20:04 +0000)]
Fix the mandoc_strndup() utility function.  All existing callers seem
safe so far, but implementing it with an unchecked memcpy(3) is just
wrong and quite dangerous.

6 years agofix wrong date
schwarze [Wed, 7 Feb 2018 19:58:28 +0000 (19:58 +0000)]
fix wrong date

6 years agosync with libc malloc: use consistent style for for loop in unmap(),
otto [Wed, 7 Feb 2018 18:59:20 +0000 (18:59 +0000)]
sync with libc malloc: use consistent style for for loop in unmap(),
no functional change

6 years agouse consistent style for for loop in unmap(), no functional change
otto [Wed, 7 Feb 2018 18:58:30 +0000 (18:58 +0000)]
use consistent style for for loop in unmap(), no functional change

6 years agoReporting the PXE boot interface we identified is independent of setting
naddy [Wed, 7 Feb 2018 18:42:38 +0000 (18:42 +0000)]
Reporting the PXE boot interface we identified is independent of setting
the boot device.  We do the latter only for NFSCLIENT, but always the former.
While here, modernize the interface matching loop.
ok deraadt@

6 years agoMarkup SIGHUP.
anton [Wed, 7 Feb 2018 17:15:48 +0000 (17:15 +0000)]
Markup SIGHUP.

6 years agoprepare for session files
espie [Wed, 7 Feb 2018 11:38:38 +0000 (11:38 +0000)]
prepare for session files

6 years agoUnbreak carp(4) MAC check in bridge_process().
mpi [Wed, 7 Feb 2018 11:30:01 +0000 (11:30 +0000)]
Unbreak carp(4) MAC check in bridge_process().

Introduce bridge_ourether() and move carp(4)-specific SRPL code inside
carp_ourether().

ok bluhm@

6 years agoprepare for session saving by separating the pkgfetch code.
espie [Wed, 7 Feb 2018 11:22:39 +0000 (11:22 +0000)]
prepare for session saving by separating the pkgfetch code.

6 years agoRestore a check before BN_free() that needs to exist and write it such that
jsing [Wed, 7 Feb 2018 08:57:25 +0000 (08:57 +0000)]
Restore a check before BN_free() that needs to exist and write it such that
the intent is more obvious.

6 years agomake some wording better.
dlg [Wed, 7 Feb 2018 08:45:17 +0000 (08:45 +0000)]
make some wording better.

from jmc@

6 years agotweak previous;
jmc [Wed, 7 Feb 2018 07:06:53 +0000 (07:06 +0000)]
tweak previous;

6 years agoshorten the output for gre keys.
dlg [Wed, 7 Feb 2018 06:26:14 +0000 (06:26 +0000)]
shorten the output for gre keys.

6 years agoUse M_WAITOK to show we don't need to check for NULL.
krw [Wed, 7 Feb 2018 06:19:54 +0000 (06:19 +0000)]
Use M_WAITOK to show we don't need to check for NULL.

ok deraadt@

6 years agoUse duid_format() instead of rolling one locally.
krw [Wed, 7 Feb 2018 06:16:08 +0000 (06:16 +0000)]
Use duid_format() instead of rolling one locally.

ok jsing@ tb@

6 years agolook ma, henning forgot to PF_LOCK/_UNLOCK in the new ioctls, ok procter
henning [Wed, 7 Feb 2018 06:11:43 +0000 (06:11 +0000)]
look ma, henning forgot to PF_LOCK/_UNLOCK in the new ioctls, ok procter

6 years agodont return ENETRESET from SIOCSIFFLAGS, it wont't be handled properly
dlg [Wed, 7 Feb 2018 06:02:01 +0000 (06:02 +0000)]
dont return ENETRESET from SIOCSIFFLAGS, it wont't be handled properly

6 years agotake the interface down if it is being destroyed.
dlg [Wed, 7 Feb 2018 05:59:00 +0000 (05:59 +0000)]
take the interface down if it is being destroyed.

6 years agoNuke some more free NULL guards.
jsing [Wed, 7 Feb 2018 05:49:36 +0000 (05:49 +0000)]
Nuke some more free NULL guards.

6 years agoprovide counters for # of synfloods detected, # of syncookies sent,
henning [Wed, 7 Feb 2018 05:48:47 +0000 (05:48 +0000)]
provide counters for # of synfloods detected, # of syncookies sent,
# of syncookies successfuly validated, ok phessler

6 years agoIndent labels with a single space so that diff prototypes are more useful.
jsing [Wed, 7 Feb 2018 05:47:55 +0000 (05:47 +0000)]
Indent labels with a single space so that diff prototypes are more useful.

6 years agoConvert some explicit_bzero()/free() calls to freezero().
jsing [Wed, 7 Feb 2018 05:17:56 +0000 (05:17 +0000)]
Convert some explicit_bzero()/free() calls to freezero().

ok deraadt@ dtucker@

6 years agoRemove some #ifdef notyet code from OpenSSL 0.9.8 days.
jsing [Wed, 7 Feb 2018 05:15:49 +0000 (05:15 +0000)]
Remove some #ifdef notyet code from OpenSSL 0.9.8 days.

These functions have never appeared in OpenSSL and are likely never to do
so.

"kill it with fire" djm@

6 years agolowercase doas ee cummings style
tedu [Wed, 7 Feb 2018 05:13:57 +0000 (05:13 +0000)]
lowercase doas ee cummings style

6 years agoAdd more free functions for NULL checks.
jsing [Wed, 7 Feb 2018 05:07:39 +0000 (05:07 +0000)]
Add more free functions for NULL checks.

6 years agonot necessarily the same name, but the indicated name
tedu [Wed, 7 Feb 2018 05:05:46 +0000 (05:05 +0000)]
not necessarily the same name, but the indicated name

6 years agoRemove guards around *_free() calls since these functions handle NULL.
jsing [Wed, 7 Feb 2018 04:57:06 +0000 (04:57 +0000)]
Remove guards around *_free() calls since these functions handle NULL.

6 years agoRemove guards around *_free() calls since these functions handle NULL.
jsing [Wed, 7 Feb 2018 04:25:19 +0000 (04:25 +0000)]
Remove guards around *_free() calls since these functions handle NULL.

6 years agoclarify a bit about config
tedu [Wed, 7 Feb 2018 04:23:04 +0000 (04:23 +0000)]
clarify a bit about config

6 years agoNAME_MAX is the length of the thing between / / in a path *without*
florian [Wed, 7 Feb 2018 03:28:05 +0000 (03:28 +0000)]
NAME_MAX is the length of the thing between / / in a path *without*
the terminating NUL.
Do not use it for a "small string" or a "probably short path". Replace
it with new defines or PATH_MAX.
It also makes the life easier for people auditing the tree for real
usage of NAME_MAX.
OK deraadt, benno

6 years agoAdd more functions (based on those used in OpenSSH) to the free NULL test.
jsing [Wed, 7 Feb 2018 02:13:42 +0000 (02:13 +0000)]
Add more functions (based on those used in OpenSSH) to the free NULL test.

6 years agoRemove all guards for calls to OpenSSL free functions - all of these
jsing [Wed, 7 Feb 2018 02:06:50 +0000 (02:06 +0000)]
Remove all guards for calls to OpenSSL free functions - all of these
functions handle NULL, from at least OpenSSL 1.0.1g onwards.

Prompted by dtucker@ asking about guards for RSA_free(), when looking at
openssh-portable pr#84 on github.

ok deraadt@ dtucker@

6 years agoremove mobileip(4) tendrils
dlg [Wed, 7 Feb 2018 01:52:15 +0000 (01:52 +0000)]
remove mobileip(4) tendrils

6 years agounbreak strict alignment archs by using SIPHASH_KEY for siphash
dlg [Wed, 7 Feb 2018 01:50:48 +0000 (01:50 +0000)]
unbreak strict alignment archs by using SIPHASH_KEY for siphash
keys, not uint8_t array.

found by sparc64.

probably ok henning@, but he's at coffee

6 years agosplit mobileip(4) out from the gre(4) driver.
dlg [Wed, 7 Feb 2018 01:09:57 +0000 (01:09 +0000)]
split mobileip(4) out from the gre(4) driver.

having mobileip in gre makes it hard to cut gre up. the current mobileip
code is also broken, so this is def and improvement. it also makes it
easy to disable and remove mobileip in the future.

ok claudio@ henning@

6 years agoKeep track of the last proposal used to configure the interface and
krw [Wed, 7 Feb 2018 01:03:10 +0000 (01:03 +0000)]
Keep track of the last proposal used to configure the interface and
compare that to the offered proposal to determine if there are any
changes to configure. Simpler, and fixes issue where using a recorded
lease meant the interface was continually being configured with the
same information.

6 years agoremove the magic dns port hijacking feature. it's complicated and
tedu [Wed, 7 Feb 2018 01:02:46 +0000 (01:02 +0000)]
remove the magic dns port hijacking feature. it's complicated and
brittle, and never quite made the next step to being useful.

6 years agoRestore the old behavior when a port number without a host name is
bluhm [Wed, 7 Feb 2018 00:52:05 +0000 (00:52 +0000)]
Restore the old behavior when a port number without a host name is
passed to BIO_get_accept_socket().  This is part of the API and it
fixes "openssl ocsp -port 12345" in server mode.
from markus@; OK jsing@ beck@

6 years agoHistorically TCP timeouts were implemented with pr_slowtimo and
bluhm [Wed, 7 Feb 2018 00:31:10 +0000 (00:31 +0000)]
Historically TCP timeouts were implemented with pr_slowtimo and
pr_fasttimo.  That is the reason why we have two timeout mechanisms
with complicated ticks calculation.  Move the delay ACK timeout to
milliseconds and remove some ticks and hz mess from the others.
This makes it easier to see the actual values.
OK florian@ dhill@ dlg@

6 years agoupdate to unbound 1.6.8, testing millert, OK sthen
florian [Wed, 7 Feb 2018 00:24:33 +0000 (00:24 +0000)]
update to unbound 1.6.8, testing millert, OK sthen

6 years agoAdd plumbing inside of the prefix handling to put prefixes on either the
claudio [Wed, 7 Feb 2018 00:02:02 +0000 (00:02 +0000)]
Add plumbing inside of the prefix handling to put prefixes on either the
prefixes or updates list depending on flags passed to the functions.
While there also introduce a similar flag for rde_aspath and adjust
path_compare so that this flag is ignored (liked the linked one).
OK benno@

6 years agoallow control over syncookies: set syncookies never/always/adaptive
henning [Tue, 6 Feb 2018 23:47:47 +0000 (23:47 +0000)]
allow control over syncookies: set syncookies never/always/adaptive

6 years agoAbstract "no link ..." and "no lease ..." message generation
krw [Tue, 6 Feb 2018 23:45:15 +0000 (23:45 +0000)]
Abstract "no link ..." and "no lease ..." message generation
into a function tick_msg(). Now both work the same way,
dot dot dotting as time passes until they 'sleep'.

Tested by tb@ as part of a larger diff.

6 years agosyncookies for pf.
henning [Tue, 6 Feb 2018 23:44:48 +0000 (23:44 +0000)]
syncookies for pf.
when syncookies are on, pf will blindly answer each and every SYN with a
syncookie-SYNACK. Upon reception of the ACK completing the 3WHS, pf will
reconstruct the original SYN, shove it through pf_test, where state will
be created if the ruleset permits it. Then massage the freshly created state
(we won't see the SYNACK), set up the sequence number modulator, and call
into the existing synproxy code to start the 3WHS with the backend host.
Add an - somewhat basic for now - adaptive mode where syncookies get enabled
if a certain percentage of the state table is filled up with half-open tcp
connections. This makes pf firewalls resilient against large synflood
attacks.
syncookies are off by default until we gained more experience, considered
experimental for now.
see http://bulabula.org/papers/2017/bsdcan/ for more details.
joint work with sashan@, widely discussed and with lots of input by many

6 years agosyncookies implementation to be used in pf, based on the FreeBSD one by
henning [Tue, 6 Feb 2018 23:37:24 +0000 (23:37 +0000)]
syncookies implementation to be used in pf, based on the FreeBSD one by
Andre Oppermann, heavily adjusted for pf instead of stack use and with
entirely rewritten timeout machinery and new hashing
with bits from sashan, widely discussed with the other network hackers

6 years agoslightly randomize the order that new pages populate their item lists in.
dlg [Tue, 6 Feb 2018 22:35:32 +0000 (22:35 +0000)]
slightly randomize the order that new pages populate their item lists in.

ok tedu@ deraadt@

6 years agoconvert __inline to inline
phessler [Tue, 6 Feb 2018 22:17:03 +0000 (22:17 +0000)]
convert __inline to inline

no binary change on amd64

6 years agoquote http_proxy going to rc.firsttime, avoiding problems if it contains a
sthen [Tue, 6 Feb 2018 22:14:52 +0000 (22:14 +0000)]
quote http_proxy going to rc.firsttime, avoiding problems if it contains a
special character or space (possible with e.g. proxy username/password).
noticed by, install.sub shell magic from, and ok halex@

6 years agoconvert the test if a node support HT (aka, 11n) into an inline function,
phessler [Tue, 6 Feb 2018 22:14:52 +0000 (22:14 +0000)]
convert the test if a node support HT (aka, 11n) into an inline function,
instead of testing some un-obvious bitfield

OK stsp@

6 years agoNuke unused state S_REBINDING. We just use the time
krw [Tue, 6 Feb 2018 21:09:10 +0000 (21:09 +0000)]
Nuke unused state S_REBINDING. We just use the time
to decide between unicast and broadcast for REQUEST.

6 years agoWhen binding a lease from the dhclient.leasees.<if> file and
krw [Tue, 6 Feb 2018 21:01:27 +0000 (21:01 +0000)]
When binding a lease from the dhclient.leasees.<if> file and
the renewal time is in the past wait retry_interval before
trying to renew the lease.

6 years agowhen we get SIGHUP, close conffd so it's reopened (and rewound).
tedu [Tue, 6 Feb 2018 20:38:47 +0000 (20:38 +0000)]
when we get SIGHUP, close conffd so it's reopened (and rewound).
problem and early fix by anton

6 years agoAllow the kernel to recognize that it has been netbooted and to add the
naddy [Tue, 6 Feb 2018 20:35:21 +0000 (20:35 +0000)]
Allow the kernel to recognize that it has been netbooted and to add the
boot interface to the "netboot" group.  efiboot grabs the MAC address
from the PXE environment, passes it to the kernel, where it is matched
against the list of ethernet interfaces and the boot device is set.
Concept and most of the code cribbed from amd64.
ok kettenis@

6 years agoPrint an explicit error if the backup volume is not present in
tb [Tue, 6 Feb 2018 19:57:37 +0000 (19:57 +0000)]
Print an explicit error if the backup volume is not present in
hw.disknames. This can only happen due to a failure or user error.
In either case, silent failure makes it hard to discover and debug.
Now it will be easy to spot in the daily mail.

ok rob, schwarze

6 years agoIf -n is given, the netstart script should not (try to) set the default
tb [Tue, 6 Feb 2018 19:53:50 +0000 (19:53 +0000)]
If -n is given, the netstart script should not (try to) set the default
route(s). Simply print the command(s) to be issued instead.

tweak & ok rpe

6 years agoavoid not working if redirected to another urlscheme
espie [Tue, 6 Feb 2018 16:34:35 +0000 (16:34 +0000)]
avoid not working if redirected to another urlscheme

6 years agosyslog cdns redirect, as suggested by sthen@
espie [Tue, 6 Feb 2018 16:29:01 +0000 (16:29 +0000)]
syslog cdns redirect, as suggested by sthen@

6 years agoDelete the "no blank before trailing delimiter" check from the
schwarze [Tue, 6 Feb 2018 16:28:26 +0000 (16:28 +0000)]
Delete the "no blank before trailing delimiter" check from the
partial explicit macros.  Leah Neukirchen <leah at vuxu dot org>
rightfully points out that the check makes no sense for these macros.

6 years agorefactor the "Signature" code for later
espie [Tue, 6 Feb 2018 15:17:26 +0000 (15:17 +0000)]
refactor the "Signature" code for later
- all stuff being elements end up as version elements
- store them directly in the hash, so that we can properly impose
behavior depending on VersionElement (adding stuff to LibObject/PackageName
was slightly icky)

6 years agoClarify that the "bind" built-in command only affects Emacs editing
schwarze [Tue, 6 Feb 2018 15:13:32 +0000 (15:13 +0000)]
Clarify that the "bind" built-in command only affects Emacs editing
mode, to avoid potential confusion pointed out by andreas dot kahari
at icm dot uu dot se on misc@.
Patch minimally tweaked based on a comment from jmc@.
OK anton@ jca@ jmc@ on the previous version without the tweak.

6 years agoThere was a race in the TCP timers. As they may sleep to grab the
bluhm [Tue, 6 Feb 2018 15:13:08 +0000 (15:13 +0000)]
There was a race in the TCP timers.  As they may sleep to grab the
netlock, timers may still run after they have been disarmed.  Deleting
the timeout is not sufficient to cancel them, but the code from 4.4
BSD is assuming this.
The solution is to add a flag for every timer to see whether it has
been armed or canceled.  Remove the TF_DEAD check as tcp_canceltimers()
is called before the reaper timer is fired.  Cancelation works
reliably now.
OK mpi@

6 years agoDo some cleanup in ah_massage_headers().
bluhm [Tue, 6 Feb 2018 14:54:22 +0000 (14:54 +0000)]
Do some cleanup in ah_massage_headers().
- Declare global array ipseczeroes containing zeroes constant.
- The proto parameter contains the address family, so call it af.
- Remove an unused if block, just keep the else.
- If m_copyback(M_NOWAIT) fails, return with error instead of working
  with an inconsistent mbuf.
- ip6_nxt is u_int8_t, no need to clear the high bits.
- The offset and next protocol are advanced for all extension
  headers, move it after the switch.
- ah_massage_headers() returns an errno, call the variable error.
OK procter@

6 years agoDo not call freeaddrinfo() with a NULL parameter.
bluhm [Tue, 6 Feb 2018 14:45:52 +0000 (14:45 +0000)]
Do not call freeaddrinfo() with a NULL parameter.
OK jsing@

6 years agomake sure that all error paths are correctly handled in asr_run_sync()
eric [Tue, 6 Feb 2018 13:00:48 +0000 (13:00 +0000)]
make sure that all error paths are correctly handled in asr_run_sync()
and that the result is always properly set when the functions returns.
fix issues spotted by claudio@.

ok claudio@

6 years agoMake sure sigfillsiz is word aligned.
patrick [Tue, 6 Feb 2018 09:25:54 +0000 (09:25 +0000)]
Make sure sigfillsiz is word aligned.

ok kettenis@

6 years agosome finger muscle workout:
henning [Tue, 6 Feb 2018 09:16:11 +0000 (09:16 +0000)]
some finger muscle workout:
bzero -> memset and (very few) bcopy -> memcpy/memmove

6 years agoremove extern from function prototypes, remove some variable names, and a
phessler [Tue, 6 Feb 2018 09:04:45 +0000 (09:04 +0000)]
remove extern from function prototypes, remove some variable names, and a
left-over kernel malloc feature we don't use.

OK deraadt@

6 years agoRun newvers.sh with umask 007 to work around permission issues that
tb [Tue, 6 Feb 2018 08:42:33 +0000 (08:42 +0000)]
Run newvers.sh with umask 007 to work around permission issues that
cause 'make release' fail the first time around after building GENERIC
if /usr/obj/ wasn't cleaned out properly. The proper fix would be to
implement privdrop for kernel builds but this is trickier than it looks
at first sight.

discussed with deraadt

6 years agoReplace "trojan horse" with the correct term (MITM). From maikel at
dtucker [Tue, 6 Feb 2018 06:01:54 +0000 (06:01 +0000)]
Replace "trojan horse" with the correct term (MITM).  From maikel at
predikkta.com via bz#2822, ok markus@

6 years agoFix fprintf() to include "\n" where needed. Prefix "no lease"
krw [Tue, 6 Feb 2018 05:09:51 +0000 (05:09 +0000)]
Fix fprintf() to include "\n" where needed. Prefix "no lease"
messages with interface name.

Spotted by & ok tb@

6 years agomove malloc check up so that it actually works.
florian [Tue, 6 Feb 2018 05:08:27 +0000 (05:08 +0000)]
move malloc check up so that it actually works.
OK benno

6 years agokill dead code
florian [Tue, 6 Feb 2018 04:19:56 +0000 (04:19 +0000)]
kill dead code

6 years agooutput the data part of LCP Echo-Request and Echo-Reply packets.
dlg [Tue, 6 Feb 2018 03:41:58 +0000 (03:41 +0000)]
output the data part of LCP Echo-Request and Echo-Reply packets.

6 years agorework ppp, pptp, and gre parsing.
dlg [Tue, 6 Feb 2018 03:07:51 +0000 (03:07 +0000)]
rework ppp, pptp, and gre parsing.

this started cos i was looking at pptp, which came out like this:

23:52:00.197893  call 24 seq 7: gre-ppp-payload (gre encap)
23:52:00.198930  call 1 seq 7 ack 7: gre-ppp-payload (gre encap)

now it looks like this:

23:52:00.197893 20.0.0.2 > 20.0.0.1: pptp callid 24 seq 7: 17.1.1.122 > 40.0.0.2: icmp: echo request
23:52:00.198930 20.0.0.1 > 20.0.0.2: pptp callid 1 seq 7 ack 7: 40.0.0.2 > 17.1.1.122: icmp: echo reply

the big improvement in ppp parsing is it stops parsing based on
what the ppp headers say, rather than what bytes have been captured.
this also adds parsing of EAP packets.

DLT_PPP_SERIAL is now recognised and printed. gre now prints the
outer addresses always, not just when it's encapsulated by ipv6 or
-v is passed to tcpdump.

ok sthen@

6 years agorecognise DLT_PPP_SERIAL.
dlg [Tue, 6 Feb 2018 02:55:48 +0000 (02:55 +0000)]
recognise DLT_PPP_SERIAL.

shlib version doesnt need a bump before no new symbols were added
or removed.

part of a larger diff that was ok sthen@

6 years agoRemove manual shutdown and close of the socket since in this case
tb [Tue, 6 Feb 2018 02:40:29 +0000 (02:40 +0000)]
Remove manual shutdown and close of the socket since in this case
SSL_free will do this a second time.

ok jsing

6 years agoRespect the OPENSSL make variable everywhere so that
tb [Tue, 6 Feb 2018 02:31:13 +0000 (02:31 +0000)]
Respect the OPENSSL make variable everywhere so that

make OPENSSL=/usr/src/usr.bin/openssl/obj/openssl

actually does the expected thing instead of running a mixture of both the
openssl below /usr/obj and the one below /usr/bin.  Found the hard way via
backtraces that made no sense whatsoever.

ok jsing

6 years agoAdd support for chips which use SYSMEM memory. Code is a simplified
patrick [Tue, 6 Feb 2018 02:23:04 +0000 (02:23 +0000)]
Add support for chips which use SYSMEM memory.  Code is a simplified
version of the SOCRAM one.

6 years agoSupport setting the Cortex-M3 cores to active mode.
patrick [Tue, 6 Feb 2018 02:12:55 +0000 (02:12 +0000)]
Support setting the Cortex-M3 cores to active mode.

6 years agoreduce scope of variable a bit to avoid shadowing
tedu [Tue, 6 Feb 2018 01:24:31 +0000 (01:24 +0000)]
reduce scope of variable a bit to avoid shadowing

6 years agoLoad the Intel microcode much earlier. So far we had loaded it after
patrick [Tue, 6 Feb 2018 01:09:17 +0000 (01:09 +0000)]
Load the Intel microcode much earlier.  So far we had loaded it after
the CPUs identified and then we had to update the CPU flags afterwards.
As microcode updates can add/remove instructions and features, we need
to load it earlier.  Thus, make the bootloader look for the microcode
and supply it to the kernel as another bootarg.  This way we can update
the cores' microcode before we identify them.

ok deraadt@

6 years agoFlip -q (be quiet) into -v (be noisy), making terseness the default
krw [Tue, 6 Feb 2018 00:25:09 +0000 (00:25 +0000)]
Flip -q (be quiet) into -v (be noisy), making terseness the default
behaviour.

Always go daemon after link_timeout seconds and complete lease
negotiations in the background if necessary. No hanging around in the
foreground for the full 64 seconds waiting for a server to appear.

Log a more relevant message when a default route can't be obtained via
RTM_GET. i.e. "no default route" rather than "No such process".

-q -> -v ok mpi@