VirtualBox

Changeset 19981 in vbox for trunk/src


Ignore:
Timestamp:
May 25, 2009 7:00:41 AM (16 years ago)
Author:
vboxsync
Message:

NAT: warnings and style

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/bootp.c

    r19979 r19981  
    3232    int i;
    3333
    34     for(i = 0; i < NB_ADDR; i++)
     34    for (i = 0; i < NB_ADDR; i++)
    3535    {
    3636        if (!bootp_clients[i].allocated)
     
    6767    int i;
    6868
    69     for(i = 0; i < NB_ADDR; i++)
     69    for (i = 0; i < NB_ADDR; i++)
    7070    {
    7171        if (!memcmp(macaddr, bootp_clients[i].macaddr, 6))
  • trunk/src/VBox/Devices/Network/slirp/ip_output.c

    r19847 r19981  
    4646
    4747#ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER
    48 char * rt_lookup_in_cache(PNATState pData, uint32_t dst)
     48static const uint8_t* rt_lookup_in_cache(PNATState pData, uint32_t dst)
    4949{
    5050    int i;
    51    /* @todo (r - vasily) to quick ramp up on routing rails 
    52     * we use information from DHCP server leasings, this 
    53     * code couldn't detect any changes in network topology 
    54     * and should be borrowed from other places 
     51   /* @todo (r - vasily) to quick ramp up on routing rails
     52    * we use information from DHCP server leasings, this
     53    * code couldn't detect any changes in network topology
     54    * and should be borrowed from other places
    5555    */
    56     for(i = 0; i < NB_ADDR; i++)
    57     {
    58         if (    bootp_clients[i].allocated
     56    for (i = 0; i < NB_ADDR; i++)
     57    {
     58        if (   bootp_clients[i].allocated
    5959            && bootp_clients[i].addr.s_addr == dst)
    60         {
    6160            return &bootp_clients[i].macaddr[0];
    62         }
    63     }
     61    }
     62
    6463    if (dst != 0)
    65     {
    6664        return pData->slirp_ethaddr;
    67     }
    68    return NULL;
     65
     66    return NULL;
    6967}
    7068#endif
     
    8684    extern uint8_t zerro_ethaddr[ETH_ALEN];
    8785    struct ethhdr *eh = NULL;
    88     uint8_t *eth_dst = NULL;
     86    const uint8_t *eth_dst = NULL;
    8987#endif
    9088
     
    127125#endif
    128126#ifdef VBOX_WITHOUT_SLIRP_CLIENT_ETHER
    129       /* Current TCP/IP stack hasn't routing information at 
    130        * all so we need to calculate destination ethernet address 
     127      /* Current TCP/IP stack hasn't routing information at
     128       * all so we need to calculate destination ethernet address
    131129       */
    132130     eh = (struct ethhdr *)MBUF_HEAD(m);
    133      if (memcmp(eh->h_source, zerro_ethaddr, ETH_ALEN) == 0) {
     131     if (memcmp(eh->h_source, zerro_ethaddr, ETH_ALEN) == 0)
    134132         eth_dst = rt_lookup_in_cache(pData, ip->ip_dst.s_addr);
    135      }
    136        
    137133#endif
    138134
  • trunk/src/VBox/Devices/Network/slirp/slirp_state.h

    r19979 r19981  
    132132    uint8_t client_ethaddr[6];
    133133#else
    134     uint8_t *slirp_ethaddr;
     134    const uint8_t *slirp_ethaddr;
    135135#endif
    136136    struct ex_list *exec_list;
     
    383383    QSOCKET_UNLOCK(__X(queue_## label ##_label));                     \
    384384    if ((so) != &(_X(queue_## label ## _label))) SOCKET_LOCK((so));   \
    385     for(;;)                                                           \
     385    for (;;)                                                          \
    386386    {                                                                 \
    387387        if ((so) == &(_X(queue_## label ## _label)))                  \
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r17363 r19981  
    583583                u_short temp_port;
    584584
    585                 for(req = req_tbl; req; req = req->next)
     585                for (req = req_tbl; req; req = req->next)
    586586                    if (so == req->udp_so)
    587587                        break;          /* found it */
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