Skip to content

Commit

Permalink
lib: default vrf and ns values changed
Browse files Browse the repository at this point in the history
Because 0 value can be a valid value for NS identifier, then default VRF
can not be assigned 0 value. Moreover, in order to avoid changing API to
get VRF_DEFAULT value, both values NS_DEFAULT and VRF_DEFAULT are being
changed accordingly.

Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
  • Loading branch information
pguibert6WIND committed Jan 12, 2018
1 parent 556f003 commit a3da419
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/ns.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,6 @@ enum {

typedef u_int16_t ns_id_t;

/* The default NS ID */
#define NS_DEFAULT 0
#define NS_UNKNOWN UINT16_MAX

/* Default netns directory (Linux) */
#define NS_RUN_DIR "/var/run/netns"

Expand Down
6 changes: 3 additions & 3 deletions lib/vrf.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
#include "vty.h"

/* The default NS ID */
#define NS_DEFAULT 0
#define NS_UNKNOWN UINT16_MAX
#define NS_DEFAULT UINT16_MAX
#define NS_UNKNOWN (UINT16_MAX-1)

/* The default VRF ID */
#define VRF_DEFAULT 0
#define VRF_DEFAULT UINT16_MAX
#define VRF_UNKNOWN UINT32_MAX

/* Pending: May need to refine this. */
Expand Down
3 changes: 0 additions & 3 deletions zebra/zebra_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1890,9 +1890,6 @@ DEFUN (show_vrf,
RB_FOREACH (vrf, vrf_name_head, &vrfs_by_name) {
if (!(zvrf = vrf->info))
continue;
if (!zvrf_id(zvrf))
continue;

vty_out(vty, "vrf %s ", zvrf_name(zvrf));
if (zvrf_id(zvrf) == VRF_UNKNOWN)
vty_out(vty, "inactive");
Expand Down

0 comments on commit a3da419

Please sign in to comment.