Go to file
Thibaut Collet ee2f2c23ca zebra: fix crash when interface vrf changes
This crash occurs only with netns implementation.
vrf meaning is different regarging its implementation (netns or
vrf-lite)

- With vrf-lite implementation vrf is a property of the interface that
  can be changed as the speed or the state (iproute2 command: "ip link
  set dev IF_NAME master VRF_NAME"). All interfaces of the system are in
  the same netns and so interface name is unique.
- With netns implementation vrf is a characteristic of the interface
  that CANNOT be changed: it is the id of the netns where the interface
  is located. To change the vrf of an interface (iproute2 command to
  move an interface "ip netns exec VRF_NAME1 ip link set dev IF_NAME
  netns VRF_NAME2") the interface is deleted from the old vrf and
  created in the new vrf.
  Interface name is not unique, the same name can be present in the
  different netns (typically the lo interface) and search of interface
  must be done by the tuple (interface name, netns id).

Current tests on the vrf implementation (vrf-lite or netns) are not
sufficient. In some cases (for example when an interface is moved from
a vrf X to the default vrf and then move back to VRF X) we can have a
corruption message and then a crash of zebra.

To avoid this corruption test on the vrf implementation, needed when an
interface changes, has been rewritten:
- For all interface changes except deletion the if_get_by_name function,
  that checks if an interface exists and creates or updates it if
  needed, is changed:
    * The vrf-lite implementation is unchanged: search of the interface
      is based only on the name and update the vrf-id if needed.
    * The netns implementation search of the interface is based on the
      (name, vrf-id) tuple and interface is created if not found, the
      vrf-id is never updated.
- deletion of an interface (reception of a RTM_DELLINK netlink message):
    * The vrf-lite implementation is unchanged: the interface
      information are cleared and the interface is moved to the default
      vrf if it does not belong to (to allow vrf deletion)
    * The netns implementation is changed: only the interface
      information are cleared and the interface stays in its vrf to
      avoid conflict with interface with the same name in the default
      vrf.

This implementation reverts (partially or totally):
commit 393ec5424e ("zebra: fix missing node attribute set in ifp")
commit e9e9b1150f ("lib: create interface even if name is the same")
commit 9373219c67 ("zebra: improve logs when replacing interface to an
other netns")
Fixes: b53686c52a ("zebra: delete interface that disappeared")

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-30 14:37:59 +02:00
alpine alpine: add unit tests to build 2018-06-14 10:27:24 -07:00
babeld *: rename ferr_zlog -> flog_err_sys 2018-08-14 20:02:05 +00:00
bfdd bfdd: fix coverity scan issue (CID 1472622) 2018-08-16 18:33:32 -03:00
bgpd *: pthread set name abstraction 2018-08-29 15:41:54 -07:00
debianpkg build: drop unused SMUX client OID MIBs 2018-08-25 02:21:10 +02:00
doc Merge pull request #2917 from opensourcerouting/doc-devel-openwrt 2018-08-29 11:39:07 -04:00
docker unit tests: support code coverage instrumentation and reports 2018-07-04 11:06:11 -07:00
eigrpd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
fpm build: clean up BUILT_SOURCES 2017-08-04 11:13:55 +02:00
gdb gdb: Add a directory of files with gdb macros 2016-05-26 15:33:30 +00:00
include include: add netlink.h to our build system 2018-06-21 08:07:30 -04:00
init build: delete .cvsignore files 2011-12-13 14:27:01 +04:00
isisd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
ldpd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
lib zebra: fix crash when interface vrf changes 2018-08-30 14:37:59 +02:00
m4 build: non-recursive auxiliary directories 2017-07-31 23:03:30 +02:00
nhrpd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
ospf6d *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
ospfclient ospfd: Remove unused function 2018-08-21 08:40:51 -04:00
ospfd ospfd: adaptations to handle vrf alias 2018-08-28 16:23:50 +02:00
pbrd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
pimd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
pkgsrc *: Remove cvs control points 2017-12-05 17:28:12 -05:00
ports pimd: merge pimd as of 2015-01-19 2016-05-25 20:38:32 -04:00
python lib, python: DEFPY_ATTR, DEFPY_HIDDEN 2018-04-10 12:19:03 -04:00
qpb *: use C99 standard fixed-width integer types 2018-03-27 15:13:34 -04:00
redhat bfdd: wire to the build process 2018-08-08 18:24:58 -03:00
ripd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
ripngd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
sharpd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
snapcraft snapcraft: Add RPKI to snap package 2018-08-18 13:33:01 -07:00
solaris gitignore: update references to FRR 2017-07-12 11:55:04 -05:00
staticd *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
tests *: add a vrf update hook to be informed of the vrf name 2018-08-28 16:23:50 +02:00
tools *: use frr_elevate_privs() (1/2: coccinelle) 2018-08-14 20:02:05 +00:00
vtysh bgpd: fix rpki exit command 2018-08-23 16:10:12 +00:00
watchfrr watchfrr: fix global restart 2018-08-25 18:17:24 +02:00
zebra zebra: fix crash when interface vrf changes 2018-08-30 14:37:59 +02:00
.clang-format lib: import new JSON iteration macro 2018-08-08 18:01:20 -03:00
.dir-locals.el .dir-locals.el: show trailing whitespace 2017-11-07 12:05:09 -05:00
.dockerignore alpine packaging: build packages and base image directly from git 2018-04-04 10:05:44 -07:00
.gitignore *: globally ignore clippy-generated source 2018-03-09 17:52:15 -05:00
AUTHORS Initial revision 2002-12-13 20:15:29 +00:00
bootstrap.sh autoreconf -i 2007-02-06 19:28:28 +00:00
buildtest.sh config: switch a few references to say FRR 2017-07-12 11:25:33 -05:00
ChangeLog Rename: freerangerouting --> frrouting 2017-03-30 14:24:05 -04:00
common.am *: disable all sanitizers for clippy build 2018-06-08 17:22:13 +00:00
configure.ac lib: remove Linux 2.4 TCP-MD5 support 2018-08-25 02:56:05 +02:00
COPYING *: make consistent & update GPLv2 file headers 2017-05-15 16:37:41 +02:00
COPYING-LGPLv2.1 build: remove LGPL v2.0, add LGPL v2.1 2016-11-15 17:19:38 +09:00
defaults.h *: reindent 2017-07-17 14:04:07 +02:00
Makefile.am bfdd: wire to the build process 2018-08-08 18:24:58 -03:00
NEWS release: 0.99.24 2016-06-03 15:56:44 -04:00
README frr: fix typo in README 2018-05-14 11:06:27 -04:00
stamp-h.in Initial revision 2002-12-13 20:15:29 +00:00

FRRouting is free software that implements and manages various IPv4 and IPv6
routing protocols.

Currently FRRouting supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, RIPng,
IS-IS, PIM-SM/MSDP, LDP and Babel as well as very early support for EIGRP and
NHRP.

See doc/user/bugs.rst for information on how to report bugs.

See doc/developer/workflow.rst for information on contributing.

See the file COPYING for copying conditions.

Public email discussion can be found at https://lists.frrouting.org/listinfo

Our public slack channel is at https://frrouting.slack.com