VirtualBox

Changeset 56176 in vbox


Ignore:
Timestamp:
Jun 1, 2015 9:29:58 AM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
100709
Message:

NAT: Don't forcibly reset/drop all connections when link goes down.
Link flap we do to prod DHCP must not be fatal for established
connections if connectivity hasn't really changed.

File:
1 edited

Legend:

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

    r55869 r56176  
    489489void slirp_link_down(PNATState pData)
    490490{
    491     struct socket *so;
    492491    struct port_forward_rule *rule;
    493492
     
    496495
    497496    slirpReleaseDnsSettings(pData);
     497
     498    /*
     499     *  Clear the active state of port-forwarding rules to force
     500     *  re-setup on restoration of communications.
     501     */
     502    LIST_FOREACH(rule, &pData->port_forward_rule_head, list)
     503    {
     504        rule->activated = 0;
     505    }
     506    pData->cRedirectionsActive = 0;
     507
     508    link_up = 0;
     509}
     510
     511/**
     512 * Terminates the slirp component.
     513 */
     514void slirp_term(PNATState pData)
     515{
     516    struct socket *so;
     517
     518    if (pData == NULL)
     519        return;
     520
     521    icmp_finit(pData);
    498522
    499523    while ((so = tcb.so_next) != &tcb)
     
    510534    while ((so = udb.so_next) != &udb)
    511535        udp_detach(pData, so);
    512 
    513     /*
    514      *  Clear the active state of port-forwarding rules to force
    515      *  re-setup on restoration of communications.
    516      */
    517     LIST_FOREACH(rule, &pData->port_forward_rule_head, list)
    518     {
    519         rule->activated = 0;
    520     }
    521     pData->cRedirectionsActive = 0;
    522 
    523     link_up = 0;
    524 }
    525 
    526 /**
    527  * Terminates the slirp component.
    528  */
    529 void slirp_term(PNATState pData)
    530 {
    531     if (pData == NULL)
    532         return;
    533     icmp_finit(pData);
    534536
    535537    slirp_link_down(pData);
Note: See TracChangeset for help on using the changeset viewer.

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