History log of /freebsd-11-stable/usr.sbin/route6d/route6d.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 338279 23-Aug-2018 markj

MFC r337500:
Use the right variable when updating interface routes.

PR: 229807


# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 314427 28-Feb-2017 asomers

MFC r311572, r311895, r311928, r311985, r312395, r312417

r311572:
Fix file descriptor leaks in cmp(1)

Also, add a few test cases

Reported by: Coverity
CID: 271624 275338
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9074

r311895:
Fix memory leaks during "tail -r" of an irregular file

* Rewrite r_buf to use standard tail queues instead of a hand-rolled
circular linked list. Free dynamic allocations when done.
* Remove an optimization for the case where the file is a multiple of 128KB
in size and there is a scarcity of memory.
* Add ATF tests for "tail -r" and its variants.

Reported by: Valgrind
Reviewed by: ngie
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp
Differential Revision: https://reviews.freebsd.org/D9067

r311928:
Fix build of usr.bin/tail with GCC

Submitted by: pluknet
Reported by: pluknet
MFC after: 27 days
X-MFC-with: 311895
Sponsored by: Spectra Logic Corp

r311985:
Fix uninitialized variable CIDs in route6d

The variables in question are actually return arguments, but it's still good
form to initialize them.

Reported by: Coverity
CID: 979679 979680
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312395:
Fix several Coverity CIDs in devd

CID 1362055, 1362054: File descriptor leaks during shutdown
CID 1362013: Potential null-termination fail with long network device names
CID 1362097: Uncaught exception during memory pressure
CID 1362017, 1362016: Unchecked errors, possibly resulting in weird behavior
if two devd instances start at the same time.
CID 1362015: Unchecked error that will probably never fail

Reported by: Coverity
CID: 1362055 1362054 1362013 1362097 1362017 1362016 1362015
MFC after: 4 weeks
Sponsored by: Spectra Logic Corp

r312417:
Fix build of devd with GCC 4.2

Reported by: olivier
Pointy-hat-to: asomers
MFC after: 27 days
X-MFC-with: 312395
Sponsored by: Spectra Logic Corp


# 312022 13-Jan-2017 ngie

MFC r311711,r311712,r311713:

r311711:

Clean up trailing whitespace

r311712:

Sort #includes

r311713:

Use nitems(mib) instead of hardcoding mib's length


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 299869 15-May-2016 truckman

Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated. Additional NUL padding is not required
for short names.

Reported by: Coverity
CID: 1009974
MFC after: 1 week


# 299491 11-May-2016 cem

route6d(8): Fix potential double-free

In the case that the subsequent sysctl(3) call failed, 'buf' could be free(3)ed
repeatedly. It isn't clear to me that that case is possible, but be clear and
do the right thing in case it is.

Reported by: Coverity
CID: 272537
Sponsored by: EMC / Isilon Storage Division


# 281143 06-Apr-2015 glebius

Stop including if_var.h from userland.

Sponsored by: Nginx, Inc.


# 270234 20-Aug-2014 hrs

Recover sin6_scope_id of gateway addresses in riprecv() by using the if_index
where a RIP packet was received. This fixes a bug which prevented gateway
addresses in fe80::/64 from being added.


# 263658 23-Mar-2014 glebius

Remove unneeded fake _KERNEL definition.


# 263203 15-Mar-2014 glebius

Garbage collect long time obsoleted (or never used) stuff from routing API.


# 257699 05-Nov-2013 glebius

Axe IFF_SMART. Fortunately this layering violating flag was never used,
it was just declared.


# 243233 18-Nov-2012 hrs

- Increase the number of retry for NET_RT_DUMP from 5 to 15.
- Use 2001:db8:: as an example instead of deprecated 3ffe:: address block.
- Add check for connected routes.
- Add support of RTM_IFANNOUNCE for dyanmically-added/removed interfaces.
- Add support of *, ?, and [ in the interface list.
- Add -P number to specify route flag which will never expire.
- Add -Q number to specify route flag which route6d will add to routes via RIP.
- Add -p pidfile to specify the process ID file.


# 243232 18-Nov-2012 hrs

Overhaul of route6d(8):

- Use queue(3) for linked-list.
- Use a consistent naming scheme for struct members.
- Use ANSI C style function declaration.
- Add check of RTM_VERSION mismatch.

There is no functional change.


# 243231 18-Nov-2012 hrs

Use sin6_scope_id instead of KAME-specific embedded scope id.


# 228990 30-Dec-2011 uqs

Spelling fixes for usr.sbin/


# 228674 17-Dec-2011 dim

In usr.sbin/route6d/route6d.c, use the correct printf length modifier
for an ssize_t.

MFC after: 1 week


# 186119 15-Dec-2008 qingli

This main goals of this project are:
1. separating L2 tables (ARP, NDP) from the L3 routing tables
2. removing as much locking dependencies among these layers as
possible to allow for some parallelism in the search operations
3. simplify the logic in the routing code,

The most notable end result is the obsolescent of the route
cloning (RTF_CLONING) concept, which translated into code reduction
in both IPv4 ARP and IPv6 NDP related modules, and size reduction in
struct rtentry{}. The change in design obsoletes the semantics of
RTF_CLONING, RTF_WASCLONE and RTF_LLINFO routing flags. The userland
applications such as "arp" and "ndp" have been modified to reflect
those changes. The output from "netstat -r" shows only the routing
entries.

Quite a few developers have contributed to this project in the
past: Glebius Smirnoff, Luigi Rizzo, Alessandro Cerri, and
Andre Oppermann. And most recently:

- Kip Macy revised the locking code completely, thus completing
the last piece of the puzzle, Kip has also been conducting
active functional testing
- Sam Leffler has helped me improving/refactoring the code, and
provided valuable reviews
- Julian Elischer setup the perforce tree for me and has helped
me maintaining that branch before the svn conversion


# 173412 07-Nov-2007 kevlo

Cleanup of userland __P use


# 164339 16-Nov-2006 suz

implemented more validation checks about incoming responses per RFC2080, and one additional heuristic check for safer operation.

Obtained from: KAME
MFC after: 1 week


# 122677 14-Nov-2003 ume

- need_trigger/idx should be u_int, not ssize_t.
- realloc pedant.
- set sin6_scope_id before sending (link-local/multicast) packets
- removed an incorrect comment
- don't age non-gateway host routes.
- not remove global addresses on loopback interface from routing table
by route aging.

Obtained from: KAME


# 121779 31-Oct-2003 suz

fixe remote panic on short packet

Obtained from: KAME


# 120717 03-Oct-2003 sam

remove unused variable

Supported by: FreeBSD Foundation


# 119085 18-Aug-2003 ume

rtm_seq is int, so seq/myseq should be int.

Obtained from: KAME
MFC after: 1 week


# 119084 18-Aug-2003 ume

suppress outpt on dump request if -q is specified.

Obtained from: KAME
MFC after: 1 week


# 119083 18-Aug-2003 ume

atoi -> strtoul

Obtained from: KAME
MFC after: 1 week


# 119081 18-Aug-2003 ume

- port numbers are unsigned. use %u.
- %d is not 10 chars, but 12 chars.

Obtained from: KAME
MFC after: 1 week


# 119080 18-Aug-2003 ume

explicitly specify IPPROTO_UDP when calling getaddrinfo().

Obtained from: KAME
MFC after: 1 week


# 119079 18-Aug-2003 ume

remove a variable that is never used.

Obtained from: KAME
MFC after: 1 week


# 119076 18-Aug-2003 ume

support poll(2).

Obtained from: KAME
MFC after: 1 week


# 119070 18-Aug-2003 ume

- don't select with FD_SETSIZE.
- avoid fd_set overrun.

Obtained from: KAME
MFC after: 1 week


# 119043 17-Aug-2003 ume

- don't print strerror() if errno == 0 on fatal().
- va_start/end audit.
- can't use vfprintf() twice. need va_start/end pair every time.

Obtained from: KAME
MFC after: 1 week


# 119042 17-Aug-2003 ume

- do not SEGV on IFF_UP.
- recover rrt_gw setting for non-p2p case. otherwise, we will not
be able to recover interface route on interface down -> up
transition.
- clarify loop exit condition

Obtained from: KAME
MFC after: 1 week


# 119041 17-Aug-2003 ume

do not send dump request on -N

Obtained from: KAME
MFC after: 1 week


# 119040 17-Aug-2003 ume

macro pedant

Obtained from: KAME
MFC after: 1 week


# 119039 17-Aug-2003 ume

minor cleanup; no need for extra variable here

Obtained from: KAME
MFC after: 1 week


# 119038 17-Aug-2003 ume

use strchr(3).

Obtained from: KAME
MFC after: 1 week


# 119037 17-Aug-2003 ume

daemon() has to be called prior to file descriptor setups
(otherwise file descriptors could be closed mistakenly)

Obtained from: KAME
MFC after: 1 week


# 119035 17-Aug-2003 ume

knf, typo, space.

Obtained from: KAME
MFC after: 1 week


# 119034 17-Aug-2003 ume

set IPV6_V6ONLY.

Obtained from: KAME
MFC after: 1 week


# 119033 17-Aug-2003 ume

- die if malloc fails.
- use strlcpy.

Obtained from: KAME
MFC after: 1 week


# 119032 17-Aug-2003 ume

use strncpy

Obtained from: KAME
MFC after: 1 week


# 119031 17-Aug-2003 ume

"sin" is a reserved C library function name. use sin6

Obtained from: KAME
MFC after: 1 week


# 110666 11-Feb-2003 ache

Add missing srand() (sranddev() for FreeBSD)


# 108533 01-Jan-2003 schweikh

Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,
especially in troff files.


# 78064 11-Jun-2001 ume

Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some
critical problem after the snap was out were fixed.
There are many many changes since last KAME merge.

TODO:
- The definitions of SADB_* in sys/net/pfkeyv2.h are still different
from RFC2407/IANA assignment because of binary compatibility
issue. It should be fixed under 5-CURRENT.
- ip6po_m member of struct ip6_pktopts is no longer used. But, it
is still there because of binary compatibility issue. It should
be removed under 5-CURRENT.

Reviewed by: itojun
Obtained from: KAME
MFC after: 3 weeks


# 69279 27-Nov-2000 ume

- do not check/advertise cloned routes, nor dynamic routes
- cast size_t on printing (be friendly with alpha)

Obtained from: KAME


# 66807 08-Oct-2000 kris

Sync with KAME. Format string auditing and manpage cleanups.

Obtained from: KAME
Submitted by: Bill Sommerfeld <sommerfeld@netbsd.org>


# 64631 14-Aug-2000 itojun

fix LP64 issue in routing socket manipulation.
make behavior of -A safer.
(sync with kame)


# 62921 10-Jul-2000 ume

removed 'ifndef ADVAPI' parts

Obtained from: KAME


# 62607 05-Jul-2000 itojun

sync with latest kame tree. more stable, p2p advert is corrected


# 58070 14-Mar-2000 shin

When unexpected rtmsg was received, route6d was dying.
So change it just to log it.
(Merge from recent KAME bug fix.)

Submitted by: itojun
Obtained from: KAME project


# 55543 07-Jan-2000 shin

remove redundant ifdef's.

some part is specified by: phantom


# 55163 28-Dec-1999 shin

Getaddrinfo(), getnameinfo(), and etc support in libc/net.
Several udp and raw apps IPv6 support.

Reviewed by: freebsd-arch, cvs-committers
Obtained from: KAME project