VirtualBox

Changeset 62696 in vbox for trunk/src/VBox/Devices/Network


Ignore:
Timestamp:
Jul 29, 2016 2:50:18 PM (8 years ago)
Author:
vboxsync
Message:

slirp: some warning and HN fixes.

Location:
trunk/src/VBox/Devices/Network/slirp
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bsd/sys/mbuf.h

    r55192 r62696  
    623623        AssertMsg(SLIST_EMPTY(&m->m_pkthdr.tags), ("doing fast free of mbuf with tags"));
    624624
    625         uma_zfree_arg(zone_mbuf, m, (void *)MB_NOTAGS);
     625        uma_zfree_arg(zone_mbuf, m, (void *)(uintptr_t)MB_NOTAGS);
    626626}
    627627#endif
  • trunk/src/VBox/Devices/Network/slirp/ip_icmpwin.c

    r62692 r62696  
    7171 * XXX: this is system-wide, but what about multiple NAT threads?
    7272 */
    73 static void *pfIcmpCallback;
     73static PIO_APC_ROUTINE pfnIcmpCallback;
    7474
    7575
     
    7777icmpwin_init(PNATState pData)
    7878{
    79     if (pfIcmpCallback == NULL)
     79    if (pfnIcmpCallback == NULL)
    8080    {
    8181        OSVERSIONINFO osvi;
     
    8989
    9090        if (osvi.dwMajorVersion >= 6)
    91             pfIcmpCallback = icmpwin_callback_apc;
     91            pfnIcmpCallback = icmpwin_callback_apc;
    9292        else
    93             pfIcmpCallback = icmpwin_callback_old;
     93            pfnIcmpCallback = (PIO_APC_ROUTINE)icmpwin_callback_old;
    9494    }
    9595
     
    176176        reqdata = pong->buf;
    177177        m_copydata(m, sizeof(struct ip) + sizeof(struct icmp_echo),
    178                    reqsize, reqdata);
     178                   (int)reqsize, reqdata);
    179179    }
    180180
     
    189189
    190190    status = IcmpSendEcho2(pData->icmp_socket.sh, NULL,
    191                            pfIcmpCallback, pong,
     191                           (FARPROC)pfnIcmpCallback, pong,
    192192                           dst, reqdata, (WORD)reqsize, &opts,
    193193                           pong->buf, (DWORD)pong->bufsize,
     
    250250    if (pong != NULL)
    251251        icmpwin_callback(pong);
     252    RT_NOREF2(iob, reserved);
    252253}
    253254
     
    389390        /* fill in ip (ip_output0() does the boilerplate for us) */
    390391        ip->ip_tos = reply->Options.Tos;
    391         ip->ip_len = sizeof(*ip) + sizeof(*icmp) + reqsize;
     392        ip->ip_len = sizeof(*ip) + sizeof(*icmp) + (int)reqsize;
    392393        ip->ip_off = 0;
    393394        ip->ip_ttl = reply->Options.Ttl;
     
    402403        icmp->icmp_echo_seq = pong->reqicmph.icmp_echo_seq;
    403404
    404         m_append(pData, m, reqsize, reply->Data);
     405        m_append(pData, m, (int)reqsize, reply->Data);
    405406
    406407        icmp->icmp_cksum = in_cksum_skip(m, ip->ip_len, sizeof(*ip));
     
    485486
    486487    ip->ip_tos = 0;
    487     ip->ip_len = sizeof(*ip) + sizeof(*icmp) + reqsize;
     488    ip->ip_len = sizeof(*ip) + sizeof(*icmp) + (int)reqsize;
    488489    ip->ip_off = 0;
    489490    ip->ip_ttl = IPDEFTTL;
     
    524525        m = m_gethdr(pData, M_NOWAIT, MT_HEADER);
    525526    else
    526         m = m_getjcl(pData, M_NOWAIT, MT_HEADER, M_PKTHDR, slirp_size(pData));
     527        m = m_getjcl(pData, M_NOWAIT, MT_HEADER, M_PKTHDR, (int)slirp_size(pData));
    527528
    528529    if (m == NULL)
     
    537538    return m;
    538539}
     540
  • trunk/src/VBox/Devices/Network/slirp/slirp.c

    r62692 r62696  
    236236 * Loging macros
    237237 */
    238 #if VBOX_WITH_DEBUG_NAT_SOCKETS
     238#ifdef VBOX_WITH_DEBUG_NAT_SOCKETS
    239239# if defined(RT_OS_WINDOWS)
    240240#  define  DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset)             \
     
    254254   } while (0)
    255255# endif /* !RT_OS_WINDOWS */
    256 #else /* !VBOX_WITH_DEBUG_NAT_SOCKETS */
     256#else  /* !VBOX_WITH_DEBUG_NAT_SOCKETS */
    257257# define DO_LOG_NAT_SOCK(so, proto, winevent, r_fdset, w_fdset, x_fdset) do {} while (0)
    258258#endif /* !VBOX_WITH_DEBUG_NAT_SOCKETS */
     
    341341        WSAStartup(MAKEWORD(2, 0), &Data);
    342342
    343         rc = RTLdrLoadSystem("Iphlpapi.dll", /* :fNoUnload */ true, &hLdrMod);
     343        rc = RTLdrLoadSystem("Iphlpapi.dll", true /*fNoUnload*/, &hLdrMod);
    344344        if (RT_SUCCESS(rc))
    345345        {
    346             rc = RTLdrGetSymbol(hLdrMod, "GetAdaptersAddresses", (void **)&pData->pfGetAdaptersAddresses);
     346            rc = RTLdrGetSymbol(hLdrMod, "GetAdaptersAddresses", (void **)&pData->pfnGetAdaptersAddresses);
    347347            if (RT_FAILURE(rc))
    348348                LogRel(("NAT: Can't find GetAdapterAddresses in Iphlpapi.dll\n"));
     
    411411#endif
    412412        flags |= pData->i32AliasMode; /* do transparent proxying */
    413         flags = LibAliasSetMode(pData->proxy_alias, flags, ~0);
     413        flags = LibAliasSetMode(pData->proxy_alias, flags, ~0U);
    414414        proxy_addr.s_addr = RT_H2N_U32(RT_N2H_U32(pData->special_addr.s_addr) | CTL_ALIAS);
    415415        LibAliasSetAddress(pData->proxy_alias, proxy_addr);
     
    10701070                /* should we ignore return value? */
    10711071                bool fRet = slirpConnectOrWrite(pData, so, true);
    1072                 LogFunc(("fRet:%RTbool\n", fRet));
     1072                LogFunc(("fRet:%RTbool\n", fRet)); NOREF(fRet);
    10731073                if (slirpVerifyAndFreeSocket(pData, so))
    10741074                    CONTINUE(tcp);
     
    13801380    struct ethhdr *eh;
    13811381
    1382     m->m_len = cbBuf;
     1382    m->m_len = (int)cbBuf; Assert((size_t)m->m_len == cbBuf);
    13831383    if (cbBuf < ETH_HLEN)
    13841384    {
     
    14311431    struct ethhdr *eh;
    14321432    uint8_t *mbuf = NULL;
    1433     size_t mlen = 0;
     1433    int mlen;
    14341434    STAM_PROFILE_START(&pData->StatIF_encap, a);
    14351435    LogFlowFunc(("ENTER: pData:%p, eth_proto:%RX16, m:%p, flags:%d\n",
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r62692 r62696  
    178178# include <time.h>
    179179#else
     180# ifndef HAVE_SYS_TIME_H
     181#  define HAVE_SYS_TIME_H 0
     182# endif
    180183# if HAVE_SYS_TIME_H
    181184#  include <sys/time.h>
  • trunk/src/VBox/Devices/Network/slirp/slirp_dns.c

    r62692 r62696  
    4848    /* determine size of buffer */
    4949    size = 0;
    50     ret = pData->pfGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);
     50    ret = pData->pfnGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);
    5151    if (ret != ERROR_BUFFER_OVERFLOW)
    5252    {
     
    6666        return -1;
    6767    }
    68     ret = pData->pfGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);
     68    ret = pData->pfnGetAdaptersAddresses(AF_INET, 0, NULL /* reserved */, pAdapterAddr, &size);
    6969    if (ret != ERROR_SUCCESS)
    7070    {
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r62511 r62696  
    144144    int soMaxConn;
    145145#ifdef RT_OS_WINDOWS
    146     ULONG (WINAPI * pfGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
     146    ULONG (WINAPI * pfnGetAdaptersAddresses)(ULONG, ULONG, PVOID, PIP_ADAPTER_ADDRESSES, PULONG);
    147147#endif
    148148    struct dns_list_head pDnsList;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette