Changeset 1ede059 in mainline


Ignore:
Timestamp:
2015-06-06T15:06:20Z (9 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c15d6f
Parents:
2c4bb828
Message:

Give portrng a chance to actually allocate the port.

Location:
uspace/lib/nettl/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nettl/src/amap.c

    r2c4bb828 r1ede059  
    394394        }
    395395
    396         /** Allocate local port? */
    397         if (mepp.local.port == inet_port_any) {
    398                 mepp.local.port = inet_port_dyn_lo; /* XXX */
    399                 log_msg(LOG_DEFAULT, LVL_NOTE, "amap_insert: allocated local "
    400                     "port %" PRIu16, mepp.local.port);
    401         } else {
    402                 log_msg(LOG_DEFAULT, LVL_NOTE, "amap_insert: local "
    403                     "port %" PRIu16 " specified", mepp.local.port);
    404         }
    405 
    406396        raddr = !inet_addr_is_any(&mepp.remote.addr);
    407397        rport = mepp.remote.port != inet_port_any;
  • uspace/lib/nettl/src/portrng.c

    r2c4bb828 r1ede059  
    102102                log_msg(LOG_DEFAULT, LVL_NOTE, "selected %" PRIu16, pnum);
    103103        } else {
     104                log_msg(LOG_DEFAULT, LVL_NOTE, "user asked for %" PRIu16, pnum);
     105
    104106                if ((flags & pf_allow_system) == 0 &&
    105107                    pnum < inet_port_user_lo) {
     108                        log_msg(LOG_DEFAULT, LVL_NOTE, "system port not allowed");
    106109                        return EINVAL;
    107110                }
    108111
    109112                list_foreach(pr->used, lprng, portrng_port_t, port) {
    110                         if (port->pn == pnum)
     113                        if (port->pn == pnum) {
     114                                log_msg(LOG_DEFAULT, LVL_NOTE, "port already used");
    111115                                return EEXISTS;
     116                        }
    112117                }
    113118        }
Note: See TracChangeset for help on using the changeset viewer.