Date: Thu, 08 Mar 2018 04:27:01 +0000 From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 226429] ipfw table add & hostname parsing Message-ID: <bug-226429-8-qoJm7p0DL5@https.bugs.freebsd.org/bugzilla/> In-Reply-To: <bug-226429-8@https.bugs.freebsd.org/bugzilla/> References: <bug-226429-8@https.bugs.freebsd.org/bugzilla/>
index | next in thread | previous in thread | raw e-mail
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226429 --- Comment #2 from Conrad Meyer <cem@freebsd.org> --- I suggest this untested patch to correct the issue (and a similar issue with legacy table values): --- sbin/ipfw/tables.c (revision 330627) +++ sbin/ipfw/tables.c (working copy) @@ -1471,6 +1471,7 @@ uint32_t i; int dval; char *comma, *e, *etype, *n, *p; + struct in_addr ipaddr; v = &tent->v.value; @@ -1487,8 +1488,8 @@ return; } /* Try hostname */ - if (lookup_host(arg, (struct in_addr *)&val) == 0) { - set_legacy_value(val, v); + if (lookup_host(arg, &ipaddr) == 0) { + set_legacy_value(ntohl(ipaddr.s_addr), v); return; } errx(EX_OSERR, "Unable to parse value %s", arg); @@ -1557,8 +1558,10 @@ v->nh4 = ntohl(a4); break; } - if (lookup_host(n, (struct in_addr *)&v->nh4) == 0) + if (lookup_host(n, &ipaddr) == 0) { + v->nh4 = ntohl(ipaddr.s_addr); break; + } etype = "ipv4"; break; case IPFW_VTYPE_DSCP: Maybe you can try it out? -- You are receiving this mail because: You are the assignee for the bug.help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-226429-8-qoJm7p0DL5>
