summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_netns_id.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* zebra: dead code (Coverity 1465497)F. Aragon2018-10-021-35/+25
| | | | | | | | | | | The condition in the do/while is always false because 'return_nsid' cannot reach the end of the loop with 'return_nsid' having a different value than NS_UNKNOWN. Because of that, the condition can be replaced with 0 (false). Also, the loop can be removed because the two assignments made at the end of the loop before the condition check are not used (detected via Clang, afterwards). Signed-off-by: F. Aragon <paco@voltanet.io>
* zebra: Start abstraction of zebra_dplane_info for context passingMark Stapp2018-09-201-1/+2
| | | | | | | | | Reduce or eliminate use of global zebra_ns structs in a couple of netlink/kernel code paths, so that those paths can potentially be made asynch eventually. Signed-off-by: Mark Stapp <mjs@voltanet.io> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* *: style for EC replacementsQuentin Young2018-09-131-1/+1
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: LIB_[ERR|WARN] -> EC_LIBQuentin Young2018-09-131-5/+5
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: ZEBRA_[ERR|WARN] -> EC_ZEBRAQuentin Young2018-09-131-3/+3
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: flog_warn conversionQuentin Young2018-09-061-2/+3
| | | | | | Convert Zebra to user error subsystem. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename ferr_zlog -> flog_err_sysQuentin Young2018-08-141-9/+10
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* *: rename zlog_fer -> flog_errQuentin Young2018-08-141-7/+7
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra, lib: error references for zebraQuentin Young2018-08-141-11/+18
| | | | Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: flow control (Coverity 1462467 1465497)paco2018-06-211-1/+1
| | | | Signed-off-by: F. Aragon <paco@voltanet.io>
* *: use C99 standard fixed-width integer typesQuentin Young2018-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | The following types are nonstandard: - u_char - u_short - u_int - u_long - u_int8_t - u_int16_t - u_int32_t Replace them with the C99 standard types: - uint8_t - unsigned short - unsigned int - unsigned long - uint8_t - uint16_t - uint32_t Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* zebra: close fd when not neededDonald Sharp2018-03-211-1/+3
| | | | | | | Upon decision that the vrf is not going to be supported by namespaces close the fd. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
* zebra: Fix leaked fd.Donald Sharp2018-03-191-0/+1
| | | | | | | When we detect an error condition, close down the opened fd. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com.
* *: conform with COMMUNITY.md formatting rules, via 'make indent'Lou Berger2018-03-061-45/+48
| | | | Signed-off-by: Lou Berger <lberger@labn.net>
* zebra: upon startup, a NSID is assigned to default netnsPhilippe Guibert2018-02-271-0/+41
| | | | | | | | | | | | | | | | | | when the netns backend is selected for VRF, the default VRF is being assigned a NSID. This avoids the need to handle the case where if the incoming NSID was 0 for a non default VRF, then a specific handling had to be done to keep 0 value for default VRF. In most cases, as the first NETNS to get a NSID will be the default VRF, most probably the default VRF will be assigned to 0, while the other ones will have their value incremented. On some cases, where the NSID is already assigned for NETNS, including default VRF, then the default VRF value will be the one derived from the NSID of default VRF, thus keeping consistency between VRF IDs and NETNS IDs. Default NS is attempted to be created. Actually, some VMs may have the netns feature, but the NS initialisation fails because that folder is not present. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
* zebra: upon NS creation, collect the NSID via netlinkPhilippe Guibert2018-02-271-0/+314
A NS identifier is collected by netlink. This identifier is a 32 bit identifier that is either generated by the kernel (if not set) or manually set by a set netlink command. The commit here is getting the NSID from the newly created NS. If the linux option to create or get a new NSID from the kernel does not exist, then the NSID is locally genrated. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>