]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet6/ip6_output.c
xnu-1504.15.3.tar.gz
[apple/xnu.git] / bsd / netinet6 / ip6_output.c
index 143625b09da8b89c4a7a50b9f7c5fc1256c1fdb5..309686f7fd4b15a481eae16bbf1f5ce9b828cd8e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2008 Apple Inc. All rights reserved.
+ * Copyright (c) 2008-2011 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -1741,10 +1741,12 @@ do { \
                        case IPV6_FW_FLUSH:
                        case IPV6_FW_ZERO:
                                {
-                               if (ip6_fw_ctl_ptr == NULL && load_ipfw() != 0)
-                                       return EINVAL;
-
-                               error = (*ip6_fw_ctl_ptr)(sopt);
+                               if (ip6_fw_ctl_ptr == NULL)
+                                       load_ip6fw();
+                               if (ip6_fw_ctl_ptr != NULL)
+                                       error = (*ip6_fw_ctl_ptr)(sopt);
+                               else
+                                       return ENOPROTOOPT;
                                }
                                break;
 #endif /* IPFIREWALL */
@@ -1909,10 +1911,12 @@ do { \
 #if IPFIREWALL
                        case IPV6_FW_GET:
                                {
-                               if (ip6_fw_ctl_ptr == NULL && load_ipfw() != 0)
-                                       return EINVAL;
-
-                               error = (*ip6_fw_ctl_ptr)(sopt);
+                               if (ip6_fw_ctl_ptr == NULL)
+                                       load_ip6fw();
+                               if (ip6_fw_ctl_ptr != NULL)
+                                       error = (*ip6_fw_ctl_ptr)(sopt);
+                               else
+                                       return ENOPROTOOPT;
                                }
                                break;
 #endif /* IPFIREWALL */