summaryrefslogtreecommitdiff
path: root/ospfd
diff options
context:
space:
mode:
Diffstat (limited to 'ospfd')
-rw-r--r--ospfd/ospf_neighbor.c4
-rw-r--r--ospfd/ospf_opaque.c6
2 files changed, 6 insertions, 4 deletions
diff --git a/ospfd/ospf_neighbor.c b/ospfd/ospf_neighbor.c
index a58bd93b6e..a9247dd0ec 100644
--- a/ospfd/ospf_neighbor.c
+++ b/ospfd/ospf_neighbor.c
@@ -402,12 +402,14 @@ void ospf_renegotiate_optional_capabilities(struct ospf *top)
struct ospf_neighbor *ospf_nbr_lookup(struct ospf_interface *oi, struct ip *iph,
struct ospf_header *ospfh)
{
+ struct in_addr srcaddr = iph->ip_src;
+
if (oi->type == OSPF_IFTYPE_VIRTUALLINK
|| oi->type == OSPF_IFTYPE_POINTOPOINT)
return (ospf_nbr_lookup_by_routerid(oi->nbrs,
&ospfh->router_id));
else
- return (ospf_nbr_lookup_by_addr(oi->nbrs, &iph->ip_src));
+ return (ospf_nbr_lookup_by_addr(oi->nbrs, &srcaddr));
}
static struct ospf_neighbor *ospf_nbr_add(struct ospf_interface *oi,
diff --git a/ospfd/ospf_opaque.c b/ospfd/ospf_opaque.c
index 147773ce23..a989b8468c 100644
--- a/ospfd/ospf_opaque.c
+++ b/ospfd/ospf_opaque.c
@@ -430,9 +430,9 @@ void ospf_delete_opaque_functab(uint8_t lsa_type, uint8_t opaque_type)
/* Cleanup internal control information, if it
* still remains. */
if (functab->oipt != NULL) {
+ free_opaque_info_owner(functab->oipt);
free_opaque_info_per_type(
functab->oipt);
- free_opaque_info_owner(functab->oipt);
}
/* Dequeue listnode entry from the list. */
@@ -554,8 +554,8 @@ register_opaque_info_per_type(struct ospf_opaque_functab *functab,
case OSPF_OPAQUE_AS_LSA:
top = ospf_lookup_by_vrf_id(new->vrf_id);
if (new->area != NULL && (top = new->area->ospf) == NULL) {
- free_opaque_info_per_type((void *)oipt);
free_opaque_info_owner(oipt);
+ free_opaque_info_per_type(oipt);
oipt = NULL;
goto out; /* This case may not exist. */
}
@@ -567,8 +567,8 @@ register_opaque_info_per_type(struct ospf_opaque_functab *functab,
EC_OSPF_LSA_UNEXPECTED,
"register_opaque_info_per_type: Unexpected LSA-type(%u)",
new->data->type);
- free_opaque_info_per_type((void *)oipt);
free_opaque_info_owner(oipt);
+ free_opaque_info_per_type(oipt);
oipt = NULL;
goto out; /* This case may not exist. */
}