Commit Graph

294 Commits

Author SHA1 Message Date
Russ White
8db933928f
Merge pull request #4959 from pguibert6WIND/zebra_inform_layer
zebra: inform upper layer error when reading correct speed interface
2019-09-24 11:46:13 -04:00
vdhingra
14a4d9d047 Zebra: Rectifying the log messages.
This change addresses the following :
1. Ensures zlog_debug should be under DEBUG macro check
2. Ensures zlog_err and zlog_warn wherever applicable.
3. Removed few posivite logs from fpm handling, whose frequency is high.

Signed-off-by: vishaldhingra <vdhingra@vmware.com>
2019-09-19 02:59:04 -07:00
Julien Floret
594c287816 zebra: inform upper layer error when reading correct speed interface
speed interface is done 15 seconds after interface creation. during that
time, the vrf or the interface may have disappeared. to protect this,
return an error in case it is not possible to create a vrf socket or it
is not possible to get speed of an interface because of a missing
device.

Signed-off-by: Julien Floret <julien.floret@6wind.com>
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-09-17 18:38:42 +02:00
Donald Sharp
dec2a1469f
Merge pull request #4812 from pogojotz/fix-destination-multi-use
zebra: Do not use connection dest for bcast
2019-08-26 09:25:17 -04:00
Juergen Werner
0f3af7386e zebra: Do not use connection dest for bcast
The `destination` field of the connection structure was used to store
the broadcast address, if the connection was not p2p. This multipurpose
is not very evident and the benefits over calculating the bcast address
on the fly minimal.

Signed-off-by: Juergen Werner <juergen@opensourcerouting.org>
2019-08-18 18:54:46 +02:00
Dinesh G Dutt
eb4a93fb09 zebra: Display master interface names, not ifindices
When displaying the master interface's information in "show interface",
    the display is currently the ifindex of the master interface. Make it
    display the name as well as that is more useful than the name.

    Signed-off-by: Dinesh G Dutt<5016467+ddutt@users.noreply.github.com>
2019-08-13 16:28:16 +00:00
Donald Sharp
b5046a3c50 zebra: Remove repeated enqueueing of system routes for rethinking
The code as written before this code change point would enqueue
every system route type to be refigured when we have an
interface event.  I believe this was to originally handle bugs
in the way nexthop tracking was handled, mainly that if you keep
asking the question you'll eventually get the right answer.

Modify the code to not do this, we have fixed nexthop tracking
to not be so brain dead and to know when it needs to refigure
a route that it is tracking.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-29 11:39:06 -04:00
Donald Sharp
8f08b1cc31 zebra: Modify way we query for inteface speed
Initial commit of understanding interface speed changes
on startup was this commit:

dc7b3caefb

Effectively we had encountered situations on system startup
where the interface speed for a device was not properly setup
when zebra learns about the interface ( Imagine a bond being
brought up and the controlling software creating the bond
is not fast given system load, the bond's speed changes
upwards for each interface added ).

The initial workup on this was to allow a 15 second window
and then just reread the interface speed.  We've since noticed
that under heavy system load on startup this is not always sufficient.

So modify the code to wait the 15 seconds and then check the interfaces
speed.  If the interfaces speed is still MAX_UINT32T or it has changed
let's wait a bit longer and try again.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-07-13 15:42:41 -04:00
Donald Sharp
a36898e755
Revert "Ospf missing interface handling 2" 2019-06-23 19:46:39 -04:00
Donald Sharp
a12bb225a6
Merge pull request #3775 from pguibert6WIND/ospf_missing_interface_handling_2
Ospf missing interface handling 2
2019-06-22 13:35:45 -04:00
Don Slice
a5c7809c8b zebra: add ability to "show interface vrf all brief"
Found that the "show interface brief" command was missing the
ability to specify all vrfs.   Added that capability via this
fix.

Ticket: CM-25139
Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-06-17 17:18:53 +00:00
David Lamparter
7e5cfaea0a zebra: fix stats printing formats
Signed-off-by: David Lamparter <equinox@diac24.net>
2019-06-12 19:35:43 +02:00
Philippe Guibert
a41c4e1b1f *: change interface structure, from vrf_id to vrf
Field vrf_id is replaced by the pointer of the struct vrf *.
For that all other code referencing to (interface)->vrf_id is replaced.
This work should not change the behaviour.
It is just a continuation work toward having an interface API handling
vrf pointer only.

some new generic functions are created in vrf:
vrf_to_id, vrf_to_name,

a zebra function is also created:
zvrf_info_lookup

an ospf function is also created:
ospf_lookup_by_vrf

it is to be noted that now that interface has a vrf pointer, some more
optimisations could be thought through all the rest of the code. as
example, many structure store the vrf_id. those structures could get
the exact vrf structure if inherited from an interface vrf context.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 14:10:28 +02:00
Philippe Guibert
da85f5e038 lib, bgpd, ospfd, pimd, zebra, rip, ripng, bfd: change if_update_to_new_vrf() api
vrf_id parameter is replaced with struct vrf * parameter. It is
needed to create vrf structure before entering in the fuction.
an error is generated in case the vrf parameter is missing.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:58 +02:00
Philippe Guibert
8205b1b455 zebra, lib: upon entering interface, create vrf context
the interface search is based on vrfs. As at startup, some interfaces
may be configured, there is need to have vrfs contexts present. A macro
is being appended with an extra parameter that permits create a vrf and
return the context. This macro is also used by some show routines, but
will not create vrfs, because that extra parameter will be set to false,
on that case.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:58 +02:00
Philippe Guibert
ac6c2a11a6 lib: create interface upon accessing interface NB API.
Upon accessing interface NB API, the interface is created, if the vrf
is available. the commit does not change the behaviour, since at this
commit, this is not yet possible to have vrf contexts, while zebra did
not connect to daemons. However, that commit adds some work, so that it
will be possible to work on a vrf context, without having the vrf_id
completely resolved. for instance, if we suppose a vrf is created by
command 'vrf TOTO' in the starting configuration of a daemon, then 'interface
TITI vrf TOTO' will permit to create interface TITI within vrf TOTO.

the macro VRF_GET_INSTANCE will return the vrf context, if available or
not.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:58 +02:00
Philippe Guibert
f11e98eca3 *: change if_lookup_by_name() api with vrf
the vrf_id parameter is replaced by struct vrf * parameter.
this impacts most of the daemons that look for an interface based on the
name and the vrf identifier.
Also, it fixes 2 lookup calls in zebra and sharpd, where the vrf_id was
ignored until now.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2019-06-12 08:37:54 +02:00
Quentin Young
d8d78e2ca9 zebra: gracefully fail to protodown on bsd
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Quentin Young
c3bd894e4d vrrpd: protodown macvlan in backup state
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-05-17 00:27:08 +00:00
Donald Sharp
ba5165eccc zebra: Modify how we display/store os description
The alias/description of an interface in linux was being
used to override the internal description.  As such let's
fix the display to keep track of both if we have it.

Config in FRR:
!
interface docker0
 description another combination
!
interface enp3s0
 description BAMBOOZLE ME WILL YOU
!

Config in linux:
sharpd@robot ~/f/zebra> ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    alias This is the loopback you cabbage
2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 74:d0:2b:9c:16:eb brd ff:ff:ff:ff:ff:ff
    alias HI HI HI

Now the 'show int descr' command:
robot# show int description
Interface       Status  Protocol  Description
docker0         up      down      another combination
enp3s0          up      up        BAMBOOZLE ME WILL YOU
                                  HI HI HI
lo              up      up        This is the loopback you cabbage

Fixes: #4191
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-04-25 04:22:43 -04:00
Donald Sharp
8f19bc1c69
Merge pull request #3786 from mjstapp/dplane_intf
zebra: async interface address programming
2019-04-22 15:29:02 -04:00
Mark Stapp
0f1f6ce4d6 zebra: Dplane interface address install for non-netlink
ioctl-based platform code for interface address installation

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-22 13:49:27 -04:00
Mark Stapp
6416880328 zebra: Use dplane for interface addresses (netlink)
Start using the dataplane for interface-address programming,
on netlink platforms. Other platforms just stubbed at this
point.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2019-04-22 13:49:27 -04:00
Anuradha Karuppiah
aa0677b4b6 zebra: use "mcast group" instead of just mcast in show and logs
Fixup done in response to Jafar's review comments.

root@act-7726-03:~# vtysh -c  "show interface vxlan1000111"
Interface vxlan1000111 is up, line protocol is up
  Link ups:       0    last: (never)
  Link downs:     0    last: (never)
  PTM status: disabled
  vrf: default
  index 95 metric 0 mtu 1500 speed 0
  flags: <UP,BROADCAST,RUNNING,MULTICAST>
  Type: Ethernet
  HWaddr: 7e:1d:c1:d5:d1:cc
  Interface Type Vxlan
  VxLAN Id 1000111 VTEP IP: 6.0.0.28 Access VLAN Id 111
  Mcast Group 239.1.1.111 >>>>>>>>>>
  Master (bridge) ifindex 99
root@act-7726-03:~#

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-21 07:24:20 -07:00
Anuradha Karuppiah
d7fe235c1b zebra: process mcast-grp rxed in the vxlan-device
BUP mcast IP address is maintained per-vxlan-device.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
2019-04-20 08:33:19 -07:00
David Lamparter
0fe29323f5
Merge pull request #3723 from slrz/zebra-rtadv-add-rfc8106-support
zebra: add support for IPv6 RA options for DNS configuration (RFC8106)
2019-02-12 14:30:00 +01:00
Lars Seipel
3eb4fbb0f5 zebra: support DNS configuration options in rtadv
Add support for the RDNSS and DNSSL router advertisement
options described in RFC 8106.

Signed-off-by: Lars Seipel <ls@slrz.net>
2019-02-02 19:10:19 +01:00
Donald Sharp
3801e7646c zebra: Move the master thread handler to the zrouter structure
The master thread handler is really part of the zrouter structure.
So let's move it over to that.  Eventually zserv.h will only be
used for zapi messages.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-01-31 09:20:46 -05:00
David Lamparter
185fd9ca77
Merge pull request #3288 from nitinsoniism/show_intf_brief
zebra: Support "brief" output for "show interface"
2019-01-29 16:23:36 +01:00
Nitin Soni
49548752e1 zebra: Support "brief" output for "show interface"
"brief" output for "show interface" helps when we have to quickly check
important information like ip address, vrf etc. This prints
information in the easy to read tabular format. Currently it prints oper
status, ifname, vrf, ipv4 and ipv6 addresses.

Ticket: CM-9109
Signed-off-by: Nitin Soni <nsoni@cumulusnetworks.com>
2019-01-08 02:19:58 -08:00
David Lamparter
d482ae5912
Merge pull request #3326 from qlyoung/fix-lla-reinstallation
zebra: force neighbor entry reinstallation
2018-11-15 14:58:51 +01:00
Quentin Young
2b6aabe067 zebra: force neighbor entry reinstallation
Even if the neighbor entry we want already exists, force its
reinstallation to ensure that it's valid. This will now take place when
we request an update of the neighbor entry.

Ticket: CM-22604
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-28 11:22:23 +00:00
Dinesh Dutt
b9368db98c zebra: Let zebra know about bond and blond slave intf types
The interface type can be a bond or a bond slave, add some
code to note this and to display it as part of a show interface
command.

Signed-off-by: Dinesh Dutt <didutt@gmail.com>
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-11-12 11:40:33 -05:00
Quentin Young
b1bd101570 zebra: cleanup some leftovers from removed cmds
* Remove vestigial 'secondary' option for v6 address installation
  functions
* Update comments mentioning it

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-10-28 07:19:59 +00:00
David Lamparter
6a154c8812 *: list_delete_and_null() -> list_delete()
Signed-off-by: David Lamparter <equinox@diac24.net>
2018-10-02 11:40:52 +02:00
Russ White
82977e243a
Merge pull request #3020 from donaldsharp/global_5549
Allow v6 global addresses to be nexthops for v4 addresses in bgp
2018-09-24 09:55:50 -04:00
Donald Sharp
8e59a4027f zebra: Use actual memory type for zebra info pointer
Use MTYPE_ZINFO for the `struct zebra_if` data structure
instead of using MTYPE_TMP.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-19 11:35:43 -04:00
Donald Sharp
ee98d1f11c zebra: Abstract mac neigh installation into it's own function
Abstract the mac neigh installation for 169.254.0.1 into
it's own function that we can pass the mac address into.
This will allow a future commit to use this functionality
when we have the appropriate mac address from reading
optional attributes of a RA packet.

Signed-off-by: Donald Sharp <sharpd@cumuusnetworks.com>
2018-09-19 11:25:22 -04:00
Donald Sharp
98efddf1d7 zebra: Cleanup comments to appropriately match style
The block comments from a couple commits were not following
proper style.  Fix.

Fix SA warning that had snuck in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2018-09-18 10:44:59 -04:00
Anuradha Karuppiah
520ebf72b2 zebra: resolve link dependencies post nldump
Netdevices are not sorted in any fashion by the kernel during the initial
interface nldump. So you can get an upper device (such as an SVI) before
its corresponding lower device (bridge).

To fix this problem we skip resolving link dependencies during handling of
nldump notifications. Resolving instead at the end (when all the devices
are present)

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>

Ticket: CM-22388, CM-21796
Reviewed By: CCR-7845
Testing Done:
1. verified on a setup with missing linkages
2. automation - evpn-min
2018-09-18 10:41:53 -04:00
David Lamparter
2fa3198399
Merge pull request #3023 from qlyoung/ultimate-warning-reference-cards-rename
warning reference cards rename
2018-09-14 17:35:58 +02:00
Quentin Young
450971aa99 *: LIB_[ERR|WARN] -> EC_LIB
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:34:28 +00:00
Quentin Young
e914ccbe9c zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRA
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-13 19:23:29 +00:00
F. Aragon
7fe96307ee
bgpd lib ospf6d pbrd tests zebra: shadowing fixes
This fixes all remaining local variable shadowing cases

Signed-off-by: F. Aragon <paco@voltanet.io>
2018-09-13 17:37:08 +02:00
David Lamparter
e991eff5b5 Merge remote-tracking branch 'frr/master' into warnings
Conflicts:
	zebra/if_ioctl_solaris.c
	zebra/rtread_getmsg.c

Signed-off-by: David Lamparter <equinox@diac24.net>
2018-09-12 21:58:39 +02:00
Russ White
88f47ef365
Merge pull request #2944 from thbtcllt/master
fix zebra crash when a vrf interface changes with netns implementation for vrf
2018-09-11 11:33:27 -04:00
Quentin Young
9df414feeb zebra: flog_warn conversion
Convert Zebra to user error subsystem.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2018-09-06 20:56:38 +00:00
Thibaut Collet
c3568c4d1a zebra/lib: code cleaning
Remove useless parenthesis and explicit cast.
Remove redundant code.

Signed-off-by: Thibaut Collet <thibaut.collet@6wind.com>
2018-09-06 07:48:12 +02:00
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
Philippe Guibert
0e4864eaf0 zebra: do not update link if interface is veth interface
when interface is a virtual ethernet interface, then there is no need to
update link pointer of interface.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
2018-08-29 11:34:08 +02:00