mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-05 04:40:21 +00:00
lib: add asserts to appease the SA
I don't believe label can be NULL in any calling path but SA thinks so so let's just assert here to be safe anyway and make it happy. Signed-off-by: Stephen Worley <sworley@nvidia.com>
This commit is contained in:
parent
5313cd6758
commit
1dd3cd10b8
@ -139,6 +139,8 @@ static inline void vni2label(vni_t vni, mpls_label_t *label)
|
||||
{
|
||||
uint8_t *tag = (uint8_t *)label;
|
||||
|
||||
assert(tag);
|
||||
|
||||
tag[0] = (vni >> 16) & 0xFF;
|
||||
tag[1] = (vni >> 8) & 0xFF;
|
||||
tag[2] = vni & 0xFF;
|
||||
@ -149,6 +151,8 @@ static inline vni_t label2vni(const mpls_label_t *label)
|
||||
uint8_t *tag = (uint8_t *)label;
|
||||
vni_t vni;
|
||||
|
||||
assert(tag);
|
||||
|
||||
vni = ((uint32_t)*tag++ << 16);
|
||||
vni |= (uint32_t)*tag++ << 8;
|
||||
vni |= (uint32_t)(*tag & 0xFF);
|
||||
|
Loading…
Reference in New Issue
Block a user