History log of /freebsd-current/usr.sbin/rtsold/if.c
Revision Date Author Comments
# b3e76948 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: two-line .h pattern

Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/


# 1a4d7030 19-Aug-2021 Luiz Otavio O Souza <loos@FreeBSD.org>

rtsold: make it work on if_vlan interfaces

Reviewed by: kp
Obtained from: pfsense
MFC after: 1 week


# ecce515d 02-Dec-2020 Mark Johnston <markj@FreeBSD.org>

rtsold: Fix bugs reported by Coverity

- Avoid leaking a socket if llflags_get() fails.
- Avoid leaking a file handle if rtsold_init_dumpfile() fails.
- Tighten the check in if_nametosdl() which determines whether we failed
to find the specified interface.
- Fix errno handling in an error path in rtsock_open().

MFC after: 1 week


# 04e9edb5 05-Jan-2019 Mark Johnston <markj@FreeBSD.org>

Capsicumize rtsol(8) and rtsold(8).

These programs parse ND6 Router Advertisement messages; rtsold(8) has
required an SA, SA-14:20.rtsold, for a bug in this code. Thus, they
are good candidates for sandboxing.

The approach taken is to run the main executable in capability mode
and use Casper services to provide functionality that cannot be
implemented within the sandbox. In particular, several custom services
were required.

- A Casper service is used to send Router Solicitation messages on a
raw ICMP6 socket. Initially I took the approach of creating a
socket for each interface upon startup, and connect(2)ing it to
the all-routers multicast group for the interface. This permits
the use of sendmsg(2) in capability mode, but only works if the
interface's link is up when rtsol(d) starts. So, instead, the
rtsold.sendmsg service is used to transmit RS messages on behalf
of the main process. One could alternately define a service
which simply creates and connects a socket for each destination
address, and returns the socket to the sandboxed process. However,
to implement rtsold's -m option we also need to read the ND6 default
router list, and this cannot be done in capability mode.
- rtsold may execute resolvconf(8) in response to RDNSS and DNSSL
options in received RA messages. A Casper service is used to
fork and exec resolvconf(8), and to reap the child process.
- A service is used to determine whether a given interface's
link-local address is useable (i.e., not duplicated or undergoing
DAD). This information is supplied by getifaddrs(3), which reads
a sysctl not available in capability mode. The SIOCGIFCONF socket
ioctl provides equivalent information and can be used in capability
mode, but I decided against it for now because of some limitations
of that interface.

In addition to these new services, cap_syslog(3) is used to send
messages to syslogd.

Reviewed by: oshogbo
Tested by: bz (previous versions)
MFC after: 2 months
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17572


# d2f6957c 20-Oct-2018 Mark Johnston <markj@FreeBSD.org>

Remove dead code.

No functional change intended.

MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 2bbd06fc 28-Jan-2017 Andriy Voskoboinyk <avos@FreeBSD.org>

Garbage collect IFT_IEEE80211 (but leave the define for possible reuse)

This interface type ("a parent interface of wlanX") is not used since
r287197

Reviewed by: adrian, glebius
Differential Revision: https://reviews.freebsd.org/D9308


# dc47112f 15-May-2016 Don Lewis <truckman@FreeBSD.org>

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: 99186, 991864, 991865
MFC after: 1 week


# f74237f5 10-Sep-2015 Hiroki Sato <hrs@FreeBSD.org>

- Remove #ifdef HAVE_POLL_H.
- Use nitems().

MFC after: 3 days


# 0fa5aacd 02-May-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Remove #ifdef IFT_FOO.

Submitted by: Guy Yur <guyyur gmail.com>


# 56d5e096 06-Apr-2015 Gleb Smirnoff <glebius@FreeBSD.org>

Stop including if_var.h from userland.

Sponsored by: Nginx, Inc.


# a678ca23 17-Aug-2013 Hiroki Sato <hrs@FreeBSD.org>

- Remove struct ifinfo *iflist. It is no longer used.
- Suppress warnings about increase of alignment requirement.


# db82af41 05-Jun-2011 Hiroki Sato <hrs@FreeBSD.org>

- Implement RDNSS and DNSSL options (RFC 6106, IPv6 Router Advertisement
Options for DNS Configuration) into rtadvd(8) and rtsold(8). DNS
information received by rtsold(8) will go to resolv.conf(5) by
resolvconf(8) script. This is based on work by J.R. Oldroyd (kern/156259)
but revised extensively[1].

- rtadvd(8) now supports "noifprefix" to disable gathering on-link prefixes
from interfaces when no "addr" is specified[2]. An entry in rtadvd.conf
with "noifprefix" + no "addr" generates an RA message with no prefix
information option.

- rtadvd(8) now supports RTM_IFANNOUNCE message to fix crashes when an
interface is added or removed.

- Correct bogus ND_OPT_ROUTE_INFO value to one in RFC 4191.

Reviewed by: bz[1]
PR: kern/156259 [1]
PR: bin/152458 [2]


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# bd2c49af 27-Feb-2010 Ulrich Spörlein <uqs@FreeBSD.org>

rtsol(8)/rtsold(8): make WARNS=3 clean

It is actually WARNS=6 clean for non-strict alignment archs.

Approved by: ed (co-mentor)


# eb87e699 12-Sep-2009 Hiroki Sato <hrs@FreeBSD.org>

Add support for ND6_IFF_IFDISABLED and ND6_IFF_ACCEPT_RTADV to
the -F flag.

MFC after: 3 days


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# 784bddbc 07-Nov-2007 Kevin Lo <kevlo@FreeBSD.org>

Cleanup of userland __P use


# 4b8b545e 24-Mar-2006 SUZUKI Shinsuke <suz@FreeBSD.org>

fixed a potential memory leak

Obtained from: KAME
MFC after: 1 day


# fcdaee31 14-Jan-2004 Hajimu UMEMOTO <ume@FreeBSD.org>

add -F flag, which configures sysctl(8) setting by rtsold
itself (rather than warn about the current setting).

Obtained from: KAME


# 8e7409ed 14-Jan-2004 Hajimu UMEMOTO <ume@FreeBSD.org>

ansify.

Obtained from: KAME


# 96316581 17-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

backout 1.11. ifname in struct ifreq should be copyed by strncpy.

Pointed out by: itojun


# 4774e8e6 16-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

use strlcpy().

Pointed out by: Pawel Jakub Dawidek <nick@garage.freebsd.pl>
MFC after: 1 week


# 131033d5 16-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

- added the case of 802.11 to check link status.
- use strncpy just in case.
- __P() cleanup.

Obtained from: KAME
MFC after: 1 week


# b6ed844f 11-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

reduce #ifdef.

MFC after: 1 week


# fa19f9be 08-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

KNF, correct typos and cleanup spaces.

Obtained from: KAME
MFC after: 1 week


# 5ed8c16b 08-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

drop the code for the environment where getifaddrs(3) is not
supported.

Obtained from: KAME
MFC after: 1 week


# 1533bed0 08-Aug-2003 Hajimu UMEMOTO <ume@FreeBSD.org>

__FUNCTION__ --> __func__

Obtained from: KAME
MFC after: 1 week


# 33841545 10-Jun-2001 Hajimu UMEMOTO <ume@FreeBSD.org>

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


# 804c83d4 06-Oct-2000 Kris Kennaway <kris@FreeBSD.org>

Sync with KAME. Format string auditing, and add -a flag to autoprobe
interfaces.

Obtained from: KAME


# 259df286 05-Jul-2000 Kris Kennaway <kris@FreeBSD.org>

Sync with latest KAME.

Obtained from: KAME


# 04e87720 07-Jan-2000 Yoshinobu Inoue <shin@FreeBSD.org>

remove redundant ifdef's.

some part is specified by: phantom


# 7d56d374 27-Dec-1999 Yoshinobu Inoue <shin@FreeBSD.org>

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