VirtualBox

Changeset 17302 in vbox


Ignore:
Timestamp:
Mar 3, 2009 4:36:26 PM (16 years ago)
Author:
vboxsync
Message:

NAT: integrated dnsproxy
the initialization of 2 dns servers should be done to make it work (but before need some comment on xtracker)

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

Legend:

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

    r17227 r17302  
    587587#endif
    588588        fNATfailed = 1;
     589#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     590    dnsproxy_init(pData);
     591#endif
    589592
    590593    getouraddr(pData);
  • trunk/src/VBox/Devices/Network/slirp/slirp.h

    r17191 r17302  
    272272#endif
    273273
     274#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     275# include "dnsproxy/dnsproxy.h"
     276#endif
     277
    274278#define DEFAULT_BAUD 115200
    275279
  • trunk/src/VBox/Devices/Network/slirp/socket.c

    r17191 r17302  
    561561             * out much quicker (10 seconds  for now...)
    562562             */
     563#ifndef VBOX_WITH_SLIRP_DNS_PROXY
    563564            if (so->so_expire)
    564565            {
     
    568569                    so->so_expire = curtime + SO_EXPIRE;
    569570            }
     571#else
     572            if (so->so_expire)
     573            {
     574                if (so->so_fport != htons(53))
     575                    so->so_expire = curtime + SO_EXPIRE;
     576            }
     577            /*
     578             *  last argument should be changed if Slirp will inject IP attributes
     579             *  Note: Here we can't check if dnsproxy's sent initial request
     580             */
     581            dnsproxy_answer(pData, so, m, sizeof(struct ip)); 
     582#endif
    570583
    571584#if 0
  • trunk/src/VBox/Devices/Network/slirp/udp.c

    r17191 r17302  
    228228    so->so_faddr = ip->ip_dst;   /* XXX */
    229229    so->so_fport = uh->uh_dport; /* XXX */
     230
     231#ifdef VBOX_WITH_SLIRP_DNS_PROXY
     232    if (   (ip->ip_dst.s_addr == htonl(ntohl(special_addr.s_addr) | CTL_DNS))
     233        && (ntohs(uh->uh_dport) == 53))
     234    {
     235        dnsproxy_query(pData, so, m, iphlen);
     236        goto bad; /* it isn't bad, probably better to add additional label done for boot/tftf :)  */
     237    }
     238#endif
    230239
    231240    iphlen += sizeof(struct udphdr);
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