Ignore:
Timestamp:
Feb 1, 2019, 9:57:09 PM (5 years ago)
Author:
coas-nagasima
Message:

TINETとSocket APIなどを更新

File:
1 edited

Legend:

Unmodified
Added
Removed
  • asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udpn_input.c

    r352 r364  
    7575{
    7676        T_UDP_HDR       *udph;
    77         uint_t          len;
     77        T_UDP_RCV_DAT_PARA para;
    7878
    7979        udph = (T_UDP_HDR *)(input->buf + off);
    80         len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
     80        para.len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
    8181
    8282        if (cep->rcv_tskid != TA_NULL) {        /* 非ノンブロッキングコールでペンディング中 */
     
    9898                /* データをバッファに移す。*/
    9999                memcpy(cep->rcv_data, GET_UDP_SDU(input, off),
    100                        (size_t)(len < cep->rcv_len ? len : cep->rcv_len));
     100                       (size_t)(para.len < cep->rcv_len ? para.len : cep->rcv_len));
    101101                syscall(rel_net_buf(input));
    102102
     
    104104
    105105#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    106                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)len);
     106                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    107107#else
    108                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&len);
     108                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&para.len);
    109109#endif
    110110                else
     
    121121
    122122#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    123                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)len);
     123                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    124124#else
    125                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&len);
     125                para.input = input;
     126                para.off = off;
     127#if API_PROTO == API_PROTO_IPV4
     128                para.rep4.portno = ntohs(udph->sport);
     129                IN_COPY_TO_HOST(&para.rep4.ipaddr, input);
     130#else
     131                para.rep6.portno = ntohs(udph->sport);
     132                IN_COPY_TO_HOST(&para.rep6.ipaddr, input);
     133#endif
     134                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&para.len);
    126135#endif
    127136                /*
     
    129138                 *  データを読み出さなかったことになるので、捨てる。
    130139                 */
    131                 if (cep->cb_netbuf != NULL)
    132                         syscall(rel_net_buf(cep->cb_netbuf));
     140                if (cep->cb_netbuf != NULL) {
     141                        if ((input->flags & NB_FLG_NOREL_IFOUT) == 0)
     142                                syscall(rel_net_buf(cep->cb_netbuf));
     143                        cep->cb_netbuf = NULL;
     144                        }
    133145                }
    134146        else {
Note: See TracChangeset for help on using the changeset viewer.