Only emit different ip family warnings if the ip wasn't automatically resolved
authorJo-Philipp Wich <jow@openwrt.org>
Sun, 26 May 2013 15:22:11 +0000 (17:22 +0200)
committerJo-Philipp Wich <jow@openwrt.org>
Sun, 26 May 2013 15:25:23 +0000 (17:25 +0200)
redirects.c
rules.c

index 7bafec2f1ee19c3f999eeb75539fa3b45cb7f743..de3d42e2b8023fe63683cac2336a4c4e58761cb7 100644 (file)
@@ -540,7 +540,11 @@ expand_redirect(struct fw3_ipt_handle *handle, struct fw3_state *state,
            !fw3_is_family(&redir->ip_dest, handle->family) ||
                !fw3_is_family(&redir->ip_redir, handle->family))
        {
-               info("     ! Skipping due to different family of ip address");
+               if (!redir->ip_src.resolved ||
+                   !redir->ip_dest.resolved ||
+                   !redir->ip_redir.resolved)
+                       info("     ! Skipping due to different family of ip address");
+
                return;
        }
 
diff --git a/rules.c b/rules.c
index eea872496e5e42c25d9116d8aa755637161b710f..b6c3d751420c764c004c869a6b4cb21bceed2f06 100644 (file)
--- a/rules.c
+++ b/rules.c
@@ -314,7 +314,9 @@ print_rule(struct fw3_ipt_handle *handle, struct fw3_state *state,
        if (!fw3_is_family(sip, handle->family) ||
            !fw3_is_family(dip, handle->family))
        {
-               info("     ! Skipping due to different family of ip address");
+               if ((sip && !sip->resolved) || (dip && !dip->resolved))
+                       info("     ! Skipping due to different family of ip address");
+
                return;
        }