VirtualBox

Changeset 61905 in vbox for trunk


Ignore:
Timestamp:
Jun 27, 2016 4:26:41 PM (8 years ago)
Author:
vboxsync
Message:

NAT/libalias: Fix cppcheck complaint by applying FreeBSD's revisions
190938 and 190941 - check the right error code and check it early.

File:
1 edited

Legend:

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

    r56377 r61905  
    751751        u_short alias_port;
    752752        int accumulate;
    753         int r = 0, error;
     753        int error;
    754754        struct alias_data ad;
    755755        ad.lnk = lnk;
     
    769769        /* Walk out chain. */
    770770        error = find_handler(IN, UDP, la, pip, &ad);
     771        /* If we cannot figure out the packet, ignore it. */
     772        if (error < 0)
     773            return (PKT_ALIAS_IGNORED);
    771774
    772775/* If UDP checksum is not zero, then adjust since destination port */
     
    784787        pip->ip_dst = original_address;
    785788
    786         /*
    787          * If we cannot figure out the packet, ignore it.
    788          */
    789         if (r < 0)
    790             return (PKT_ALIAS_IGNORED);
    791         else
    792             return (PKT_ALIAS_OK);
     789        return (PKT_ALIAS_OK);
    793790    }
    794791    return (PKT_ALIAS_IGNORED);
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