diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/fwtcp.c vbox-trunk\src\VBox\NetworkServices/NAT/fwtcp.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/fwtcp.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/fwtcp.c	2015-10-30 23:03:06.000000000 +0300
@@ -29,6 +29,9 @@
 #include <arpa/inet.h>
 #include <stdio.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 
 #include <err.h>                /* BSD'ism */
 #else
@@ -214,7 +217,11 @@
 fwtcp_pmgr_listen(struct pollmgr_handler *handler, SOCKET fd, int revents)
 {
     struct fwtcp *fwtcp;
+#ifdef IPv6
     struct sockaddr_storage ss;
+#else
+    struct sockaddr_in ss;
+#endif
     socklen_t sslen;
     struct pxtcp *pxtcp;
     SOCKET newsock;
@@ -233,22 +240,28 @@
     LWIP_ASSERT1(sys_mbox_valid(&fwtcp->connmbox));
 
     sslen = sizeof(ss);
-    newsock = accept(fwtcp->sock, (struct sockaddr *)&ss, &sslen);
+    newsock = accept(fwtcp->sock, (struct sockaddr *)&ss, (int *)&sslen);
     if (newsock == INVALID_SOCKET) {
         return POLLIN;
     }
 
 
+#ifdef IPv6
     if (ss.ss_family == PF_INET) {
+#else
+    if (ss.sin_family == PF_INET) {
+#endif
         struct sockaddr_in *peer4 = (struct sockaddr_in *)&ss;
         DPRINTF(("<--- TCP %RTnaipv4:%d\n",
                  peer4->sin_addr.s_addr, ntohs(peer4->sin_port)));
     }
+#ifdef IPv6
     else { /* PF_INET6 */
         struct sockaddr_in6 *peer6 = (struct sockaddr_in6 *)&ss;
         DPRINTF(("<--- TCP %RTnaipv6:%d\n",
                  &peer6->sin6_addr, ntohs(peer6->sin6_port)));
     }
+#endif
 
     pxtcp = pxtcp_create_forwarded(newsock);
     if (pxtcp == NULL) {
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/fwudp.c vbox-trunk\src\VBox\NetworkServices/NAT/fwudp.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/fwudp.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/fwudp.c	2015-10-14 00:32:26.000000000 +0300
@@ -29,6 +29,9 @@
 #include <stdio.h>
 #include <string.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 
 #include <err.h>                /* BSD'ism */
 #else
@@ -202,17 +205,21 @@
     fwudp->sock = sock;
     fwudp->fwspec = *fwspec;    /* struct copy */
 
+#ifdef IPv6
     /* XXX */
     if (fwspec->sdom == PF_INET) {
+#endif
         struct sockaddr_in *dst4 = &fwspec->dst.sin;
         memcpy(&fwudp->dst_addr.ip4, &dst4->sin_addr, sizeof(ip_addr_t));
         fwudp->dst_port = htons(dst4->sin_port);
+#ifdef IPv6
     }
     else { /* PF_INET6 */
         struct sockaddr_in6 *dst6 = &fwspec->dst.sin6;
         memcpy(&fwudp->dst_addr.ip6, &dst6->sin6_addr, sizeof(ip6_addr_t));
         fwudp->dst_port = htons(dst6->sin6_port);
     }
+#endif
 
     fwudp->inbuf.bufsize = 256; /* elements  */
     fwudp->inbuf.buf
@@ -261,7 +268,11 @@
 fwudp_pmgr_pump(struct pollmgr_handler *handler, SOCKET fd, int revents)
 {
     struct fwudp *fwudp;
+#ifdef IPv6
     struct sockaddr_storage ss;
+#else
+    struct sockaddr_in ss;
+#endif
     socklen_t sslen = sizeof(ss);
     size_t beg, lim;
     struct fwudp_dgram *dgram;
@@ -279,7 +290,7 @@
     LWIP_UNUSED_ARG(revents);
 
     nread = recvfrom(fwudp->sock, pollmgr_udpbuf, sizeof(pollmgr_udpbuf), 0,
-                     (struct sockaddr *)&ss, &sslen);
+                     (struct sockaddr *)&ss, (int *)&sslen);
     if (nread < 0) {
         DPRINTF(("%s: %R[sockerr]\n", __func__, SOCKERRNO()));
         return POLLIN;
@@ -308,14 +319,20 @@
         return POLLIN;
     }
 
+#ifdef IPv6
     if (ss.ss_family == AF_INET) {
+#else
+    if (ss.sin_family == PF_INET) {
+#endif
         const struct sockaddr_in *peer4 = (const struct sockaddr_in *)&ss;
         dgram->src_port = htons(peer4->sin_port);
     }
+#ifdef IPv6
     else { /* PF_INET6 */
         const struct sockaddr_in6 *peer6 = (const struct sockaddr_in6 *)&ss;
         dgram->src_port = htons(peer6->sin6_port);
     }
+#endif
 
     p = pbuf_alloc(PBUF_RAW, nread, PBUF_RAM);
     if (p == NULL) {
@@ -476,13 +493,17 @@
 {
     union {
         struct sockaddr_in sin;
+#ifdef IPv6
         struct sockaddr_in6 sin6;
+#endif
     } peer;
     socklen_t namelen;
 
     memset(&peer, 0, sizeof(peer)); /* XXX: shut up valgrind */
 
+#ifdef IPv6
     if (fwudp->fwspec.sdom == PF_INET) {
+#endif
         peer.sin.sin_family = AF_INET;
 #if HAVE_SA_LEN
         peer.sin.sin_len =
@@ -490,6 +511,7 @@
         namelen = sizeof(peer.sin);
         pxremap_outbound_ip4((ip_addr_t *)&peer.sin.sin_addr, &pcb->local_ip.ip4);
         peer.sin.sin_port = htons(pcb->local_port);
+#ifdef IPv6
     }
     else {
         peer.sin6.sin6_family = AF_INET6;
@@ -501,6 +523,7 @@
         pxremap_outbound_ip6((ip6_addr_t *)&peer.sin6.sin6_addr, &pcb->local_ip.ip6);
         peer.sin6.sin6_port = htons(pcb->local_port);
     }
+#endif
 
     proxy_sendto(fwudp->sock, p, &peer, namelen);
     pbuf_free(p);
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/Makefile.kmk vbox-trunk\src\VBox\NetworkServices/NAT/Makefile.kmk
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/Makefile.kmk	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/Makefile.kmk	2015-10-14 00:32:26.000000000 +0300
@@ -44,7 +44,10 @@
 VBoxNetLwipNAT_TEMPLATE =
 VBoxNetLwipNAT_TEMPLATE := VBOXMAIN$(if-expr defined(VBOX_WITH_HARDENING),DLL,CLIENTEXE)
 VBoxNetLwipNAT_NAME = VBoxNetNAT
-VBoxNetLwipNAT_DEFS += ${LWIP_DEFS} IPv6
+VBoxNetLwipNAT_DEFS += ${LWIP_DEFS}
+ifn1of ($(KBUILD_TARGET), os2)
+ VBoxNetLwipNAT_DEFS += IPv6
+endif
 # VBoxNetLwipNAT_DEFS.linux += WITH_VALGRIND # instrument lwip memp.c
 VBoxNetLwipNAT_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x501 # Windows XP
 VBoxNetLwipNAT_SOURCES += VBoxNetLwipNAT.cpp	\
@@ -58,6 +61,9 @@
 VBoxNetLwipNAT_LIBS = \
 	$(LIB_RUNTIME)
 VBoxNetLwipNAT_LIBS.solaris += socket nsl
+VBoxNetLwipNAT_LIBS.os2 += socket \
+	$(PATH_STAGE_LIB)/VBox-os2-poll$(VBOX_SUFF_LIB)
+VBoxNetLwipNAT_INCS.os2 += $(PATH_SUB_CURRENT)/src/libs/poll-os2
 VBoxNetLwipNAT_LDFLAGS.win = /SUBSYSTEM:windows
 
 # Convince Solaris headers to expose socket stuff we need.
@@ -98,9 +104,13 @@
     fwtcp.c \
     fwudp.c \
     portfwd.c \
-    proxy_dhcp6ds.c \
     proxy_tftpd.c
 
+ifn1of ($(KBUILD_TARGET),os2)
+VBoxNetLwipNAT_SOURCES += \
+    proxy_dhcp6ds.c
+endif
+
 ifeq ($(KBUILD_TARGET),win)
  # unprivileged Icmp API
  VBoxNetLwipNAT_SOURCES += pxping_win.c
@@ -121,6 +131,7 @@
 VBoxNetLwipNAT_SOURCES.freebsd += rtmon_bsd.c
 VBoxNetLwipNAT_SOURCES.linux   += rtmon_linux.c
 VBoxNetLwipNAT_SOURCES.solaris += rtmon_bsd.c
+VBoxNetLwipNAT_SOURCES.os2     += rtmon_win.c
 VBoxNetLwipNAT_SOURCES.win     += rtmon_win.c
 
 VBoxNetLwipNAT_SOURCES.win += \
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/portfwd.c vbox-trunk\src\VBox\NetworkServices/NAT/portfwd.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/portfwd.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/portfwd.c	2015-10-14 00:32:26.000000000 +0300
@@ -149,16 +149,23 @@
            const char *src_addr_str, uint16_t src_port,
            const char *dst_addr_str, uint16_t dst_port)
 {
+#ifdef IPv6
     struct addrinfo hints;
     struct addrinfo *ai;
+#endif
     int status;
 
+#ifdef IPv6
     LWIP_ASSERT1(sdom == PF_INET || sdom == PF_INET6);
+#else
+    LWIP_ASSERT1(sdom == PF_INET);
+#endif
     LWIP_ASSERT1(stype == SOCK_STREAM || stype == SOCK_DGRAM);
 
     fwspec->sdom = sdom;
     fwspec->stype = stype;
 
+#ifdef IPv6
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = (sdom == PF_INET) ? AF_INET : AF_INET6;
     hints.ai_socktype = stype;
@@ -185,15 +192,30 @@
     memcpy(&fwspec->dst, ai->ai_addr, ai->ai_addrlen);
     freeaddrinfo(ai);
     ai = NULL;
+#else
+    struct hostent *he = gethostbyname(src_addr_str);
+
+    if (he == NULL) {
+        LogRel(("\"%s\": %s\n", src_addr_str, hstrerror(h_errno)));
+        return -1;
+    }
+    LWIP_ASSERT1(he != NULL);
+    LWIP_ASSERT1(he->h_length <= sizeof(fwspec->src));
+    memcpy(&fwspec->src, he->h_addr_list, he->h_length);
+    free(he);
+    he = NULL;
+#endif
 
     if (sdom == PF_INET) {
         fwspec->src.sin.sin_port = htons(src_port);
         fwspec->dst.sin.sin_port = htons(dst_port);
     }
+#ifdef IPv6
     else { /* PF_INET6 */
         fwspec->src.sin6.sin6_port = htons(src_port);
         fwspec->dst.sin6.sin6_port = htons(dst_port);
     }
+#endif
 
     return 0;
 }
@@ -215,12 +237,14 @@
             && a->src.sin.sin_addr.s_addr == b->src.sin.sin_addr.s_addr
             && a->dst.sin.sin_addr.s_addr == b->dst.sin.sin_addr.s_addr;
     }
+#ifdef IPv6
     else { /* PF_INET6 */
         return a->src.sin6.sin6_port == b->src.sin6.sin6_port
             && a->dst.sin6.sin6_port == b->dst.sin6.sin6_port
             && IN6_ARE_ADDR_EQUAL(&a->src.sin6.sin6_addr, &b->src.sin6.sin6_addr)
             && IN6_ARE_ADDR_EQUAL(&a->dst.sin6.sin6_addr, &b->dst.sin6.sin6_addr);
     }
+#endif
 }
 
 
@@ -247,6 +271,7 @@
         peerip4.addr = peer4->sin_addr.s_addr;
         mapping = pxremap_inbound_ip4(&fwdsrc->ip4, &peerip4);
     }
+#ifdef IPv6
     else if (peer->sa_family == AF_INET6) {
         const struct sockaddr_in6 *peer6 = (const struct sockaddr_in6 *)peer;
         ip6_addr_t peerip6;
@@ -254,6 +279,7 @@
         memcpy(&peerip6, &peer6->sin6_addr, sizeof(ip6_addr_t));
         mapping = pxremap_inbound_ip6(&fwdsrc->ip6, &peerip6);
     }
+#endif
     else {
         mapping = PXREMAP_FAILED;
     }
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/portfwd.h vbox-trunk\src\VBox\NetworkServices/NAT/portfwd.h
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/portfwd.h	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/portfwd.h	2015-10-14 00:32:26.000000000 +0300
@@ -35,14 +35,18 @@
     union {
         struct sockaddr sa;
         struct sockaddr_in sin;   /* sdom == PF_INET  */
+#ifdef IPv6
         struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
+#endif
     } src;
 
     /* forward to */
     union {
         struct sockaddr sa;
         struct sockaddr_in sin;   /* sdom == PF_INET  */
+#ifdef IPv6
         struct sockaddr_in6 sin6; /* sdom == PF_INET6 */
+#endif
     } dst;
 };
 
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/proxy_pollmgr.c vbox-trunk\src\VBox\NetworkServices/NAT/proxy_pollmgr.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/proxy_pollmgr.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/proxy_pollmgr.c	2015-10-30 22:58:00.000000000 +0300
@@ -28,6 +28,9 @@
 #include <err.h>
 #include <errno.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long nfds_t;
+#endif
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/proxy.c vbox-trunk\src\VBox\NetworkServices/NAT/proxy.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/proxy.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/proxy.c	2015-10-30 22:58:44.000000000 +0300
@@ -30,6 +30,9 @@
 
 #ifndef RT_OS_WINDOWS
 #include <sys/poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -407,7 +410,9 @@
 proxy_connected_socket(int sdom, int stype,
                        ipX_addr_t *dst_addr, u16_t dst_port)
 {
+#ifdef IPv6
     struct sockaddr_in6 dst_sin6;
+#endif
     struct sockaddr_in dst_sin;
     struct sockaddr *pdst_sa;
     socklen_t dst_sa_len;
@@ -422,6 +427,7 @@
     LWIP_ASSERT1(stype == SOCK_STREAM || stype == SOCK_DGRAM);
 
     DPRINTF(("---> %s ", stype == SOCK_STREAM ? "TCP" : "UDP"));
+#ifdef IPv6
     if (sdom == PF_INET6) {
         pdst_sa = (struct sockaddr *)&dst_sin6;
         pdst_addr = (void *)&dst_sin6.sin6_addr;
@@ -438,6 +444,9 @@
         DPRINTF(("[%RTnaipv6]:%d ", &dst_sin6.sin6_addr, dst_port));
     }
     else { /* sdom = PF_INET */
+#else
+    {
+#endif
         pdst_sa = (struct sockaddr *)&dst_sin;
         pdst_addr = (void *)&dst_sin.sin_addr;
 
@@ -460,11 +469,15 @@
     DPRINTF(("socket %d\n", s));
 
     /* TODO: needs locking if dynamic modifyvm is allowed */
+#ifdef IPv6
     if (sdom == PF_INET6) {
         psrc_sa = (const struct sockaddr *)g_proxy_options->src6;
         src_sa_len = sizeof(struct sockaddr_in6);
     }
     else {
+#else
+    {
+#endif
         psrc_sa = (const struct sockaddr *)g_proxy_options->src4;
         src_sa_len = sizeof(struct sockaddr_in);
     }
@@ -532,9 +545,13 @@
     }
 
     status = bind(s, src_addr,
+#ifdef IPv6
                   sdom == PF_INET ?
                     sizeof(struct sockaddr_in)
                   : sizeof(struct sockaddr_in6));
+#else
+    sizeof(struct sockaddr_in));
+#endif
     if (status == SOCKET_ERROR) {
         sockerr = SOCKERRNO();
         DPRINTF(("bind: %R[sockerr]\n", sockerr));
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxdns.c vbox-trunk\src\VBox\NetworkServices/NAT/pxdns.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxdns.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/pxdns.c	2015-10-30 22:57:28.000000000 +0300
@@ -49,6 +49,9 @@
 
 #ifndef RT_OS_WINDOWS
 #include <sys/poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <netdb.h>
@@ -63,7 +66,9 @@
 union sockaddr_inet {
     struct sockaddr sa;
     struct sockaddr_in sin;
+#ifdef IPv6
     struct sockaddr_in6 sin6;
+#endif
 };
 
 
@@ -312,7 +317,9 @@
 static void
 pxdns_create_resolver_sockaddrs(struct pxdns *pxdns, const char **nameservers)
 {
+#ifdef IPv6
     struct addrinfo hints;
+#endif
     union sockaddr_inet *resolvers;
     size_t nnames, nresolvers;
     const char **p;
@@ -340,6 +347,7 @@
         goto update_resolvers;
     }
 
+#ifdef IPv6
     memset(&hints, 0, sizeof(hints));
     hints.ai_family = AF_UNSPEC;
     hints.ai_socktype = SOCK_DGRAM;
@@ -377,6 +385,33 @@
         ++nresolvers;
     }
 
+#else
+    for (p = nameservers; *p; ++p) {
+        const char *name = *p;
+        struct hostent *he = gethostbyname(name);
+
+        if (he == NULL) {
+            /* failed resolution */
+            continue;
+        }
+
+        if (he->h_addrtype != AF_INET) {
+            /* not AF_INET addr type */
+            free(he);
+            continue;
+        }
+
+        if (he->h_length > sizeof(struct sockaddr_in)) {
+            /* IPv6 or other non-IPv4 addr length */
+            free(he);
+            continue;
+        }
+
+        memcpy(&resolvers[nresolvers], he->h_addr_list, he->h_length);
+        free(he);
+        ++nresolvers;
+    }
+#endif
     if (nresolvers == 0) {
         if (resolvers != NULL) {
             free(resolvers);
@@ -698,6 +733,7 @@
                        &resolver->sa, sizeof(resolver->sin));
 
     }
+#ifdef IPv6
     else if (resolver->sa.sa_family == AF_INET6) {
         if (pxdns->sock6 != INVALID_SOCKET) {
             nsent = sendto(pxdns->sock6, req->data, req->size, 0,
@@ -708,6 +744,7 @@
             return 0;
         }
     }
+#endif
     else {
         /* shouldn't happen, we should have weeded out unsupported families */
         return 0;
@@ -782,7 +819,7 @@
         int status;
 
         status = getsockopt(fd, SOL_SOCKET,
-                            SO_ERROR, (char *)&sockerr, &optlen);
+                            SO_ERROR, (char *)&sockerr, (int *)&optlen);
         if (status < 0) {
             DPRINTF(("%s: sock %d: SO_ERROR failed: %R[sockerr]\n",
                      __func__, fd, SOCKERRNO()));
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxping.c vbox-trunk\src\VBox\NetworkServices/NAT/pxping.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxping.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/pxping.c	2015-10-30 22:54:00.000000000 +0300
@@ -32,6 +32,9 @@
 #endif
 #include <netinet/in.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -85,7 +88,7 @@
 struct pxping {
     SOCKET sock4;
 
-#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS)
+#if defined(RT_OS_DARWIN) || defined(RT_OS_SOLARIS) || defined(RT_OS_OS2)
 #   define DF_WITH_IP_HDRINCL
     int hdrincl;
 #else
@@ -159,7 +162,9 @@
 
     union {
         struct sockaddr_in sin;
+#ifdef IPv6
         struct sockaddr_in6 sin6;
+#endif
     } peer;
 };
 
@@ -197,7 +202,9 @@
 static int pxping_init_windows(struct pxping *pxping);
 #endif
 static void pxping_recv4(void *arg, struct pbuf *p);
+#ifdef IPv6
 static void pxping_recv6(void *arg, struct pbuf *p);
+#endif
 
 static void pxping_timer(void *arg);
 static void pxping_timer_needed(struct pxping *pxping);
@@ -224,6 +231,7 @@
                                    u16_t iplen, struct sockaddr_in *peer);
 static void pxping_pmgr_icmp4_error(struct pxping *pxping,
                                     u16_t iplen, struct sockaddr_in *peer);
+#ifdef IPv6
 static void pxping_pmgr_icmp6(struct pxping *pxping);
 static void pxping_pmgr_icmp6_echo(struct pxping *pxping,
                                    ip6_addr_t *src, ip6_addr_t *dst,
@@ -232,15 +240,18 @@
                                     ip6_addr_t *src, ip6_addr_t *dst,
                                     int hopl, int tclass, u16_t icmplen);
 
+#endif
 static void pxping_pmgr_forward_inbound(struct pxping *pxping, u16_t iplen);
 static void pxping_pcb_forward_inbound(void *arg);
 
+#ifdef IPv6
 static void pxping_pmgr_forward_inbound6(struct pxping *pxping,
                                          ip6_addr_t *src, ip6_addr_t *dst,
                                          u8_t hopl, u8_t tclass,
                                          u16_t icmplen);
 static void pxping_pcb_forward_inbound6(void *arg);
 
+#endif
 /*
  * NB: This is not documented except in RTFS.
  *
@@ -300,6 +311,7 @@
         ping_proxy_accept(pxping_recv4, &g_pxping);
     }
 
+#ifdef IPv6
     g_pxping.sock6 = sock6;
 #ifdef RT_OS_WINDOWS
     /* we need recvmsg */
@@ -344,6 +356,7 @@
 
         ping6_proxy_accept(pxping_recv6, &g_pxping);
     }
+#endif
 
     status = RTStrFormatTypeRegister("ping_pcb", pxping_pcb_rtstrfmt, NULL);
     AssertRC(status);
@@ -663,6 +676,7 @@
 }
 
 
+#ifdef IPv6
 /**
  * ICMPv6 Echo Request in pbuf "p" is to be proxied.
  */
@@ -768,6 +782,7 @@
     pbuf_free(p);
 }
 
+#endif
 
 /**
  * Formatter for %R[ping_pcb].
@@ -792,6 +807,7 @@
         return RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL, "(null)");
     }
 
+#ifdef IPv6
     /* XXX: %RTnaipv4 takes the value, but %RTnaipv6 takes the pointer */
     if (pcb->is_ipv6) {
         cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL,
@@ -802,6 +818,9 @@
         }
     }
     else {
+#else
+    {
+#endif
         cb += RTStrFormat(pfnOutput, pvArgOutput, NULL, NULL,
                           "%RTnaipv4 -> %RTnaipv4",
                           ip4_addr_get_u32(ipX_2_ip(&pcb->src)),
@@ -949,6 +968,7 @@
         pcb->pprev_timeout = NULL;
         pcb->next_timeout = NULL;
 
+#ifdef IPv6
         if (is_ipv6) {
             pcb->peer.sin6.sin6_family = AF_INET6;
 #if HAVE_SA_LEN
@@ -960,6 +980,9 @@
                                           ipX_2_ip6(&pcb->dst));
         }
         else {
+#else
+    {
+#endif
             pcb->peer.sin.sin_family = AF_INET;
 #if HAVE_SA_LEN
             pcb->peer.sin.sin_len = sizeof(pcb->peer.sin);
@@ -1100,7 +1123,7 @@
         int status;
 
         status = getsockopt(fd, SOL_SOCKET,
-                            SO_ERROR, (char *)&sockerr, &optlen);
+                            SO_ERROR, (char *)&sockerr, (int *)&optlen);
         if (status < 0) {
             DPRINTF(("%s: sock %d: SO_ERROR failed: %R[sockerr]\n",
                      __func__, fd, SOCKERRNO()));
@@ -1118,10 +1141,12 @@
     if (fd == pxping->sock4) {
         pxping_pmgr_icmp4(pxping);
     }
+#ifdef IPv6
     else /* fd == pxping->sock6 */ {
         pxping_pmgr_icmp6(pxping);
     }
 
+#endif
     return POLLIN;
 }
 
@@ -1493,6 +1518,7 @@
 }
 
 
+#ifdef IPv6
 /**
  * Process incoming ICMPv6 message for the host.
  * NB: we will get a lot of spam here and have to sift through it.
@@ -1858,6 +1884,7 @@
                                  hopl, tclass, icmplen);
 }
 
+#endif
 
 /**
  * Hand off ICMP datagram to the lwip thread where it will be
@@ -1927,6 +1954,7 @@
 }
 
 
+#ifdef IPv6
 static void
 pxping_pmgr_forward_inbound6(struct pxping *pxping,
                              ip6_addr_t *src, ip6_addr_t *dst,
@@ -1995,3 +2023,4 @@
     pbuf_free(msg->p);
     free(msg);
 }
+#endif
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxtcp.c vbox-trunk\src\VBox\NetworkServices/NAT/pxtcp.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxtcp.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/pxtcp.c	2015-10-30 22:55:54.000000000 +0300
@@ -38,6 +38,13 @@
 #include <stdio.h>
 #include <string.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+# define SHUT_RD SO_RCV_SHUTDOWN
+# define SHUT_WR SO_SND_SHUTDOWN
+# define SHUT_RDWR (SO_RCV_SHUTDOWN | SO_SND_SHUTDOWN)
+typedef unsigned long nfds_t;
+typedef unsigned long socklen_t;
+#endif
 
 #include <err.h>                /* BSD'ism */
 #else
@@ -1133,7 +1140,7 @@
         SOCKET s;
 
         status = getsockopt(pxtcp->sock, SOL_SOCKET, SO_ERROR,
-                            (char *)&pxtcp->sockerr, &optlen);
+                            (char *)&pxtcp->sockerr, (int *)&optlen);
         if (RT_UNLIKELY(status == SOCKET_ERROR)) { /* should not happen */
             DPRINTF(("%s: sock %d: SO_ERROR failed: %R[sockerr]\n",
                      __func__, fd, SOCKERRNO()));
@@ -1245,9 +1252,13 @@
 void
 pxtcp_pcb_connect(struct pxtcp *pxtcp, const struct fwspec *fwspec)
 {
+#ifdef IPv6
     struct sockaddr_storage ss;
+#else
+    struct sockaddr_in ss;
+#endif
     socklen_t sslen;
-    struct tcp_pcb *pcb;
+    struct tcp_pcb *pcb = NULL;
     ipX_addr_t src_addr, dst_addr;
     u16_t src_port, dst_port;
     int status;
@@ -1266,7 +1277,7 @@
     pxtcp_pcb_associate(pxtcp, pcb);
 
     sslen = sizeof(ss);
-    status = getpeername(pxtcp->sock, (struct sockaddr *)&ss, &sslen);
+    status = getpeername(pxtcp->sock, (struct sockaddr *)&ss, (int *)&sslen);
     if (status  == SOCKET_ERROR) {
         goto reset;
     }
@@ -1279,7 +1290,11 @@
         goto reset;
     }
 
+#ifdef IPv6
     if (ss.ss_family == PF_INET) {
+#else
+    if (ss.sin_family == PF_INET) {
+#endif
         const struct sockaddr_in *peer4 = (const struct sockaddr_in *)&ss;
 
         src_port = peer4->sin_port;
@@ -1287,6 +1302,7 @@
         memcpy(&dst_addr.ip4, &fwspec->dst.sin.sin_addr, sizeof(ip_addr_t));
         dst_port = fwspec->dst.sin.sin_port;
     }
+#ifdef IPv6
     else { /* PF_INET6 */
         const struct sockaddr_in6 *peer6 = (const struct sockaddr_in6 *)&ss;
         ip_set_v6(pcb, 1);
@@ -1297,6 +1313,7 @@
         dst_port = fwspec->dst.sin6.sin6_port;
     }
 
+#endif
     /* lwip port arguments are in host order */
     src_port = ntohs(src_port);
     dst_port = ntohs(dst_port);
@@ -1687,7 +1704,7 @@
         socklen_t optlen = (socklen_t)sizeof(sockerr);
 
         status = getsockopt(pxtcp->sock, SOL_SOCKET, SO_ERROR,
-                            (char *)&sockerr, &optlen);
+                            (char *)&sockerr, (int *)&optlen);
         if (status == SOCKET_ERROR) { /* should not happen */
             DPRINTF(("sock %d: SO_ERROR failed: %R[sockerr]\n",
                      fd, SOCKERRNO()));
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxudp.c vbox-trunk\src\VBox\NetworkServices/NAT/pxudp.c
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/pxudp.c	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/pxudp.c	2015-10-30 22:54:58.000000000 +0300
@@ -33,6 +33,9 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <poll.h>
+#ifdef RT_OS_OS2
+typedef unsigned long socklen_t;
+#endif
 
 #include <err.h>                /* BSD'ism */
 #else
@@ -657,6 +660,7 @@
             }
         }
     }
+#ifdef IPv6
     else { /* IPv6 */
         const struct ip6_hdr *iph = ip6_current_header();
         int ttl;
@@ -679,6 +683,7 @@
         }
     }
 
+#endif
     if (pxudp->pcb->local_port == 53) {
         ++pxudp->count;
     }
@@ -743,7 +748,7 @@
         int status;
 
         status = getsockopt(pxudp->sock, SOL_SOCKET,
-                            SO_ERROR, (char *)&sockerr, &optlen);
+                            SO_ERROR, (char *)&sockerr, (int *)&optlen);
         if (status < 0) {
             DPRINTF(("%s: sock %d: SO_ERROR failed:%R[sockerr]\n",
                      __func__, pxudp->sock, SOCKERRNO()));
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NAT/VBoxNetLwipNAT.cpp vbox-trunk\src\VBox\NetworkServices/NAT/VBoxNetLwipNAT.cpp
--- vbox-trunk-bk\src\VBox\NetworkServices/NAT/VBoxNetLwipNAT.cpp	2015-10-25 03:01:00.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NAT/VBoxNetLwipNAT.cpp	2015-10-30 22:45:22.000000000 +0300
@@ -68,7 +68,9 @@
 # ifdef RT_OS_LINUX
 #  include <linux/icmp.h>       /* ICMP_FILTER */
 # endif
+# ifdef IPv6
 # include <netinet/icmp6.h>
+# endif
 #endif
 
 #include <map>
@@ -153,7 +155,9 @@
    private:
     struct proxy_options m_ProxyOptions;
     struct sockaddr_in m_src4;
+#ifdef IPv6
     struct sockaddr_in6 m_src6;
+#endif
     /**
      * place for registered local interfaces.
      */
@@ -646,15 +650,19 @@
     m_ProxyOptions.icmpsock6 = icmpsock6;
     m_ProxyOptions.tftp_root = NULL;
     m_ProxyOptions.src4 = NULL;
-    m_ProxyOptions.src6 = NULL;
     RT_ZERO(m_src4);
-    RT_ZERO(m_src6);
     m_src4.sin_family = AF_INET;
+#ifdef IPv6
+    m_ProxyOptions.src6 = NULL;
+    RT_ZERO(m_src6);
     m_src6.sin6_family = AF_INET6;
+#endif
 #if HAVE_SA_LEN
     m_src4.sin_len = sizeof(m_src4);
+#ifdef IPv6
     m_src6.sin6_len = sizeof(m_src6);
 #endif
+#endif
     m_ProxyOptions.nameservers = NULL;
 
     m_LwipNetIf.name[0] = 'N';
@@ -1085,7 +1093,7 @@
 
     SOCKET icmpsock4 = INVALID_SOCKET;
     SOCKET icmpsock6 = INVALID_SOCKET;
-#ifndef RT_OS_DARWIN
+#if !defined(RT_OS_DARWIN) && !defined(RT_OS_OS2)
     const int icmpstype = SOCK_RAW;
 #else
     /* on OS X it's not privileged */
@@ -1121,6 +1129,7 @@
 #endif
     }
 
+#ifdef IPv6
     icmpsock6 = socket(AF_INET6, icmpstype, IPPROTO_ICMPV6);
     if (icmpsock6 == INVALID_SOCKET)
     {
@@ -1155,6 +1164,7 @@
         }
 #endif
     }
+#endif
 
     HRESULT hrc = com::Initialize();
     if (FAILED(hrc))
@@ -1291,9 +1301,11 @@
 {
     HRESULT hrc;
     com::SafeArray<BSTR> rules;
+#ifdef IPv6
     if (fIsIPv6)
         hrc = nat->COMGETTER(PortForwardRules6)(ComSafeArrayAsOutParam(rules));
     else
+#endif
         hrc = nat->COMGETTER(PortForwardRules4)(ComSafeArrayAsOutParam(rules));
     AssertComRCReturn(hrc, VERR_INTERNAL_ERROR);
 
diff -urN vbox-trunk-bk\src\VBox\NetworkServices/NetLib/VBoxPortForwardString.h vbox-trunk\src\VBox\NetworkServices/NetLib/VBoxPortForwardString.h
--- vbox-trunk-bk\src\VBox\NetworkServices/NetLib/VBoxPortForwardString.h	2015-10-25 03:01:02.000000000 +0300
+++ vbox-trunk\src\VBox\NetworkServices/NetLib/VBoxPortForwardString.h	2015-10-30 22:50:24.000000000 +0300
@@ -23,6 +23,11 @@
 
 RT_C_DECLS_BEGIN
 
+#ifdef RT_OS_OS2
+#include <netinet/in.h>
+#define INET6_ADDRSTRLEN 65
+#endif
+
 #define PF_NAMELEN 64
 /*
  * TBD: Here is shared implementation of parsing port-forward string
