Merge pull request #3802 from pguibert6WIND/ospfv3_misc_fixes

Ospfv3 misc fixes
This commit is contained in:
David Lamparter 2019-02-18 13:13:58 +01:00 committed by GitHub
commit 5243b754dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 1 deletions

View File

@ -1022,3 +1022,16 @@ void ospf6_area_init(void)
install_element(OSPF6_NODE, &area_filter_list_cmd); install_element(OSPF6_NODE, &area_filter_list_cmd);
install_element(OSPF6_NODE, &no_area_filter_list_cmd); install_element(OSPF6_NODE, &no_area_filter_list_cmd);
} }
void ospf6_area_interface_delete(struct ospf6_interface *oi)
{
struct ospf6_area *oa;
struct listnode *node, *nnode;
if (!ospf6)
return;
for (ALL_LIST_ELEMENTS(ospf6->area_list, node, nnode, oa))
if(listnode_lookup(oa->if_list, oi))
listnode_delete(oa->if_list, oi);
}

View File

@ -132,5 +132,7 @@ extern void ospf6_area_show(struct vty *, struct ospf6_area *);
extern void ospf6_area_plist_update(struct prefix_list *plist, int add); extern void ospf6_area_plist_update(struct prefix_list *plist, int add);
extern void ospf6_area_config_write(struct vty *vty); extern void ospf6_area_config_write(struct vty *vty);
extern void ospf6_area_init(void); extern void ospf6_area_init(void);
struct ospf6_interface;
extern void ospf6_area_interface_delete(struct ospf6_interface *oi);
#endif /* OSPF_AREA_H */ #endif /* OSPF_AREA_H */

View File

@ -269,6 +269,9 @@ void ospf6_interface_delete(struct ospf6_interface *oi)
ospf6_bfd_info_free(&(oi->bfd_info)); ospf6_bfd_info_free(&(oi->bfd_info));
/* disable from area list if possible */
ospf6_area_interface_delete(oi);
XFREE(MTYPE_OSPF6_IF, oi); XFREE(MTYPE_OSPF6_IF, oi);
} }

View File

@ -43,6 +43,7 @@
#include "ospf6d.h" #include "ospf6d.h"
#include "ospf6_top.h" #include "ospf6_top.h"
#include "ospf6_message.h" #include "ospf6_message.h"
#include "ospf6_network.h"
#include "ospf6_asbr.h" #include "ospf6_asbr.h"
#include "ospf6_lsa.h" #include "ospf6_lsa.h"
#include "ospf6_interface.h" #include "ospf6_interface.h"
@ -84,8 +85,10 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
frr_early_fini(); frr_early_fini();
if (ospf6) if (ospf6) {
ospf6_delete(ospf6); ospf6_delete(ospf6);
ospf6 = NULL;
}
bfd_gbl_exit(); bfd_gbl_exit();
@ -97,6 +100,7 @@ static void __attribute__((noreturn)) ospf6_exit(int status)
ospf6_asbr_terminate(); ospf6_asbr_terminate();
ospf6_lsa_terminate(); ospf6_lsa_terminate();
ospf6_serv_close();
/* reverse access_list_init */ /* reverse access_list_init */
access_list_reset(); access_list_reset();

View File

@ -73,6 +73,15 @@ static void ospf6_set_checksum(void)
#endif /* DISABLE_IPV6_CHECKSUM */ #endif /* DISABLE_IPV6_CHECKSUM */
} }
void ospf6_serv_close(void)
{
if (ospf6_sock > 0) {
close(ospf6_sock);
ospf6_sock = -1;
return;
}
}
/* Make ospf6d's server socket. */ /* Make ospf6d's server socket. */
int ospf6_serv_sock(void) int ospf6_serv_sock(void)
{ {
@ -163,6 +172,7 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
assert(dst); assert(dst);
assert(*ifindex); assert(*ifindex);
memset(&cmsgbuf, 0, sizeof(cmsgbuf));
scmsgp = (struct cmsghdr *)&cmsgbuf; scmsgp = (struct cmsghdr *)&cmsgbuf;
pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp)); pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp));
memset(&dst_sin6, 0, sizeof(struct sockaddr_in6)); memset(&dst_sin6, 0, sizeof(struct sockaddr_in6));

View File

@ -26,6 +26,7 @@ extern struct in6_addr allspfrouters6;
extern struct in6_addr alldrouters6; extern struct in6_addr alldrouters6;
extern int ospf6_serv_sock(void); extern int ospf6_serv_sock(void);
extern void ospf6_serv_close(void);
extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option); extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option);
extern int ospf6_sendmsg(struct in6_addr *, struct in6_addr *, ifindex_t *, extern int ospf6_sendmsg(struct in6_addr *, struct in6_addr *, ifindex_t *,