From owner-svn-src-all@freebsd.org Thu Apr 12 19:44:05 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C968CF8AA80; Thu, 12 Apr 2018 19:44:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B8217F40F; Thu, 12 Apr 2018 19:44:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5C59F7C2B; Thu, 12 Apr 2018 19:44:05 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w3CJi5l0011909; Thu, 12 Apr 2018 19:44:05 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w3CJi5jX011906; Thu, 12 Apr 2018 19:44:05 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201804121944.w3CJi5jX011906@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Thu, 12 Apr 2018 19:44:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r332449 - head/sbin/ipfw X-SVN-Group: head X-SVN-Commit-Author: ae X-SVN-Commit-Paths: head/sbin/ipfw X-SVN-Commit-Revision: 332449 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2018 19:44:06 -0000 Author: ae Date: Thu Apr 12 19:44:04 2018 New Revision: 332449 URL: https://svnweb.freebsd.org/changeset/base/332449 Log: Remove printing of "not" keyword from print_ip6() function. After r331668 handling of F_NOT flag done in one place by print_instruction() function. Also remove unused argument from print_ip[6]() functions. MFC after: 1 week Modified: head/sbin/ipfw/ipfw2.c head/sbin/ipfw/ipfw2.h head/sbin/ipfw/ipv6.c Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipfw2.c Thu Apr 12 19:44:04 2018 (r332449) @@ -1176,8 +1176,7 @@ print_flags(struct buf_pr *bp, char const *name, ipfw_ * Print the ip address contained in a command. */ static void -print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd, - char const *s) +print_ip(struct buf_pr *bp, const struct format_opts *fo, ipfw_insn_ip *cmd) { struct hostent *he = NULL; struct in_addr *ia; @@ -1185,6 +1184,7 @@ print_ip(struct buf_pr *bp, const struct format_opts * uint32_t *a = ((ipfw_insn_u32 *)cmd)->d; char *t; + bprintf(bp, " "); if (cmd->o.opcode == O_IP_DST_LOOKUP && len > F_INSN_SIZE(ipfw_insn_u32)) { uint32_t d = a[1]; const char *arg = ""; @@ -1192,11 +1192,9 @@ print_ip(struct buf_pr *bp, const struct format_opts * if (d < sizeof(lookup_key)/sizeof(lookup_key[0])) arg = match_value(rule_options, lookup_key[d]); t = table_search_ctlv(fo->tstate, ((ipfw_insn *)cmd)->arg1); - bprintf(bp, " lookup %s %s", arg, t); + bprintf(bp, "lookup %s %s", arg, t); return; } - bprintf(bp, "%s ", s); - if (cmd->o.opcode == O_IP_SRC_ME || cmd->o.opcode == O_IP_DST_ME) { bprintf(bp, "me"); return; @@ -1467,7 +1465,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP_DST_MASK: case O_IP_DST_ME: case O_IP_DST_SET: - print_ip(bp, fo, insntod(cmd, ip), ""); + print_ip(bp, fo, insntod(cmd, ip)); break; case O_IP6_SRC: case O_IP6_SRC_MASK: @@ -1475,7 +1473,7 @@ print_instruction(struct buf_pr *bp, const struct form case O_IP6_DST: case O_IP6_DST_MASK: case O_IP6_DST_ME: - print_ip6(bp, insntod(cmd, ip6), ""); + print_ip6(bp, insntod(cmd, ip6)); break; case O_FLOW6ID: print_flow6id(bp, insntod(cmd, u32)); Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipfw2.h Thu Apr 12 19:44:04 2018 (r332449) @@ -401,7 +401,7 @@ int ipfw_delete_pipe(int pipe_or_queue, int n); /* ipv6.c */ void print_unreach6_code(struct buf_pr *bp, uint16_t code); -void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd, char const *s); +void print_ip6(struct buf_pr *bp, struct _ipfw_insn_ip6 *cmd); void print_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_ext6hdr(struct buf_pr *bp, struct _ipfw_insn *cmd ); Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Thu Apr 12 19:34:35 2018 (r332448) +++ head/sbin/ipfw/ipv6.c Thu Apr 12 19:44:04 2018 (r332449) @@ -85,17 +85,15 @@ print_unreach6_code(struct buf_pr *bp, uint16_t code) * Print the ip address contained in a command. */ void -print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char const *s) +print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd) { struct hostent *he = NULL; int len = F_LEN((ipfw_insn *) cmd) - 1; struct in6_addr *a = &(cmd->addr6); char trad[255]; - bprintf(bp, "%s%s ", cmd->o.len & F_NOT ? " not": "", s); - if (cmd->o.opcode == O_IP6_SRC_ME || cmd->o.opcode == O_IP6_DST_ME) { - bprintf(bp, "me6"); + bprintf(bp, " me6"); return; } if (cmd->o.opcode == O_IP6) { @@ -108,7 +106,7 @@ print_ip6(struct buf_pr *bp, ipfw_insn_ip6 *cmd, char * addr/mask pairs have len = (2n+1). We convert len to n so we * use that to count the number of entries. */ - + bprintf(bp, " "); for (len = len / 4; len > 0; len -= 2, a += 2) { int mb = /* mask length */ (cmd->o.opcode == O_IP6_SRC || cmd->o.opcode == O_IP6_DST) ?