summaryrefslogtreecommitdiffstats
path: root/ospfd
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:42:03 +0200
committerDonatas Abraitis <donatas.abraitis@gmail.com>2021-07-01 16:44:09 +0200
commit936fbaef4794277a56185c535574df0f2771c117 (patch)
tree22e9f5b8ccaddd165187244bde90fdd61492630c /ospfd
parent*: Replace IPV6_MAX_PREFIXLEN to IPV6_MAX_BITLEN (diff)
downloadfrr-936fbaef4794277a56185c535574df0f2771c117.tar.xz
frr-936fbaef4794277a56185c535574df0f2771c117.zip
*: Replace IPV4_MAX_PREFIXLEN to IPV4_MAX_BITLEN
Just drop IPV4_MAX_PREFIXLEN at all, no need keeping both. Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_asbr.c2
-rw-r--r--ospfd/ospf_interface.c12
-rw-r--r--ospfd/ospf_te.c12
-rw-r--r--ospfd/ospf_ti_lfa.c2
-rw-r--r--ospfd/ospf_zebra.c2
5 files changed, 15 insertions, 15 deletions
diff --git a/ospfd/ospf_asbr.c b/ospfd/ospf_asbr.c
index 2fd195bb6..192dbe4fc 100644
--- a/ospfd/ospf_asbr.c
+++ b/ospfd/ospf_asbr.c
@@ -361,7 +361,7 @@ bool is_valid_summary_addr(struct prefix_ipv4 *p)
return false;
/*Host route shouldn't be configured as summary addres*/
- if (p->prefixlen == IPV4_MAX_PREFIXLEN)
+ if (p->prefixlen == IPV4_MAX_BITLEN)
return false;
return true;
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index b3aba247d..029f929c1 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -188,7 +188,7 @@ struct ospf_interface *ospf_if_table_lookup(struct interface *ifp,
struct ospf_interface *rninfo = NULL;
p = *prefix;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
/* route_node_get implicitely locks */
if ((rn = route_node_lookup(IF_OIFS(ifp), &p))) {
@@ -205,7 +205,7 @@ static void ospf_add_to_if(struct interface *ifp, struct ospf_interface *oi)
struct prefix p;
p = *oi->address;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
apply_mask(&p);
rn = route_node_get(IF_OIFS(ifp), &p);
@@ -223,7 +223,7 @@ static void ospf_delete_from_if(struct interface *ifp,
struct prefix p;
p = *oi->address;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
rn = route_node_lookup(IF_OIFS(oi->ifp), &p);
assert(rn);
@@ -566,7 +566,7 @@ void ospf_free_if_params(struct interface *ifp, struct in_addr addr)
struct route_node *rn;
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.prefix = addr;
rn = route_node_lookup(IF_OIFS_PARAMS(ifp), (struct prefix *)&p);
if (!rn || !rn->info)
@@ -601,7 +601,7 @@ struct ospf_if_params *ospf_lookup_if_params(struct interface *ifp,
struct route_node *rn;
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.prefix = addr;
rn = route_node_lookup(IF_OIFS_PARAMS(ifp), (struct prefix *)&p);
@@ -621,7 +621,7 @@ struct ospf_if_params *ospf_get_if_params(struct interface *ifp,
struct route_node *rn;
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.prefix = addr;
apply_mask_ipv4(&p);
diff --git a/ospfd/ospf_te.c b/ospfd/ospf_te.c
index 333fa6a3a..d95e677f6 100644
--- a/ospfd/ospf_te.c
+++ b/ospfd/ospf_te.c
@@ -1840,7 +1840,7 @@ static void ospf_te_update_subnet(struct ls_ted *ted, struct ls_vertex *vertex,
/**
* Delete Subnet that correspond to the given IPv4 address and export deletion
- * information before removal. Prefix length is fixed to IPV4_MAX_PREFIXLEN.
+ * information before removal. Prefix length is fixed to IPV4_MAX_BITLEN.
*
* @param ted Links State Database
* @param addr IPv4 address
@@ -1852,7 +1852,7 @@ static void ospf_te_delete_subnet(struct ls_ted *ted, struct in_addr addr)
/* Search subnet that correspond to the address/32 as prefix */
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.u.prefix4 = addr;
subnet = ls_find_subnet(ted, p);
@@ -1944,7 +1944,7 @@ static int ospf_te_parse_router_lsa(struct ls_ted *ted, struct ospf_lsa *lsa)
ntohs(rl->link[i].metric));
/* Add corresponding subnet */
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.u.prefix4 = rl->link[i].link_data;
metric = ntohs(rl->link[i].metric);
ospf_te_update_subnet(ted, vertex, p, metric);
@@ -1952,7 +1952,7 @@ static int ospf_te_parse_router_lsa(struct ls_ted *ted, struct ospf_lsa *lsa)
case LSA_LINK_TYPE_STUB:
/* Keep only /32 prefix */
p.prefixlen = ip_masklen(rl->link[i].link_data);
- if (p.prefixlen == IPV4_MAX_PREFIXLEN) {
+ if (p.prefixlen == IPV4_MAX_BITLEN) {
p.family = AF_INET;
p.u.prefix4 = rl->link[i].link_id;
metric = ntohs(rl->link[i].metric);
@@ -2086,12 +2086,12 @@ static void ospf_te_update_remote_asbr(struct ls_ted *ted, struct ls_edge *edge)
/* Update corresponding Subnets */
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.u.prefix4 = attr->standard.local;
ospf_te_update_subnet(ted, edge->source, p, attr->standard.te_metric);
p.family = AF_INET;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
p.u.prefix4 = attr->standard.remote_addr;
ospf_te_update_subnet(ted, vertex, p, attr->standard.te_metric);
diff --git a/ospfd/ospf_ti_lfa.c b/ospfd/ospf_ti_lfa.c
index 59b3b624e..347128a4f 100644
--- a/ospfd/ospf_ti_lfa.c
+++ b/ospfd/ospf_ti_lfa.c
@@ -849,7 +849,7 @@ void ospf_ti_lfa_generate_p_spaces(struct ospf_area *area,
stub_prefix.family = AF_INET;
child_prefix.family = AF_INET;
- child_prefix.prefixlen = IPV4_MAX_PREFIXLEN;
+ child_prefix.prefixlen = IPV4_MAX_BITLEN;
p = ((uint8_t *)root->lsa) + OSPF_LSA_HEADER_SIZE + 4;
lim = ((uint8_t *)root->lsa) + ntohs(root->lsa->length);
diff --git a/ospfd/ospf_zebra.c b/ospfd/ospf_zebra.c
index df112edc6..017915e0e 100644
--- a/ospfd/ospf_zebra.c
+++ b/ospfd/ospf_zebra.c
@@ -138,7 +138,7 @@ static int ospf_interface_address_delete(ZAPI_CALLBACK_ARGS)
ifp = c->ifp;
p = *c->address;
- p.prefixlen = IPV4_MAX_PREFIXLEN;
+ p.prefixlen = IPV4_MAX_BITLEN;
rn = route_node_lookup(IF_OIFS(ifp), &p);
if (!rn) {