https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=226429

--- Comment #2 from Conrad Meyer <c...@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.
_______________________________________________
freebsd-bugs@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to