diff options
author | Arnaldo Carvalho de Melo <acme@mandriva.com> | 2005-12-14 02:16:04 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-01-03 16:10:39 -0500 |
commit | af05dc9394feb193d221bc9d4c6db768facb4b40 (patch) | |
tree | 05137311001c383fad817d3ce0f6324200d64532 | |
parent | 8292a17a399ffb7c5c8b083db4ad994e090055f7 (diff) |
[ICSK]: Move v4_addr2sockaddr from TCP to icsk
Renaming it to inet_csk_addr2sockaddr.
Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/net/inet_connection_sock.h | 2 | ||||
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 12 | ||||
-rw-r--r-- | net/ipv4/tcp_ipv4.c | 12 |
3 files changed, 15 insertions, 11 deletions
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h index 9e20d201e951..e50e2b890c6d 100644 --- a/include/net/inet_connection_sock.h +++ b/include/net/inet_connection_sock.h | |||
@@ -303,4 +303,6 @@ static inline unsigned int inet_csk_listen_poll(const struct sock *sk) | |||
303 | extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); | 303 | extern int inet_csk_listen_start(struct sock *sk, const int nr_table_entries); |
304 | extern void inet_csk_listen_stop(struct sock *sk); | 304 | extern void inet_csk_listen_stop(struct sock *sk); |
305 | 305 | ||
306 | extern void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr); | ||
307 | |||
306 | #endif /* _INET_CONNECTION_SOCK_H */ | 308 | #endif /* _INET_CONNECTION_SOCK_H */ |
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index e2bf508ed770..ae20281d8deb 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -636,3 +636,15 @@ void inet_csk_listen_stop(struct sock *sk) | |||
636 | } | 636 | } |
637 | 637 | ||
638 | EXPORT_SYMBOL_GPL(inet_csk_listen_stop); | 638 | EXPORT_SYMBOL_GPL(inet_csk_listen_stop); |
639 | |||
640 | void inet_csk_addr2sockaddr(struct sock *sk, struct sockaddr *uaddr) | ||
641 | { | ||
642 | struct sockaddr_in *sin = (struct sockaddr_in *)uaddr; | ||
643 | const struct inet_sock *inet = inet_sk(sk); | ||
644 | |||
645 | sin->sin_family = AF_INET; | ||
646 | sin->sin_addr.s_addr = inet->daddr; | ||
647 | sin->sin_port = inet->dport; | ||
648 | } | ||
649 | |||
650 | EXPORT_SYMBOL_GPL(inet_csk_addr2sockaddr); | ||
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 704cf2105795..0b5ab04d3c5a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -1314,16 +1314,6 @@ do_time_wait: | |||
1314 | goto discard_it; | 1314 | goto discard_it; |
1315 | } | 1315 | } |
1316 | 1316 | ||
1317 | static void v4_addr2sockaddr(struct sock *sk, struct sockaddr * uaddr) | ||
1318 | { | ||
1319 | struct sockaddr_in *sin = (struct sockaddr_in *) uaddr; | ||
1320 | struct inet_sock *inet = inet_sk(sk); | ||
1321 | |||
1322 | sin->sin_family = AF_INET; | ||
1323 | sin->sin_addr.s_addr = inet->daddr; | ||
1324 | sin->sin_port = inet->dport; | ||
1325 | } | ||
1326 | |||
1327 | /* VJ's idea. Save last timestamp seen from this destination | 1317 | /* VJ's idea. Save last timestamp seen from this destination |
1328 | * and hold it at least for normal timewait interval to use for duplicate | 1318 | * and hold it at least for normal timewait interval to use for duplicate |
1329 | * segment detection in subsequent connections, before they enter synchronized | 1319 | * segment detection in subsequent connections, before they enter synchronized |
@@ -1392,7 +1382,7 @@ struct inet_connection_sock_af_ops ipv4_specific = { | |||
1392 | .net_header_len = sizeof(struct iphdr), | 1382 | .net_header_len = sizeof(struct iphdr), |
1393 | .setsockopt = ip_setsockopt, | 1383 | .setsockopt = ip_setsockopt, |
1394 | .getsockopt = ip_getsockopt, | 1384 | .getsockopt = ip_getsockopt, |
1395 | .addr2sockaddr = v4_addr2sockaddr, | 1385 | .addr2sockaddr = inet_csk_addr2sockaddr, |
1396 | .sockaddr_len = sizeof(struct sockaddr_in), | 1386 | .sockaddr_len = sizeof(struct sockaddr_in), |
1397 | }; | 1387 | }; |
1398 | 1388 | ||