- Timestamp:
- Feb 1, 2019, 9:57:09 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
asp3_tinet_ecnl_arm/trunk/asp3_dcre/tinet/netinet/udpn_input.c
r352 r364 75 75 { 76 76 T_UDP_HDR *udph; 77 uint_t len;77 T_UDP_RCV_DAT_PARA para; 78 78 79 79 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); 81 81 82 82 if (cep->rcv_tskid != TA_NULL) { /* 非ノンブロッキングコールでペンディング中 */ … … 98 98 /* データをバッファに移す。*/ 99 99 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)); 101 101 syscall(rel_net_buf(input)); 102 102 … … 104 104 105 105 #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); 107 107 #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*)¶.len); 109 109 #endif 110 110 else … … 121 121 122 122 #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); 124 124 #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(¶.rep4.ipaddr, input); 130 #else 131 para.rep6.portno = ntohs(udph->sport); 132 IN_COPY_TO_HOST(¶.rep6.ipaddr, input); 133 #endif 134 (*cep->callback)(GET_UDP_CEPID(cep), TEV_UDP_RCV_DAT, (void*)¶.len); 126 135 #endif 127 136 /* … … 129 138 * データを読み出さなかったことになるので、捨てる。 130 139 */ 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 } 133 145 } 134 146 else {
Note:
See TracChangeset
for help on using the changeset viewer.