Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1ede059 in mainline for uspace/lib/nettl/src/portrng.c


Ignore:
Timestamp:
2015-06-06T15:06:20Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
7c15d6f
Parents:
2c4bb828
Message:

Give portrng a chance to actually allocate the port.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.