Commit 2d43f325 authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller

[SCTP]: Fix inetaddr notifier chain corruption

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5a5246bb
...@@ -78,7 +78,10 @@ ...@@ -78,7 +78,10 @@
#include <asm/uaccess.h> #include <asm/uaccess.h>
extern struct notifier_block sctp_inetaddr_notifier; extern int sctp_inetaddr_event(struct notifier_block *, unsigned long, void *);
static struct notifier_block sctp_inet6addr_notifier = {
.notifier_call = sctp_inetaddr_event,
};
/* ICMP error handler. */ /* ICMP error handler. */
void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
...@@ -983,7 +986,7 @@ int sctp_v6_init(void) ...@@ -983,7 +986,7 @@ int sctp_v6_init(void)
sctp_register_af(&sctp_ipv6_specific); sctp_register_af(&sctp_ipv6_specific);
/* Register notifier for inet6 address additions/deletions. */ /* Register notifier for inet6 address additions/deletions. */
register_inet6addr_notifier(&sctp_inetaddr_notifier); register_inet6addr_notifier(&sctp_inet6addr_notifier);
rc = 0; rc = 0;
out: out:
return rc; return rc;
...@@ -999,6 +1002,6 @@ void sctp_v6_exit(void) ...@@ -999,6 +1002,6 @@ void sctp_v6_exit(void)
inet6_del_protocol(&sctpv6_protocol, IPPROTO_SCTP); inet6_del_protocol(&sctpv6_protocol, IPPROTO_SCTP);
inet6_unregister_protosw(&sctpv6_seqpacket_protosw); inet6_unregister_protosw(&sctpv6_seqpacket_protosw);
inet6_unregister_protosw(&sctpv6_stream_protosw); inet6_unregister_protosw(&sctpv6_stream_protosw);
unregister_inet6addr_notifier(&sctp_inetaddr_notifier); unregister_inet6addr_notifier(&sctp_inet6addr_notifier);
sk_free_slab(&sctpv6_prot); sk_free_slab(&sctpv6_prot);
} }
...@@ -622,7 +622,7 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr) ...@@ -622,7 +622,7 @@ static void sctp_v4_seq_dump_addr(struct seq_file *seq, union sctp_addr *addr)
/* Event handler for inet address addition/deletion 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_inetaddr_event(struct notifier_block *this, unsigned long ev, int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev,
void *ptr) void *ptr)
{ {
unsigned long flags; unsigned long flags;
...@@ -824,7 +824,7 @@ static struct sctp_pf sctp_pf_inet = { ...@@ -824,7 +824,7 @@ static struct sctp_pf sctp_pf_inet = {
}; };
/* Notifier for inetaddr addition/deletion events. */ /* Notifier for inetaddr addition/deletion events. */
struct notifier_block sctp_inetaddr_notifier = { static struct notifier_block sctp_inetaddr_notifier = {
.notifier_call = sctp_inetaddr_event, .notifier_call = sctp_inetaddr_event,
}; };
......
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