Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fib: Uninitialised pad in the prefix (coverity warning)
[vpp.git]
/
src
/
vnet
/
fib
/
fib_types.c
diff --git
a/src/vnet/fib/fib_types.c
b/src/vnet/fib/fib_types.c
index
44fa463
..
dcb1c3a
100644
(file)
--- a/
src/vnet/fib/fib_types.c
+++ b/
src/vnet/fib/fib_types.c
@@
-18,6
+18,7
@@
#include <vnet/fib/fib_types.h>
#include <vnet/fib/fib_internal.h>
#include <vnet/fib/fib_table.h>
#include <vnet/fib/fib_types.h>
#include <vnet/fib/fib_internal.h>
#include <vnet/fib/fib_table.h>
+#include <vnet/mfib/mfib_types.h>
#include <vnet/mpls/mpls.h>
/*
#include <vnet/mpls/mpls.h>
/*
@@
-88,6
+89,7
@@
fib_prefix_from_ip46_addr (const ip46_address_t *addr,
pfx->fp_len = ((ip46_address_is_ip4(addr) ?
32 : 128));
pfx->fp_addr = *addr;
pfx->fp_len = ((ip46_address_is_ip4(addr) ?
32 : 128));
pfx->fp_addr = *addr;
+ pfx->___fp___pad = 0;
}
void
}
void
@@
-99,6
+101,14
@@
fib_prefix_from_mpls_label (mpls_label_t label,
pfx->fp_len = 21;
pfx->fp_label = label;
pfx->fp_eos = eos;
pfx->fp_len = 21;
pfx->fp_label = label;
pfx->fp_eos = eos;
+ pfx->___fp___pad = 0;
+}
+
+void
+fib_prefix_copy (fib_prefix_t *dst,
+ const fib_prefix_t *src)
+{
+ clib_memcpy(dst, src, sizeof(*dst));
}
int
}
int
@@
-158,6
+168,21
@@
fib_prefix_is_cover (const fib_prefix_t *p1,
return (0);
}
return (0);
}
+u8
+fib_prefix_get_host_length (fib_protocol_t proto)
+{
+ switch (proto)
+ {
+ case FIB_PROTOCOL_IP4:
+ return (32);
+ case FIB_PROTOCOL_IP6:
+ return (128);
+ case FIB_PROTOCOL_MPLS:
+ return (21);
+ }
+ return (0);
+}
+
int
fib_prefix_is_host (const fib_prefix_t *prefix)
{
int
fib_prefix_is_host (const fib_prefix_t *prefix)
{
@@
-609,6
+634,9
@@
unformat_fib_route_path (unformat_input_t * input, va_list * args)
rpath->frp_weight = 1;
rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
}
rpath->frp_weight = 1;
rpath->frp_flags |= FIB_ROUTE_PATH_LOCAL;
}
+ else if (unformat (input, "%U",
+ unformat_mfib_itf_flags, &rpath->frp_mitf_flags))
+ ;
else if (unformat (input, "out-labels"))
{
while (unformat (input, "%U",
else if (unformat (input, "out-labels"))
{
while (unformat (input, "%U",