diff options
| author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2006-03-21 00:23:39 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2006-03-21 00:23:39 -0500 |
| commit | c985ed705ffc682ce40d46a5f7bf98db86b27899 (patch) | |
| tree | 20272a6d8f7b896e9b31397d4c4ff563bfdf16b2 /net/dccp | |
| parent | 3e0fadc51f2fde01e0e22f481370a9b5f073bfc3 (diff) | |
[DCCP]: Move dccp_[un]hash from ipv4.c to the core
As this is used by both ipv4 and ipv6 and is not ipv4 specific.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dccp')
| -rw-r--r-- | net/dccp/dccp.h | 1 | ||||
| -rw-r--r-- | net/dccp/ipv4.c | 14 | ||||
| -rw-r--r-- | net/dccp/ipv6.c | 2 | ||||
| -rw-r--r-- | net/dccp/proto.c | 14 |
4 files changed, 17 insertions, 14 deletions
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h index 8f3903be5598..b6ea4cc12608 100644 --- a/net/dccp/dccp.h +++ b/net/dccp/dccp.h | |||
| @@ -238,6 +238,7 @@ extern struct sk_buff *dccp_make_response(struct sock *sk, | |||
| 238 | 238 | ||
| 239 | extern int dccp_connect(struct sock *sk); | 239 | extern int dccp_connect(struct sock *sk); |
| 240 | extern int dccp_disconnect(struct sock *sk, int flags); | 240 | extern int dccp_disconnect(struct sock *sk, int flags); |
| 241 | extern void dccp_hash(struct sock *sk); | ||
| 241 | extern void dccp_unhash(struct sock *sk); | 242 | extern void dccp_unhash(struct sock *sk); |
| 242 | extern int dccp_getsockopt(struct sock *sk, int level, int optname, | 243 | extern int dccp_getsockopt(struct sock *sk, int level, int optname, |
| 243 | char __user *optval, int __user *optlen); | 244 | char __user *optval, int __user *optlen); |
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c index b26a4f8df4dc..34d1b119b720 100644 --- a/net/dccp/ipv4.c +++ b/net/dccp/ipv4.c | |||
| @@ -44,18 +44,6 @@ static int dccp_v4_get_port(struct sock *sk, const unsigned short snum) | |||
| 44 | inet_csk_bind_conflict); | 44 | inet_csk_bind_conflict); |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static void dccp_v4_hash(struct sock *sk) | ||
| 48 | { | ||
| 49 | inet_hash(&dccp_hashinfo, sk); | ||
| 50 | } | ||
| 51 | |||
| 52 | void dccp_unhash(struct sock *sk) | ||
| 53 | { | ||
| 54 | inet_unhash(&dccp_hashinfo, sk); | ||
| 55 | } | ||
| 56 | |||
| 57 | EXPORT_SYMBOL_GPL(dccp_unhash); | ||
| 58 | |||
| 59 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) | 47 | int dccp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len) |
| 60 | { | 48 | { |
| 61 | struct inet_sock *inet = inet_sk(sk); | 49 | struct inet_sock *inet = inet_sk(sk); |
| @@ -1048,7 +1036,7 @@ struct proto dccp_prot = { | |||
| 1048 | .sendmsg = dccp_sendmsg, | 1036 | .sendmsg = dccp_sendmsg, |
| 1049 | .recvmsg = dccp_recvmsg, | 1037 | .recvmsg = dccp_recvmsg, |
| 1050 | .backlog_rcv = dccp_v4_do_rcv, | 1038 | .backlog_rcv = dccp_v4_do_rcv, |
| 1051 | .hash = dccp_v4_hash, | 1039 | .hash = dccp_hash, |
| 1052 | .unhash = dccp_unhash, | 1040 | .unhash = dccp_unhash, |
| 1053 | .accept = inet_csk_accept, | 1041 | .accept = inet_csk_accept, |
| 1054 | .get_port = dccp_v4_get_port, | 1042 | .get_port = dccp_v4_get_port, |
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c index 84651bc6453b..904967bf2fe9 100644 --- a/net/dccp/ipv6.c +++ b/net/dccp/ipv6.c | |||
| @@ -53,7 +53,7 @@ static void dccp_v6_hash(struct sock *sk) | |||
| 53 | { | 53 | { |
| 54 | if (sk->sk_state != DCCP_CLOSED) { | 54 | if (sk->sk_state != DCCP_CLOSED) { |
| 55 | if (inet_csk(sk)->icsk_af_ops == &dccp_ipv6_mapped) { | 55 | if (inet_csk(sk)->icsk_af_ops == &dccp_ipv6_mapped) { |
| 56 | dccp_prot.hash(sk); | 56 | dccp_hash(sk); |
| 57 | return; | 57 | return; |
| 58 | } | 58 | } |
| 59 | local_bh_disable(); | 59 | local_bh_disable(); |
diff --git a/net/dccp/proto.c b/net/dccp/proto.c index 1c32def26533..64806fbf44de 100644 --- a/net/dccp/proto.c +++ b/net/dccp/proto.c | |||
| @@ -97,6 +97,20 @@ const char *dccp_state_name(const int state) | |||
| 97 | 97 | ||
| 98 | EXPORT_SYMBOL_GPL(dccp_state_name); | 98 | EXPORT_SYMBOL_GPL(dccp_state_name); |
| 99 | 99 | ||
| 100 | void dccp_hash(struct sock *sk) | ||
| 101 | { | ||
| 102 | inet_hash(&dccp_hashinfo, sk); | ||
| 103 | } | ||
| 104 | |||
| 105 | EXPORT_SYMBOL_GPL(dccp_hash); | ||
| 106 | |||
| 107 | void dccp_unhash(struct sock *sk) | ||
| 108 | { | ||
| 109 | inet_unhash(&dccp_hashinfo, sk); | ||
| 110 | } | ||
| 111 | |||
| 112 | EXPORT_SYMBOL_GPL(dccp_unhash); | ||
| 113 | |||
| 100 | int dccp_init_sock(struct sock *sk) | 114 | int dccp_init_sock(struct sock *sk) |
| 101 | { | 115 | { |
| 102 | struct dccp_sock *dp = dccp_sk(sk); | 116 | struct dccp_sock *dp = dccp_sk(sk); |
