From owner-svn-src-head@FreeBSD.ORG Wed Aug 1 18:52:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 648E81065673; Wed, 1 Aug 2012 18:52:08 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 450028FC0A; Wed, 1 Aug 2012 18:52:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q71Iq8jJ087183; Wed, 1 Aug 2012 18:52:08 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q71Iq83L087180; Wed, 1 Aug 2012 18:52:08 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201208011852.q71Iq83L087180@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 1 Aug 2012 18:52:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r238978 - head/sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Aug 2012 18:52:08 -0000 Author: luigi Date: Wed Aug 1 18:52:07 2012 New Revision: 238978 URL: http://svn.freebsd.org/changeset/base/238978 Log: replace inet_ntoa_r with the more standard inet_ntop(). As discussed on -current, inet_ntoa_r() is non standard, has different arguments in userspace and kernel, and almost unused (no clients in userspace, only net/flowtable.c, net/if_llatbl.c, netinet/in_pcb.c, netinet/tcp_subr.c in the kernel) Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c head/sys/netinet/ipfw/ip_fw_log.c Modified: head/sys/netinet/ipfw/ip_fw_dynamic.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Aug 1 18:49:00 2012 (r238977) +++ head/sys/netinet/ipfw/ip_fw_dynamic.c Wed Aug 1 18:52:07 2012 (r238978) @@ -275,9 +275,9 @@ unlink_dyn_rule_print(struct ipfw_flow_i #endif { da.s_addr = htonl(id->src_ip); - inet_ntoa_r(da, src); + inet_ntop(AF_INET, &da, src, sizeof(src)); da.s_addr = htonl(id->dst_ip); - inet_ntoa_r(da, dst); + inet_ntop(AF_INET, &da, dst, sizeof(dst)); } printf("ipfw: unlink entry %s %d -> %s %d, %d left\n", src, id->src_port, dst, id->dst_port, V_dyn_count - 1); @@ -656,9 +656,9 @@ add_dyn_rule(struct ipfw_flow_id *id, u_ #endif { da.s_addr = htonl(r->id.src_ip); - inet_ntoa_r(da, src); + inet_ntop(AF_INET, &da, src, sizeof(src)); da.s_addr = htonl(r->id.dst_ip); - inet_ntoa_r(da, dst); + inet_ntop(AF_INET, &da, dst, sizeof(dst)); } printf("ipfw: add dyn entry ty %d %s %d -> %s %d, total %d\n", dyn_type, src, r->id.src_port, dst, r->id.dst_port, @@ -740,9 +740,9 @@ ipfw_install_state(struct ip_fw *rule, i #endif { da.s_addr = htonl(args->f_id.src_ip); - inet_ntoa_r(da, src); + inet_ntop(AF_INET, &da, src, sizeof(src)); da.s_addr = htonl(args->f_id.dst_ip); - inet_ntoa_r(da, dst); + inet_ntop(AF_INET, &da, dst, sizeof(dst)); } printf("ipfw: %s: type %d %s %u -> %s %u\n", __func__, cmd->o.opcode, src, args->f_id.src_port, @@ -850,10 +850,12 @@ ipfw_install_state(struct ip_fw *rule, i { da.s_addr = htonl(args->f_id.src_ip); - inet_ntoa_r(da, src); + inet_ntop(AF_INET, &da, src, + sizeof(src)); da.s_addr = htonl(args->f_id.dst_ip); - inet_ntoa_r(da, dst); + inet_ntop(AF_INET, &da, dst, + sizeof(dst)); } log(LOG_SECURITY | LOG_DEBUG, "ipfw: %d %s %s:%u -> %s:%u, %s\n", Modified: head/sys/netinet/ipfw/ip_fw_log.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_log.c Wed Aug 1 18:49:00 2012 (r238977) +++ head/sys/netinet/ipfw/ip_fw_log.c Wed Aug 1 18:52:07 2012 (r238978) @@ -450,8 +450,8 @@ ipfw_log(struct ip_fw *f, u_int hlen, st tcp = L3HDR(struct tcphdr, ip); udp = L3HDR(struct udphdr, ip); - inet_ntoa_r(ip->ip_src, src); - inet_ntoa_r(ip->ip_dst, dst); + inet_ntop(AF_INET, &ip->ip_src, src, sizeof(src)); + inet_ntop(AF_INET, &ip->ip_dst, dst, sizeof(dst)); } switch (args->f_id.proto) {