diff options
| author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-07-08 14:09:20 -0300 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2021-07-09 07:55:25 -0300 | 
| commit | 1fe59b44fc94337f0b508bc762a401a9dbe9c1a3 (patch) | |
| tree | 8a525db11e5c2b61c3b8cb29b9eb55c4ed9bd6f5 /ospfd/ospf_lsa.h | |
| parent | f45f6a22b052988a6ca3399fde66249e8b6e00cc (diff) | |
lib,ospfd,ospf6d: remove duplicated function
Move `is_default_prefix` variations to `lib/prefix.h` and make the code
use the library version instead of implementing it again.
NOTE
----
The function was split into per family versions to cover all types.
Using `union prefixconstptr` is not possible due to static analyzer
warnings which cause CI to fail.
The specific cases that would cause this failure were:
 - Caller used `struct prefix_ipv4` and called the generic function.
 - `is_default_prefix` with signature using `const struct prefix *` or
   `union prefixconstptr`.
The compiler would complain about reading bytes outside of the memory
bounds even though it did not take into account the `prefix->family`
part.
Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'ospfd/ospf_lsa.h')
| -rw-r--r-- | ospfd/ospf_lsa.h | 1 | 
1 files changed, 0 insertions, 1 deletions
diff --git a/ospfd/ospf_lsa.h b/ospfd/ospf_lsa.h index 3808700ccc..d01dc720ba 100644 --- a/ospfd/ospf_lsa.h +++ b/ospfd/ospf_lsa.h @@ -331,7 +331,6 @@ extern void ospf_lsa_maxage_delete(struct ospf *, struct ospf_lsa *);  extern void ospf_discard_from_db(struct ospf *, struct ospf_lsdb *,  				 struct ospf_lsa *); -extern int is_prefix_default(struct prefix_ipv4 *);  extern int metric_type(struct ospf *, uint8_t, unsigned short);  extern int metric_value(struct ospf *, uint8_t, unsigned short);  | 
