Commit 8ed80a16 authored by Sridhar Samudrala's avatar Sridhar Samudrala Committed by Sridhar Samudrala

[SCTP] Register a notifier for v6 address additions/deletions.

parent e8120ed0
...@@ -394,11 +394,11 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr) ...@@ -394,11 +394,11 @@ static sctp_scope_t sctp_v4_scope(union sctp_addr *addr)
return retval; return retval;
} }
/* Event handler for inet device events. /* Event handler for inet address addition/deletion events.
* Basically, whenever there is an event, we re-build our local address list. * Basically, whenever there is an event, we re-build our local address list.
*/ */
static int sctp_netdev_event(struct notifier_block *this, unsigned long event, static int sctp_inetaddr_event(struct notifier_block *this, unsigned long event,
void *ptr) void *ptr)
{ {
long flags __attribute__ ((unused)); long flags __attribute__ ((unused));
...@@ -556,9 +556,9 @@ static struct sctp_pf sctp_pf_inet = { ...@@ -556,9 +556,9 @@ static struct sctp_pf sctp_pf_inet = {
.af = &sctp_ipv4_specific, .af = &sctp_ipv4_specific,
}; };
/* Registration for netdev events. */ /* Notifier for inetaddr addition/deletion events. */
struct notifier_block sctp_netdev_notifier = { struct notifier_block sctp_inetaddr_notifier = {
.notifier_call = sctp_netdev_event, .notifier_call = sctp_inetaddr_event,
}; };
/* Socket operations. */ /* Socket operations. */
...@@ -785,7 +785,10 @@ int sctp_init(void) ...@@ -785,7 +785,10 @@ int sctp_init(void)
INIT_LIST_HEAD(&sctp_proto.local_addr_list); INIT_LIST_HEAD(&sctp_proto.local_addr_list);
sctp_proto.local_addr_lock = SPIN_LOCK_UNLOCKED; sctp_proto.local_addr_lock = SPIN_LOCK_UNLOCKED;
register_inetaddr_notifier(&sctp_netdev_notifier); /* Register notifiers for inet and inet6 address events. */
register_inetaddr_notifier(&sctp_inetaddr_notifier);
register_inet6addr_notifier(&sctp_inetaddr_notifier);
sctp_get_local_addr_list(&sctp_proto); sctp_get_local_addr_list(&sctp_proto);
return 0; return 0;
...@@ -815,8 +818,11 @@ void sctp_exit(void) ...@@ -815,8 +818,11 @@ void sctp_exit(void)
* up all the remaining associations and all that memory. * up all the remaining associations and all that memory.
*/ */
/* Unregister notifiers for inet and inet6 address events. */
unregister_inetaddr_notifier(&sctp_inetaddr_notifier);
unregister_inet6addr_notifier(&sctp_inetaddr_notifier);
/* Free the local address list. */ /* Free the local address list. */
unregister_inetaddr_notifier(&sctp_netdev_notifier);
sctp_free_local_addr_list(&sctp_proto); sctp_free_local_addr_list(&sctp_proto);
/* Free the control endpoint. */ /* Free the control endpoint. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment