Skip to content

Commit f4a00aa

Browse files
tomratbertdavem330
authored andcommitted
net: Make sock_alloc exportable
Export it for cases where we want to create sockets by hand. Signed-off-by: Tom Herbert <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ff3c44e commit f4a00aa

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

include/linux/net.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ int __sock_create(struct net *net, int family, int type, int proto,
215215
int sock_create(int family, int type, int proto, struct socket **res);
216216
int sock_create_kern(struct net *net, int family, int type, int proto, struct socket **res);
217217
int sock_create_lite(int family, int type, int proto, struct socket **res);
218+
struct socket *sock_alloc(void);
218219
void sock_release(struct socket *sock);
219220
int sock_sendmsg(struct socket *sock, struct msghdr *msg);
220221
int sock_recvmsg(struct socket *sock, struct msghdr *msg, size_t size,

net/socket.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ static const struct inode_operations sockfs_inode_ops = {
533533
* NULL is returned.
534534
*/
535535

536-
static struct socket *sock_alloc(void)
536+
struct socket *sock_alloc(void)
537537
{
538538
struct inode *inode;
539539
struct socket *sock;
@@ -554,6 +554,7 @@ static struct socket *sock_alloc(void)
554554
this_cpu_add(sockets_in_use, 1);
555555
return sock;
556556
}
557+
EXPORT_SYMBOL(sock_alloc);
557558

558559
/**
559560
* sock_release - close a socket

0 commit comments

Comments
 (0)