Author: ae Date: Thu Apr 14 18:22:08 2016 New Revision: 297981 URL: https://svnweb.freebsd.org/changeset/base/297981
Log: Fix output formatting of O_UNREACH6 opcode. Obtained from: Yandex LLC 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 14 18:03:55 2016 (r297980) +++ head/sbin/ipfw/ipfw2.c Thu Apr 14 18:22:08 2016 (r297981) @@ -1484,7 +1484,7 @@ show_static_rule(struct cmdline_opts *co if (cmd->arg1 == ICMP6_UNREACH_RST) bprintf(bp, "reset6"); else - print_unreach6_code(cmd->arg1); + print_unreach6_code(bp, cmd->arg1); break; case O_SKIPTO: Modified: head/sbin/ipfw/ipfw2.h ============================================================================== --- head/sbin/ipfw/ipfw2.h Thu Apr 14 18:03:55 2016 (r297980) +++ head/sbin/ipfw/ipfw2.h Thu Apr 14 18:22:08 2016 (r297981) @@ -329,7 +329,7 @@ void dummynet_flush(void); int ipfw_delete_pipe(int pipe_or_queue, int n); /* ipv6.c */ -void print_unreach6_code(uint16_t code); +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_flow6id(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); void print_icmp6types(struct buf_pr *bp, struct _ipfw_insn_u32 *cmd); Modified: head/sbin/ipfw/ipv6.c ============================================================================== --- head/sbin/ipfw/ipv6.c Thu Apr 14 18:03:55 2016 (r297980) +++ head/sbin/ipfw/ipv6.c Thu Apr 14 18:22:08 2016 (r297981) @@ -71,14 +71,14 @@ fill_unreach6_code(u_short *codep, char } void -print_unreach6_code(uint16_t code) +print_unreach6_code(struct buf_pr *bp, uint16_t code) { char const *s = match_value(icmp6codes, code); if (s != NULL) - printf("unreach6 %s", s); + bprintf(bp, "unreach6 %s", s); else - printf("unreach6 %u", code); + bprintf(bp, "unreach6 %u", code); } /* _______________________________________________ svn-src-head@freebsd.org mailing list https://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"