OPNsense - FreeBSD source
Find a file
Alexander V. Chernikov d375edc9b5 Simplify inet alias handling code: if we're adding/removing alias which
has the same prefix as some other alias on the same interface, use
newly-added rt_addrmsg() instead of hand-rolled in_addralias_rtmsg().

This eliminates the following rtsock messages:

Pinned RTM_ADD for prefix (for alias addition).
Pinned RTM_DELETE for prefix (for alias withdrawal).

Example (got 10.0.0.1/24 on vlan4, playing with 10.0.0.2/24):

before commit, addition:

  got message of size 116 on Fri Jan 10 14:13:15 2014
  RTM_NEWADDR: address being added to iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

  got message of size 192 on Fri Jan 10 14:13:15 2014
  RTM_ADD: Add Route: len 192, pid: 0, seq 0, errno 0, flags:<UP,PINNED>
  locks:  inits:
  sockaddrs: <DST,GATEWAY,NETMASK>
   10.0.0.0 10.0.0.2 (255) ffff ffff ff

after commit, addition:

  got message of size 116 on Fri Jan 10 13:56:26 2014
  RTM_NEWADDR: address being added to iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 14.0.0.2 14.0.0.255

before commit, wihdrawal:

  got message of size 192 on Fri Jan 10 13:58:59 2014
  RTM_DELETE: Delete Route: len 192, pid: 0, seq 0, errno 0, flags:<UP,PINNED>
  locks:  inits:
  sockaddrs: <DST,GATEWAY,NETMASK>
   10.0.0.0 10.0.0.2 (255) ffff ffff ff

  got message of size 116 on Fri Jan 10 13:58:59 2014
  RTM_DELADDR: address being removed from iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

adter commit, withdrawal:

  got message of size 116 on Fri Jan 10 14:14:11 2014
  RTM_DELADDR: address being removed from iface: len 116, metric 0, flags:
  sockaddrs: <NETMASK,IFP,IFA,BRD>
   255.255.255.0 vlan4:8.0.27.c5.29.d4 10.0.0.2 10.0.0.255

Sending both RTM_ADD/RTM_DELETE messages to rtsock is completely wrong
(and requires some hacks to keep prefix in route table on RTM_DELETE).

I've tested this change with quagga (no change) and bird (*).

bird alias handling is already broken in *BSD sysdep code, so nothing
changes here, too.

I'm going to MFC this change if there will be no complains about behavior
change.

While here, fix some style(9) bugs introduced by r260488
(pointed by glebius and bde).

Sponsored by:	Yandex LLC
MFC after:	4 weeks
2014-01-10 12:13:55 +00:00
bin Run the sh(1) and test(1) tests as unprivileged. 2014-01-10 10:39:01 +00:00
cddl MFV r260154 + 260182: 2014-01-02 07:34:36 +00:00
contrib Use .cpp as the extension for temporary C++ files. 2014-01-09 18:53:21 +00:00
crypto MFV r260399: 2014-01-07 19:58:45 +00:00
etc Remove very low default limit of 4 nfsd threads. nfsd's own default is 2014-01-09 15:55:55 +00:00
games Fix typo in fortune (go -> to) 2013-12-10 19:42:35 +00:00
gnu When building a cross kgdb, link against the appropriate cross libkvm. 2013-12-28 23:31:22 +00:00
include Replace Sun RPC license with a 3-clause BSD license. This license change 2013-12-09 04:26:50 +00:00
kerberos5 Try and fix the dependency/bootstrap issues in kerberos5 2013-12-23 14:23:17 +00:00
lib make sure that rbuf is aligned by making a union w/ the structure we 2014-01-07 23:01:05 +00:00
libexec Cast Elf_Addr to void * to match the free_aligned() argument type. 2013-12-07 15:49:16 +00:00
release do not use capsicum when building picobsd images 2014-01-06 08:09:19 +00:00
rescue - Trim an unused and bogus Makefile for mount_smbfs. 2013-06-28 21:00:08 +00:00
sbin Check if the given argument to 'gpart add' is actually a geom device and 2014-01-09 20:06:14 +00:00
secure Unbreak the WITHOUT_KERBEROS build and try to reduce the odds of a 2013-09-23 20:35:54 +00:00
share Allow tests to provide a Kyuafile when they relied on auto-generation. 2014-01-10 10:36:14 +00:00
sys Simplify inet alias handling code: if we're adding/removing alias which 2014-01-10 12:13:55 +00:00
tests Install category Kyuafiles from their category directories. 2013-11-08 14:29:06 +00:00
tools Rename definition of IEEE80211_FC1_WEP to IEEE80211_FC1_PROTECTED. 2014-01-08 08:06:56 +00:00
usr.bin find: Fix two more problems with -lname and -ilname: 2014-01-05 23:01:28 +00:00
usr.sbin Fix issue with the virtio descriptor region being truncated 2014-01-09 07:17:21 +00:00
COPYRIGHT Bump copyright year. 2013-12-31 12:18:10 +00:00
LOCKS Explicitly require Security Officer's approval for kernel PRNG bits. 2013-09-17 14:19:05 +00:00
MAINTAINERS pkg_install has been removed on 20131031. 2013-11-09 16:20:42 +00:00
Makefile Remove the armv6eb architecture as it is unused, and almost certainly 2013-09-22 07:30:17 +00:00
Makefile.inc1 Remove aicasm as a build dependency. It made sense when the ahc and ahd 2014-01-07 19:33:17 +00:00
ObsoleteFiles.inc Bump libcam shared library version forgotten in r259397. 2013-12-15 15:51:05 +00:00
README Add the cddl/ directory. 2010-11-14 11:32:56 +00:00
UPDATING Allow tests to provide a Kyuafile when they relied on auto-generation. 2014-01-10 10:36:14 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

cddl		Various commands and libraries under the Common Development
		and Distribution License.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html