Received: from eggs.gnu.org ([208.118.235.92]:53125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULS5Z-0004GW-U1 for qemu-devel@nongnu.org; Fri, 29 Mar 2013 01:42:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ULS5Y-00042a-Vc for qemu-devel@nongnu.org; Fri, 29 Mar 2013 01:42:57 -0400 Received: from mail-da0-x236.google.com ([2607:f8b0:400e:c00::236]:35041) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ULS5Y-00042S-Ov for qemu-devel@nongnu.org; Fri, 29 Mar 2013 01:42:56 -0400 Received: by mail-da0-f54.google.com with SMTP id p1so108342dad.27 for ; Thu, 28 Mar 2013 22:42:56 -0700 (PDT) From: Liu Yuan Date: Fri, 29 Mar 2013 13:42:20 +0800 Message-Id: <1364535744-8707-4-git-send-email-namei.unix@gmail.com> In-Reply-To: <1364535744-8707-1-git-send-email-namei.unix@gmail.com> References: <1364535744-8707-1-git-send-email-namei.unix@gmail.com> Subject: [Qemu-devel] [PATCH v2 3/7] net: enlarge connect_to_addr() scope List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org From: Liu Yuan This is a prepare patch. Signed-off-by: Liu Yuan --- include/net.h | 8 ++++++++ sheep/sockfd_cache.c | 8 -------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/net.h b/include/net.h index a68c880..75ac197 100644 --- a/include/net.h +++ b/include/net.h @@ -72,4 +72,12 @@ int set_rcv_timeout(int fd); int get_local_addr(uint8_t *bytes); bool inetaddr_is_valid(char *addr); +static inline int connect_to_addr(const uint8_t *addr, int port) +{ + char name[INET6_ADDRSTRLEN]; + + addr_to_str(name, sizeof(name), addr, 0); + return connect_to(name, port); +} + #endif diff --git a/sheep/sockfd_cache.c b/sheep/sockfd_cache.c index ddefbf2..1e0d6cf 100644 --- a/sheep/sockfd_cache.c +++ b/sheep/sockfd_cache.c @@ -337,14 +337,6 @@ static inline void check_idx(int idx) queue_work(sys->sockfd_wqueue, w); } -static inline int connect_to_addr(const uint8_t *addr, int port) -{ - char name[INET6_ADDRSTRLEN]; - - addr_to_str(name, sizeof(name), addr, 0); - return connect_to(name, port); -} - /* Add the node back if it is still alive */ static inline int revalidate_node(const struct node_id *nid) { -- 1.7.9.5