diff options
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index f704324d1219..e689496dfd8a 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -3326,6 +3326,27 @@ void proto_unregister(struct proto *prot) | |||
3326 | } | 3326 | } |
3327 | EXPORT_SYMBOL(proto_unregister); | 3327 | EXPORT_SYMBOL(proto_unregister); |
3328 | 3328 | ||
3329 | int sock_load_diag_module(int family, int protocol) | ||
3330 | { | ||
3331 | if (!protocol) { | ||
3332 | if (!sock_is_registered(family)) | ||
3333 | return -ENOENT; | ||
3334 | |||
3335 | return request_module("net-pf-%d-proto-%d-type-%d", PF_NETLINK, | ||
3336 | NETLINK_SOCK_DIAG, family); | ||
3337 | } | ||
3338 | |||
3339 | #ifdef CONFIG_INET | ||
3340 | if (family == AF_INET && | ||
3341 | !rcu_access_pointer(inet_protos[protocol])) | ||
3342 | return -ENOENT; | ||
3343 | #endif | ||
3344 | |||
3345 | return request_module("net-pf-%d-proto-%d-type-%d-%d", PF_NETLINK, | ||
3346 | NETLINK_SOCK_DIAG, family, protocol); | ||
3347 | } | ||
3348 | EXPORT_SYMBOL(sock_load_diag_module); | ||
3349 | |||
3329 | #ifdef CONFIG_PROC_FS | 3350 | #ifdef CONFIG_PROC_FS |
3330 | static void *proto_seq_start(struct seq_file *seq, loff_t *pos) | 3351 | static void *proto_seq_start(struct seq_file *seq, loff_t *pos) |
3331 | __acquires(proto_list_mutex) | 3352 | __acquires(proto_list_mutex) |