]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/netinet/ip_divert.c
xnu-4570.51.1.tar.gz
[apple/xnu.git] / bsd / netinet / ip_divert.c
index 4981eb25e6012718c29618e76352f675f6420456..74efc18df2d1bf62de3d69b9f15b46d56261fa06 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000-2016 Apple Inc. All rights reserved.
+ * Copyright (c) 2000-2018 Apple Inc. All rights reserved.
  *
  * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
@@ -374,12 +374,16 @@ div_output(struct socket *so, struct mbuf *m, struct sockaddr_in *sin,
 
        /* Reinject packet into the system as incoming or outgoing */
        if (!sin || sin->sin_addr.s_addr == 0) {
-               struct ip_out_args ipoa =
-                   { IFSCOPE_NONE, { 0 }, IPOAF_SELECT_SRCIF, 0, SO_TC_UNSPEC,
-                   _NET_SERVICE_TYPE_UNSPEC };
+               struct ip_out_args ipoa;
                struct route ro;
                struct ip_moptions *imo;
 
+               bzero(&ipoa, sizeof(ipoa));
+               ipoa.ipoa_boundif = IFSCOPE_NONE;
+               ipoa.ipoa_flags = IPOAF_SELECT_SRCIF;
+               ipoa.ipoa_sotc = SO_TC_UNSPEC;
+               ipoa.ipoa_netsvctype = _NET_SERVICE_TYPE_UNSPEC;
+
                /*
                 * Don't allow both user specified and setsockopt options,
                 * and don't allow packet length sizes that will crash