Commit Graph

82 Commits

Author SHA1 Message Date
christos c85e5e1ae4 PR/53365: Thomas Barabosch: memory leak in route6d
XXX: pullup 7, 8
2018-06-14 16:17:18 +00:00
maxv 5fdd88f8ba Rename allocopy -> xstrdup, and simplify. 2018-05-09 07:30:21 +00:00
maxv f96ffcb41d Clean up. 2018-05-09 07:21:08 +00:00
maxv b5155ff2f3 Remove dead/broken code. 2018-05-09 07:05:42 +00:00
ozaki-r 09973b35ac Separate nexthop caches from the routing table
By this change, nexthop caches (IP-MAC address pair) are not stored
in the routing table anymore. Instead nexthop caches are stored in
each network interface; we already have lltable/llentry data structure
for this purpose. This change also obsoletes the concept of cloning/cloned
routes. Cloned routes no longer exist while cloning routes still exist
with renamed to connected routes.

Noticeable changes are:
- Nexthop caches aren't listed in route show/netstat -r
  - sysctl(NET_RT_DUMP) doesn't return them
  - If RTF_LLDATA is specified, it returns nexthop caches
- Several definitions of routing flags and messages are removed
  - RTF_CLONING, RTF_XRESOLVE, RTF_LLINFO, RTF_CLONED and RTM_RESOLVE
- RTF_CONNECTED is added
  - It has the same value of RTF_CLONING for backward compatibility
- route's -xresolve, -[no]cloned and -llinfo options are removed
  - -[no]cloning remains because it seems there are users
  - -[no]connected is introduced and recommended
    to be used instead of -[no]cloning
- route show/netstat -r drops some flags
  - 'L' and 'c' are not seen anymore
  - 'C' now indicates a connected route
- Gateway value of a route of an interface address is now not
  a L2 address but "link#N" like a connected (cloning) route
- Proxy ARP: "arp -s ... pub" doesn't create a route

You can know details of behavior changes by seeing diffs under tests/.

Proposed on tech-net and tech-kern:
  http://mail-index.netbsd.org/tech-net/2016/03/11/msg005701.html
2016-04-04 07:37:07 +00:00
kardel 640a1e10fd reenable routing functionality by using RT_ROUNDUP for ROUNDUP when available 2013-04-15 07:58:35 +00:00
wiz 1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
plunky 9f61b80465 NULL does not need a cast 2011-08-31 16:24:54 +00:00
mbalmer c3001cc345 Remove double 'static'. 2011-08-31 07:03:00 +00:00
joerg 949eeab3f6 static + __dead + G/C 2011-08-30 21:26:11 +00:00
plunky edefcdeffb no [longer?] need to define _KERNEL when including <net/route.h> 2010-04-23 15:30:30 +00:00
lukem 0350114585 Fix WARNS=4 issues (-Wshadow -Wsign-compare) 2009-04-19 07:54:08 +00:00
dyoung 1ebd488e32 #include <stdbool.h> for bool. 2008-01-21 20:46:58 +00:00
tls 4147a3c54a Add new Makefile knob, USE_FORT, which extends USE_SSP by turning on the
FORTIFY_SOURCE feature of libssp, thus checking the size of arguments to
various string and memory copy and set functions (as well as a few system
calls and other miscellany) where known at function entry.  RedHat has
evidently built all "core system packages" with this option for some time.

This option should be used at the top of Makefiles (or Makefile.inc where
this is used for subdirectories) but after any setting of LIB.

This is only useful for userland code, and cannot be used in libc or in
any code which includes the libc internals, because it overrides certain
libc functions with macros.  Some effort has been made to make USE_FORT=yes
work correctly for a full-system build by having the bsd.sys.mk logic
disable the feature where it should not be used (libc, libssp iteself,
the kernel) but no attempt has been made to build the entire system with
USE_FORT and doing so will doubtless expose numerous bugs and misfeatures.

Adjust the system build so that all programs and libraries that are setuid,
directly handle network data (including serial comm data), perform
authentication, or appear likely to have (or have a history of having)
data-driven bugs (e.g. file(1)) are built with USE_FORT=yes by default,
with the exception of libc, which cannot use USE_FORT and thus uses
only USE_SSP by default.  Tested on i386 with no ill results; USE_FORT=no
per-directory or in a system build will disable if desired.
2007-05-28 12:06:17 +00:00
msaitoh 8ce1f4fff2 fix typos 2007-04-29 20:23:34 +00:00
elad 1232ea27c4 PR/18906: roskens at elfin dot net: misc. select() to poll() updates.
Adapted to -current by myself, thanks for the patch!
2006-10-07 17:27:57 +00:00
rpaulo 024ed52e7d Add missing #endif. 2006-05-25 02:40:58 +00:00
rpaulo 4264348cac Beautify. 2006-05-25 02:35:50 +00:00
rpaulo 3a387eb457 Time to remove __P(). 2006-05-25 02:32:56 +00:00
rpaulo d5c00ee8c6 Now it uses the RFC 3542 API. 2006-05-25 02:21:59 +00:00
christos f5e466e11a Coverity CID 2537: Avoid double free, and random free. how did this work? 2006-05-25 02:05:40 +00:00
christos e86e72d9a8 Coverity CID 3194: Avoid NULL deref. 2006-05-25 02:01:40 +00:00
christos 180ca89a2b Coverity CID 3195: ifdef out dead code. 2006-05-25 01:58:39 +00:00
wiz 1ad8067cb3 Fix typos, reported by Alexey Dobriyan ("Gathered from Linux"),
forwarded by jmc@openbsd.
2006-02-25 00:58:34 +00:00
hannken 101f03a0d5 Let it compile again on sparc/sparc64. 2003-10-31 10:09:55 +00:00
itojun 91ba57dca7 need_trigger/idx should be u_int. millert@openbsd 2003-10-31 00:31:53 +00:00
itojun 4101558b6e validate packet length. KAME-PR-517 2003-10-30 08:46:04 +00:00
itojun 0c4a8b5a7e realloc pedant 2003-09-19 06:01:24 +00:00
wiz 47190e80b8 Consistently use 'RFC 1234' instead of 'RFC1234' or 'RFC-1234'.
From jmc@openbsd.
2003-09-07 16:22:20 +00:00
itojun c66d2bd6ee Don't age non-gateway host routes. PR bin/22568 from Andrew White 2003-08-22 08:24:26 +00:00
itojun 47c9fbf29d port numbers are unsigned. use %u. from kame 2003-04-22 09:56:30 +00:00
itojun c2a20cc150 %d is not 10 chars, but 12 chars. uwse NI_MAXSERV. sync w/ kame. from openbsd 2003-04-15 07:23:19 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
itojun 41b5d4f9af use strtoul, not atoi.
don't print strerrno() if errno == 0 on fatal().
sync w/kame
2002-10-26 20:10:02 +00:00
itojun 88b96862d4 IPV6_V6ONLY setsockopt has to happen before bind(2). PR 18435 2002-09-27 14:43:00 +00:00
itojun 2eca5c16aa set IPV6_V6ONLY to 1. 2002-09-24 13:48:14 +00:00
mycroft aae6c28cf9 null commit 2002-09-23 12:44:34 +00:00
itojun 3ca6603d44 sys/poll.h -> poll.h
reduce diff w/ kame tree.
2002-09-20 22:04:31 +00:00
mycroft a5f0bfc173 Set fd of unused pollfd entries to -1. 2002-09-20 19:51:33 +00:00
mycroft 562704fd8f select() -> poll() 2002-09-20 13:30:18 +00:00
itojun 9e8e6611e8 suppress output on dump request if -q is specified. sync w/kame 2002-08-21 16:26:12 +00:00
wiz a1b3869d7e Unifdef __STDC__, ansify. 2002-08-01 00:17:31 +00:00
itojun db47036241 use strchr 2002-06-09 02:47:03 +00:00
itojun f78cc67c13 avoid fd_set overrun. sync w/kame 2002-06-07 16:45:30 +00:00
wiz ce2e5815e6 Wording and grammar improvements. 2002-06-02 14:56:47 +00:00
itojun ef188effbf strlcpy. rtm_seq is an int. use pidfile(3). sync w/kame via openbsd 2002-05-29 23:11:13 +00:00
itojun 8e96646992 do not age global address on loopback interface. sync with kame 2002-02-25 02:22:59 +00:00
itojun 4a1ad619af daemon(3) has to be called before opening file descriptors.
noticed by markus@openbsd, sync with kame
2002-01-11 04:20:55 +00:00
itojun 3e54083fa3 __ss_{len,family} hack is no longer necessary 2001-11-19 03:19:10 +00:00
wiz 4c99916337 va_{start,end} audit:
Make sure that each va_start has one and only one matching va_end,
especially in error cases.
If the va_list is used multiple times, do multiple va_starts/va_ends.
If a function gets va_list as argument, don't let it use va_end (since
it's the callers responsibility).

Improved by comments from enami and christos -- thanks!

Heimdal/krb4/KAME changes already fed back, rest to follow.

Inspired by, but not not based on, OpenBSD.
2001-09-24 13:22:25 +00:00