VirtualBox

Ignore:
Timestamp:
Sep 11, 2014 9:15:33 PM (10 years ago)
Author:
vboxsync
Message:

NAT: Convert NATState::curtime from milliseconds to seconds when we
assign it to libalias instance timeStamp and g/c ifdefed code to do
that when link expiration time is checked. Reduces diff with original.

File:
1 edited

Legend:

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

    r52684 r52711  
    991991    LIST_FOREACH_SAFE(lnk, &la->linkTableOut[la->cleanupIndex++],
    992992        list_out, lnk_tmp) {
    993 #ifndef VBOX
    994993        if (la->timeStamp - lnk->timestamp > lnk->expire_time)
    995 #else
    996         /* libalias counts time in seconds while slirp in millis */
    997         if (la->timeStamp - lnk->timestamp > (1000 * lnk->expire_time))
    998 #endif
    999994            DeleteLink(lnk);
    1000995    }
     
    23992394#endif
    24002395#else  /* VBOX */
    2401     la->timeStamp = la->curtime;
     2396    la->timeStamp = la->curtime / 1000; /* NB: la->pData->curtime (msec) */
    24022397#endif
    24032398
    24042399    /* Compute number of spokes (output table link chains) to cover */
    2405 #ifndef VBOX
    24062400    n = LINK_TABLE_OUT_SIZE * (la->timeStamp - la->lastCleanupTime);
    2407 #else
    2408     n = LINK_TABLE_OUT_SIZE * ((la->timeStamp - la->lastCleanupTime)/1000);
    2409 #endif
    24102401    n /= ALIAS_CLEANUP_INTERVAL_SECS;
    24112402
     
    27362727#else  /* VBOX */
    27372728        la->pData = pData;
    2738         la->timeStamp = curtime;
    2739         la->lastCleanupTime = curtime;
     2729        la->timeStamp = la->curtime / 1000; /* NB: la->pData->curtime (msec) */
     2730        la->lastCleanupTime = la->timeStamp;
    27402731#endif /* VBOX */
    27412732
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