From 3eca551fecb96994c076512e6e553d6035030865 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Wed, 10 Jan 2018 14:13:50 +0100 Subject: [PATCH] lib: ns_id_t changed to 32 bit Because the VRF_ID is mapped into 32 bit, and because when NETNS will be the backend of VRF, then the NS identifier must also be encoded as 32 bit. Also, the NS_UNKNOWN value is changed accordingly to UINT32_MAX. Also, the NS_UNKNOWN and NS_DEFAULT values are removed from zebra_ns.h and kept on ns.h header file. Signed-off-by: Philippe Guibert --- lib/ns.h | 5 +++-- zebra/zebra_ns.h | 3 --- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ns.h b/lib/ns.h index c492d6600b..79b4cab04d 100644 --- a/lib/ns.h +++ b/lib/ns.h @@ -25,10 +25,11 @@ #include "openbsd-tree.h" #include "linklist.h" -typedef u_int16_t ns_id_t; +typedef u_int32_t ns_id_t; -/* The default NS ID */ +/* the default NS ID */ #define NS_DEFAULT 0 +#define NS_UNKNOWN UINT32_MAX /* Default netns directory (Linux) */ #define NS_RUN_DIR "/var/run/netns" diff --git a/zebra/zebra_ns.h b/zebra/zebra_ns.h index 0c340d8d59..5d90b9be67 100644 --- a/zebra/zebra_ns.h +++ b/zebra/zebra_ns.h @@ -57,9 +57,6 @@ struct zebra_ns { #endif /* HAVE_RTADV */ }; -#define NS_DEFAULT 0 -#define NS_UNKNOWN UINT16_MAX - struct zebra_ns *zebra_ns_lookup(ns_id_t ns_id); int zebra_ns_init(void); -- 2.39.5