Ignore:
Timestamp:
Jul 3, 2020, 7:19:17 PM (4 years ago)
Author:
coas-nagasima
Message:

ASP3, TINET, mbed を更新

File:
1 edited

Legend:

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

    r331 r429  
    8888{
    8989        T_UDP_HDR       *udph;
    90         uint_t          len;
     90        T_UDP_RCV_DAT_PARA para;
    9191
    9292        udph = (T_UDP_HDR *)(input->buf + off);
    93         len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
     93        para.len  = (uint_t)(ntohs(udph->ulen) - UDP_HDR_SIZE);
    9494
    9595        if (cep->rcv_tskid != TA_NULL) {        /* 非ノンブロッキングコールでペンディング中 */
     
    111111                /* データをバッファに移す。*/
    112112                memcpy(cep->rcv_data, GET_UDP_SDU(input, off),
    113                        (size_t)(len < cep->rcv_len ? len : cep->rcv_len));
     113                       (size_t)(para.len < cep->rcv_len ? para.len : cep->rcv_len));
    114114                syscall(rel_net_buf(input));
    115115
     
    117117
    118118#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    119                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)len);
     119                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    120120#else
    121                         (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&len);
     121                        (*cep->callback)(GET_UDP_CEPID(cep), TFN_UDP_RCV_DAT, (void*)&para.len);
    122122#endif
    123123                else
     
    134134
    135135#ifdef TCP_CFG_NON_BLOCKING_COMPAT14
    136                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)len);
     136                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)(uint32_t)para.len);
    137137#else
    138                 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&len);
     138                para.input = input;
     139                para.off = off;
     140#if API_PROTO == API_PROTO_IPV4
     141                para.rep4.portno = ntohs(udph->sport);
     142                IN_COPY_TO_HOST(&para.rep4.ipaddr, input);
     143#else
     144                para.rep6.portno = ntohs(udph->sport);
     145                IN_COPY_TO_HOST(&para.rep6.ipaddr, input);
     146#endif
     147                (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)&para.len);
    139148#endif
    140149                /*
     
    143152                 *  データを読み出さなかったことになるので、捨てる。
    144153                 */
    145                 if (cep->cb_netbuf != NULL)
    146                         syscall(rel_net_buf(cep->cb_netbuf));
     154                if (cep->cb_netbuf != NULL) {
     155                        if ((input->flags & NB_FLG_NOREL_IFOUT) == 0)
     156                                syscall(rel_net_buf(cep->cb_netbuf));
     157                        cep->cb_netbuf = NULL;
     158                        }
    147159                }
    148160        else {
Note: See TracChangeset for help on using the changeset viewer.