Changeset 8d48c7e in mainline


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

Find the association to deliver the datagram using amap.

Location:
uspace
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/inet.c

    rab6326bc r8d48c7e  
    177177       
    178178        dgram.tos = IPC_GET_ARG1(*icall);
     179        dgram.iplink = IPC_GET_ARG2(*icall);
    179180       
    180181        ipc_callid_t callid;
  • uspace/lib/c/generic/iplink.c

    rab6326bc r8d48c7e  
    4747static void iplink_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg);
    4848
    49 int iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops,
     49int iplink_open(async_sess_t *sess, iplink_ev_ops_t *ev_ops, void *arg,
    5050    iplink_t **riplink)
    5151{
     
    5656        iplink->sess = sess;
    5757        iplink->ev_ops = ev_ops;
     58        iplink->arg = arg;
    5859       
    5960        async_exch_t *exch = async_exchange_begin(sess);
     
    234235       
    235236        return (int) retval;
     237}
     238
     239void *iplink_get_userptr(iplink_t *iplink)
     240{
     241        return iplink->arg;
    236242}
    237243
  • uspace/lib/c/include/inet/iplink.h

    rab6326bc r8d48c7e  
    4444        async_sess_t *sess;
    4545        struct iplink_ev_ops *ev_ops;
     46        void *arg;
    4647} iplink_t;
    4748
     
    8182} iplink_ev_ops_t;
    8283
    83 extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, iplink_t **);
     84extern int iplink_open(async_sess_t *, iplink_ev_ops_t *, void *, iplink_t **);
    8485extern void iplink_close(iplink_t *);
    8586extern int iplink_send(iplink_t *, iplink_sdu_t *);
     
    9091extern int iplink_get_mac48(iplink_t *, addr48_t *);
    9192extern int iplink_set_mac48(iplink_t *, addr48_t);
     93extern void *iplink_get_userptr(iplink_t *);
    9294
    9395#endif
  • uspace/lib/nettl/include/nettl/amap.h

    rab6326bc r8d48c7e  
    9696    inet_ep2_t *);
    9797extern void amap_remove(amap_t *, inet_ep2_t *);
    98 extern int amap_find(amap_t *, inet_ep2_t *, void **);
     98extern int amap_find_match(amap_t *, inet_ep2_t *, void **);
    9999
    100100#endif
  • uspace/lib/nettl/include/nettl/portrng.h

    rab6326bc r8d48c7e  
    4646        /** Port number */
    4747        uint16_t pn;
     48        /** User argument */
     49        void *arg;
    4850} portrng_port_t;
    4951
     
    6062extern int portrng_alloc(portrng_t *, uint16_t, void *,
    6163    portrng_flags_t, uint16_t *);
     64extern int portrng_find_port(portrng_t *, uint16_t, void **);
    6265extern void portrng_free_port(portrng_t *, uint16_t);
    6366extern bool portrng_empty(portrng_t *);
  • uspace/lib/nettl/src/amap.c

    rab6326bc r8d48c7e  
    510510}
    511511
    512 int amap_find(amap_t *map, inet_ep2_t *epp, void **rarg)
    513 {
    514         log_msg(LOG_DEFAULT, LVL_NOTE, "amap_find()");
    515         return EOK;
     512/** Find association matching an endpoint pair.
     513 *
     514 * Used to find which association to deliver a datagram to.
     515 *
     516 * @param map   Association map
     517 * @param epp   Endpoint pair
     518 * @param rarg  Place to store user argument for the matching association.
     519 *
     520 * @return      EOK on success, ENOENT if not found.
     521 */
     522int amap_find_match(amap_t *map, inet_ep2_t *epp, void **rarg)
     523{
     524        int rc;
     525        amap_repla_t *repla;
     526        amap_laddr_t *laddr;
     527        amap_llink_t *llink;
     528
     529        log_msg(LOG_DEFAULT, LVL_NOTE, "amap_find_match(llink=%zu)",
     530            epp->local_link);
     531
     532        /* Remode endpoint, local address */
     533        rc = amap_repla_find(map, &epp->remote, &epp->local.addr, &repla);
     534        if (rc == EOK) {
     535                rc = portrng_find_port(repla->portrng, epp->local.port,
     536                    rarg);
     537                if (rc == EOK) {
     538                        log_msg(LOG_DEFAULT, LVL_NOTE, "Matched repla / "
     539                            "port %" PRIu16, epp->local.port);
     540                        return EOK;
     541                }
     542        }
     543
     544        /* Local address */
     545        rc = amap_laddr_find(map, &epp->local.addr, &laddr);
     546        if (rc == EOK) {
     547                rc = portrng_find_port(laddr->portrng, epp->local.port,
     548                    rarg);
     549                if (rc == EOK) {
     550                        log_msg(LOG_DEFAULT, LVL_NOTE, "Matched laddr / "
     551                            "port %" PRIu16, epp->local.port);
     552                        return EOK;
     553                }
     554        }
     555
     556        /* Local link */
     557        rc = amap_llink_find(map, epp->local_link, &llink);
     558        if (epp->local_link != 0 && rc == EOK) {
     559                rc = portrng_find_port(llink->portrng, epp->local.port,
     560                    rarg);
     561                if (rc == EOK) {
     562                        log_msg(LOG_DEFAULT, LVL_NOTE, "Matched llink / "
     563                            "port %" PRIu16, epp->local.port);
     564                        return EOK;
     565                }
     566        }
     567
     568        /* Unspecified */
     569        rc = portrng_find_port(map->unspec, epp->local.port, rarg);
     570        if (rc == EOK) {
     571                log_msg(LOG_DEFAULT, LVL_NOTE, "Matched unspec / port %" PRIu16,
     572                    epp->local.port);
     573                return EOK;
     574        }
     575
     576        log_msg(LOG_DEFAULT, LVL_NOTE, "No match.");
     577        return ENOENT;
    516578}
    517579
  • uspace/lib/nettl/src/portrng.c

    rab6326bc r8d48c7e  
    118118
    119119        p->pn = pnum;
     120        p->arg = arg;
    120121        list_append(&p->lprng, &pr->used);
    121122        *apnum = pnum;
     
    123124            pnum);
    124125        return EOK;
     126}
     127
     128int portrng_find_port(portrng_t *pr, uint16_t pnum, void **rarg)
     129{
     130        list_foreach(pr->used, lprng, portrng_port_t, port) {
     131                if (port->pn == pnum) {
     132                        *rarg = port->arg;
     133                        return EOK;
     134                }
     135        }
     136
     137        return ENOENT;
    125138}
    126139
  • uspace/srv/net/inetsrv/inet_link.c

    rab6326bc r8d48c7e  
    7373{
    7474        memcpy(ip_addr, link_local_node_ip, 16);
    75        
     75
    7676        ip_addr[8] = mac_addr[0] ^ 0x02;
    7777        ip_addr[9] = mac_addr[1];
     
    8585{
    8686        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_iplink_recv()");
    87        
     87
    8888        int rc;
    8989        inet_packet_t packet;
    90        
     90        inet_link_t *ilink;
     91
     92        ilink = (inet_link_t *)iplink_get_userptr(iplink);
     93
    9194        switch (ver) {
    9295        case ip_v4:
    93                 rc = inet_pdu_decode(sdu->data, sdu->size, &packet);
     96                rc = inet_pdu_decode(sdu->data, sdu->size, ilink->svc_id,
     97                    &packet);
    9498                break;
    9599        case ip_v6:
    96                 rc = inet_pdu_decode6(sdu->data, sdu->size, &packet);
     100                rc = inet_pdu_decode6(sdu->data, sdu->size, ilink->svc_id,
     101                    &packet);
    97102                break;
    98103        default:
     
    100105                return EINVAL;
    101106        }
    102        
     107
    103108        if (rc != EOK) {
    104109                log_msg(LOG_DEFAULT, LVL_DEBUG, "failed decoding PDU");
    105110                return rc;
    106111        }
    107        
     112
     113        log_msg(LOG_DEFAULT, LVL_NOTE, "inet_iplink_recv: link_id=%zu", packet.link_id);
    108114        log_msg(LOG_DEFAULT, LVL_DEBUG, "call inet_recv_packet()");
    109115        rc = inet_recv_packet(&packet);
    110116        log_msg(LOG_DEFAULT, LVL_DEBUG, "call inet_recv_packet -> %d", rc);
    111117        free(packet.data);
    112        
     118
    113119        return rc;
    114120}
     
    177183        }
    178184
    179         rc = iplink_open(ilink->sess, &inet_iplink_ev_ops, &ilink->iplink);
     185        rc = iplink_open(ilink->sess, &inet_iplink_ev_ops, ilink, &ilink->iplink);
    180186        if (rc != EOK) {
    181187                log_msg(LOG_DEFAULT, LVL_ERROR, "Failed opening IP link '%s'",
  • uspace/srv/net/inetsrv/inetsrv.c

    rab6326bc r8d48c7e  
    469469{
    470470        async_exch_t *exch = async_exchange_begin(client->sess);
    471        
     471
    472472        ipc_call_t answer;
    473         aid_t req = async_send_1(exch, INET_EV_RECV, dgram->tos, &answer);
    474        
     473
     474        log_msg(LOG_DEFAULT, LVL_NOTE, "inet_ev_recv: iplink=%zu",
     475            dgram->iplink);
     476
     477        aid_t req = async_send_2(exch, INET_EV_RECV, dgram->tos,
     478            dgram->iplink, &answer);
     479
    475480        int rc = async_data_write_start(exch, &dgram->src, sizeof(inet_addr_t));
    476481        if (rc != EOK) {
     
    479484                return rc;
    480485        }
    481        
     486
    482487        rc = async_data_write_start(exch, &dgram->dest, sizeof(inet_addr_t));
    483488        if (rc != EOK) {
     
    486491                return rc;
    487492        }
    488        
     493
    489494        rc = async_data_write_start(exch, dgram->data, dgram->size);
    490        
     495
    491496        async_exchange_end(exch);
    492        
     497
    493498        if (rc != EOK) {
    494499                async_forget(req);
    495500                return rc;
    496501        }
    497        
     502
    498503        sysarg_t retval;
    499504        async_wait_for(req, &retval);
    500        
     505
    501506        return (int) retval;
    502507}
     
    511516        if (proto == IP_PROTO_ICMP)
    512517                return icmp_recv(dgram);
    513        
     518
    514519        if (proto == IP_PROTO_ICMPV6)
    515520                return icmpv6_recv(dgram);
     
    540545                if (packet->offs == 0 && !packet->mf) {
    541546                        /* It is complete deliver it immediately */
     547                        dgram.iplink = packet->link_id;
    542548                        dgram.src = packet->src;
    543549                        dgram.dest = packet->dest;
  • uspace/srv/net/inetsrv/inetsrv.h

    rab6326bc r8d48c7e  
    7575
    7676typedef struct {
     77        /** Local link ID */
     78        service_id_t link_id;
    7779        /** Source address */
    7880        inet_addr_t src;
  • uspace/srv/net/inetsrv/pdu.c

    rab6326bc r8d48c7e  
    298298/** Decode IPv4 datagram
    299299 *
    300  * @param data   Serialized IPv4 datagram
    301  * @param size   Length of serialized IPv4 datagram
    302  * @param packet IP datagram structure to be filled
     300 * @param data    Serialized IPv4 datagram
     301 * @param size    Length of serialized IPv4 datagram
     302 * @param link_id Link on which PDU was received
     303 * @param packet  IP datagram structure to be filled
    303304 *
    304305 * @return EOK on success
     
    307308 *
    308309 */
    309 int inet_pdu_decode(void *data, size_t size, inet_packet_t *packet)
     310int inet_pdu_decode(void *data, size_t size, service_id_t link_id,
     311    inet_packet_t *packet)
    310312{
    311313        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_pdu_decode()");
     
    366368       
    367369        memcpy(packet->data, (uint8_t *) data + data_offs, packet->size);
     370        packet->link_id = link_id;
    368371       
    369372        return EOK;
     
    372375/** Decode IPv6 datagram
    373376 *
    374  * @param data   Serialized IPv6 datagram
    375  * @param size   Length of serialized IPv6 datagram
    376  * @param packet IP datagram structure to be filled
     377 * @param data    Serialized IPv6 datagram
     378 * @param size    Length of serialized IPv6 datagram
     379 * @param link_id Link on which PDU was received
     380 * @param packet  IP datagram structure to be filled
    377381 *
    378382 * @return EOK on success
     
    381385 *
    382386 */
    383 int inet_pdu_decode6(void *data, size_t size, inet_packet_t *packet)
     387int inet_pdu_decode6(void *data, size_t size, service_id_t link_id,
     388    inet_packet_t *packet)
    384389{
    385390        log_msg(LOG_DEFAULT, LVL_DEBUG, "inet_pdu_decode6()");
     
    457462       
    458463        memcpy(packet->data, (uint8_t *) data + data_offs, packet->size);
    459        
     464        packet->link_id = link_id;
    460465        return EOK;
    461466}
  • uspace/srv/net/inetsrv/pdu.h

    rab6326bc r8d48c7e  
    3838#define INET_PDU_H_
    3939
     40#include <loc.h>
    4041#include <sys/types.h>
    4142#include "inetsrv.h"
     
    5051extern int inet_pdu_encode6(inet_packet_t *, addr128_t, addr128_t, size_t,
    5152    size_t, void **, size_t *, size_t *);
    52 extern int inet_pdu_decode(void *, size_t, inet_packet_t *);
    53 extern int inet_pdu_decode6(void *, size_t, inet_packet_t *);
     53extern int inet_pdu_decode(void *, size_t, service_id_t, inet_packet_t *);
     54extern int inet_pdu_decode6(void *, size_t, service_id_t, inet_packet_t *);
    5455
    5556extern int ndp_pdu_decode(inet_dgram_t *, ndp_packet_t *);
  • uspace/srv/net/inetsrv/reass.c

    rab6326bc r8d48c7e  
    325325                return ENOMEM;
    326326
     327        /* XXX What if different fragments came from different link? */
     328        dgram.iplink = frag->packet.link_id;
    327329        dgram.size = dgram_size;
    328330        dgram.src = frag->packet.src;
  • uspace/srv/net/tcp/conn.c

    rab6326bc r8d48c7e  
    199199void tcp_conn_addref(tcp_conn_t *conn)
    200200{
    201         log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_addref(%p)", conn->name, conn);
     201        log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_addref(%p) before=%zu",
     202            conn->name, conn, atomic_get(&conn->refcnt));
    202203        atomic_inc(&conn->refcnt);
    203204}
     
    211212void tcp_conn_delref(tcp_conn_t *conn)
    212213{
    213         log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_delref(%p)", conn->name, conn);
     214        log_msg(LOG_DEFAULT, LVL_DEBUG2, "%s: tcp_conn_delref(%p) before=%zu",
     215            conn->name, conn, atomic_get(&conn->refcnt));
    214216
    215217        if (atomic_predec(&conn->refcnt) == 0)
     
    269271        tcp_conn_addref(conn);
    270272        fibril_mutex_lock(&conn_list_lock);
     273
     274        log_msg(LOG_DEFAULT, LVL_NOTE, "tcp_conn_add: conn=%p", conn);
    271275
    272276        rc = amap_insert(amap, &conn->ident, conn, af_allow_system, &aepp);
     
    365369}
    366370
    367 /** Match endpoint with pattern. */
    368 static bool tcp_ep_match(inet_ep_t *ep, inet_ep_t *patt)
    369 {
    370         log_msg(LOG_DEFAULT, LVL_DEBUG2,
    371             "tcp_ep_match(ep=(%u), pat=(%u))", ep->port, patt->port);
    372 
    373         if ((!inet_addr_is_any(&patt->addr)) &&
    374             (!inet_addr_compare(&patt->addr, &ep->addr)))
    375                 return false;
    376 
    377         if ((patt->port != inet_port_any) &&
    378             (patt->port != ep->port))
    379                 return false;
    380 
    381         log_msg(LOG_DEFAULT, LVL_DEBUG2, " -> match");
    382 
    383         return true;
    384 }
    385 
    386 /** Match endpoint pair with pattern. */
    387 static bool tcp_ep2_match(inet_ep2_t *epp, inet_ep2_t *pattern)
    388 {
    389         log_msg(LOG_DEFAULT, LVL_DEBUG2, "tcp_ep2_match(%p, %p)", epp, pattern);
    390 
    391         if (!tcp_ep_match(&epp->local, &pattern->local))
    392                 return false;
    393 
    394         if (!tcp_ep_match(&epp->remote, &pattern->remote))
    395                 return false;
    396 
    397         return true;
    398 }
    399 
    400371/** Find connection structure for specified endpoint pair.
    401372 *
     
    409380tcp_conn_t *tcp_conn_find_ref(inet_ep2_t *epp)
    410381{
     382        int rc;
     383        void *arg;
     384        tcp_conn_t *conn;
     385
    411386        log_msg(LOG_DEFAULT, LVL_DEBUG, "tcp_conn_find_ref(%p)", epp);
    412387
    413         log_msg(LOG_DEFAULT, LVL_DEBUG2, "compare conn (f:(%u), l:(%u))",
    414             epp->remote.port, epp->local.port);
    415 
    416388        fibril_mutex_lock(&conn_list_lock);
    417389
    418         list_foreach(conn_list, link, tcp_conn_t, conn) {
    419                 inet_ep2_t *cepp = &conn->ident;
    420 
    421                 log_msg(LOG_DEFAULT, LVL_DEBUG2, " - with (f:(%u), l:(%u))",
    422                     cepp->remote.port, cepp->local.port);
    423 
    424                 if (tcp_ep2_match(epp, cepp)) {
    425                         tcp_conn_addref(conn);
    426                         fibril_mutex_unlock(&conn_list_lock);
    427                         return conn;
    428                 }
    429         }
     390        rc = amap_find_match(amap, epp, &arg);
     391        if (rc != EOK) {
     392                assert(rc == ENOENT);
     393                fibril_mutex_unlock(&conn_list_lock);
     394                return NULL;
     395        }
     396
     397        conn = (tcp_conn_t *)arg;
     398        tcp_conn_addref(conn);
    430399
    431400        fibril_mutex_unlock(&conn_list_lock);
    432         return NULL;
     401        log_msg(LOG_DEFAULT, LVL_NOTE, "tcp_conn_find_ref: got conn=%p",
     402            conn);
     403        return conn;
    433404}
    434405
     
    12091180void tcp_conn_segment_arrived(tcp_conn_t *conn, tcp_segment_t *seg)
    12101181{
    1211         log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: tcp_conn_segment_arrived(%p)",
     1182        log_msg(LOG_DEFAULT, LVL_NOTE, "conn=%p", conn);
     1183        log_msg(LOG_DEFAULT, LVL_NOTE, "conn->name=%p", conn->name);
     1184        log_msg(LOG_DEFAULT, LVL_NOTE, "%s: tcp_conn_segment_arrived(%p)",
    12121185            conn->name, seg);
    12131186
  • uspace/srv/net/tcp/service.c

    rab6326bc r8d48c7e  
    156156        }
    157157
     158        conn->name = (char *) "s";
    158159        clst->conn = conn;
    159160
     
    353354                return EIO;
    354355
     356        conn->name = (char *) "c";
     357
    355358        rc = tcp_cconn_create(client, conn, &cconn);
    356359        if (rc != EOK) {
     
    402405        if (trc != TCP_EOK)
    403406                return EIO;
     407
     408        conn->name = (char *) "s";
    404409
    405410        rc = tcp_clistener_create(client, conn, &clst);
  • uspace/srv/net/udp/assoc.c

    rab6326bc r8d48c7e  
    5656static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *);
    5757static int udp_assoc_queue_msg(udp_assoc_t *, inet_ep2_t *, udp_msg_t *);
    58 static bool udp_ep_match(inet_ep_t *, inet_ep_t *);
    59 static bool udp_ep2_match(inet_ep2_t *, inet_ep2_t *);
    6058
    6159/** Initialize associations. */
     
    393391}
    394392
    395 /** Match endpoint with pattern. */
    396 static bool udp_ep_match(inet_ep_t *ep, inet_ep_t *patt)
    397 {
    398         char *sa, *pa;
    399 
    400         sa = pa = (char *)"?";
    401         (void) inet_addr_format(&ep->addr, &sa);
    402         (void) inet_addr_format(&patt->addr, &pa);
    403 
    404         log_msg(LOG_DEFAULT, LVL_NOTE,
    405             "udp_ep_match(ep=(%s,%u), pat=(%s,%u))",
    406             sa, ep->port, pa, patt->port);
    407 
    408         if ((!inet_addr_is_any(&patt->addr)) &&
    409             (!inet_addr_compare(&patt->addr, &ep->addr)))
    410                 return false;
    411 
    412         log_msg(LOG_DEFAULT, LVL_NOTE, "addr OK");
    413 
    414         if ((patt->port != inet_port_any) &&
    415             (patt->port != ep->port))
    416                 return false;
    417 
    418         log_msg(LOG_DEFAULT, LVL_NOTE, " -> match");
    419 
    420         return true;
    421 }
    422 
    423 /** Match endpoint pair with pattern. */
    424 static bool udp_ep2_match(inet_ep2_t *epp, inet_ep2_t *pattern)
    425 {
    426         log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_ep2_match(%p, %p)", epp, pattern);
    427 
    428         if (!udp_ep_match(&epp->local, &pattern->local))
    429                 return false;
    430 
    431         if (!udp_ep_match(&epp->remote, &pattern->remote))
    432                 return false;
    433 
    434         log_msg(LOG_DEFAULT, LVL_DEBUG, "Endpoint pair matched.");
    435         return true;
    436 }
    437 
    438 
    439393/** Find association structure for specified endpoint pair.
    440394 *
     
    448402static udp_assoc_t *udp_assoc_find_ref(inet_ep2_t *epp)
    449403{
    450         char *la, *ra;
     404        int rc;
     405        void *arg;
     406        udp_assoc_t *assoc;
    451407
    452408        log_msg(LOG_DEFAULT, LVL_NOTE, "udp_assoc_find_ref(%p)", epp);
    453 
    454409        fibril_mutex_lock(&assoc_list_lock);
    455410
    456         log_msg(LOG_DEFAULT, LVL_NOTE, "associations:");
    457         list_foreach(assoc_list, link, udp_assoc_t, assoc) {
    458                 inet_ep2_t *aepp = &assoc->ident;
    459 
    460                 la = ra = NULL;
    461 
    462                 (void) inet_addr_format(&aepp->local.addr, &la);
    463                 (void) inet_addr_format(&aepp->remote.addr, &ra);
    464 
    465                 log_msg(LOG_DEFAULT, LVL_NOTE, "find_ref:aepp=%p la=%s ra=%s",
    466                     aepp, la, ra);
    467                 /* Skip unbound associations */
    468                 if (aepp->local.port == inet_port_any) {
    469                         log_msg(LOG_DEFAULT, LVL_NOTE, "skip unbound");
    470                         continue;
    471                 }
    472 
    473                 if (udp_ep2_match(epp, aepp)) {
    474                         log_msg(LOG_DEFAULT, LVL_DEBUG, "Returning assoc %p", assoc);
    475                         udp_assoc_addref(assoc);
    476                         fibril_mutex_unlock(&assoc_list_lock);
    477                         return assoc;
    478                 } else {
    479                         log_msg(LOG_DEFAULT, LVL_NOTE, "not matched");
    480                 }
    481         }
    482 
    483         log_msg(LOG_DEFAULT, LVL_NOTE, "associations END");
     411        rc = amap_find_match(amap, epp, &arg);
     412        if (rc != EOK) {
     413                assert(rc == ENOMEM);
     414                fibril_mutex_unlock(&assoc_list_lock);
     415                return NULL;
     416        }
     417
     418        assoc = (udp_assoc_t *)arg;
     419        udp_assoc_addref(assoc);
     420
    484421        fibril_mutex_unlock(&assoc_list_lock);
    485         return NULL;
     422        return assoc;
    486423}
    487424
  • uspace/srv/net/udp/pdu.c

    rab6326bc r8d48c7e  
    179179        hdr = (udp_header_t *)pdu->data;
    180180
     181        epp->local_link = pdu->iplink;
    181182        epp->remote.port = uint16_t_be2host(hdr->src_port);
    182183        epp->remote.addr = pdu->src;
  • uspace/srv/net/udp/udp_inet.c

    rab6326bc r8d48c7e  
    6363        log_msg(LOG_DEFAULT, LVL_DEBUG, "udp_inet_ev_recv()");
    6464
     65        log_msg(LOG_DEFAULT, LVL_NOTE, "udp_inet_ev_recv: link=%zu",
     66            dgram->iplink);
     67
    6568        pdu = udp_pdu_new();
     69        pdu->iplink = dgram->iplink;
    6670        pdu->data = dgram->data;
    6771        pdu->data_size = dgram->size;
Note: See TracChangeset for help on using the changeset viewer.