Changeset 331 for EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip_output.c
- Timestamp:
- Jan 21, 2018, 12:10:09 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
EcnlProtoTool/trunk/asp3_dcre/tinet/netinet/ip_output.c
r321 r331 2 2 * TINET (TCP/IP Protocol Stack) 3 3 * 4 * Copyright (C) 2001-20 09by Dep. of Computer Science and Engineering4 * Copyright (C) 2001-2017 by Dep. of Computer Science and Engineering 5 5 * Tomakomai National College of Technology, JAPAN 6 6 * … … 93 93 #include <net/ppp.h> 94 94 #include <net/net.h> 95 #include <net/net_endian.h> 95 96 #include <net/net_buf.h> 96 97 #include <net/net_count.h> … … 104 105 #include <netinet6/ipsec.h> 105 106 #endif 107 108 #if defined(_IP4_CFG) 106 109 107 110 static uint16_t frag_id = 0; … … 221 224 222 225 len = ntohs(ip4h->len); 223 off = hlen = GET_IP4_HDR_SIZE( ip4h);226 off = hlen = GET_IP4_HDR_SIZE(output); 224 227 while (off < len) { 225 228 if (off + (IF_MTU - IP4_HDR_SIZE) < len) … … 245 248 fip4h->id = htons(frag_id); 246 249 fip4h->sum = 0; 247 fip4h->sum = in_cksum(fip4h, GET_IP4_HDR_SIZE(f ip4h));250 fip4h->sum = in_cksum(fip4h, GET_IP4_HDR_SIZE(frag)); 248 251 249 252 NET_COUNT_IP4(net_count_ip4[NC_IP4_OUT_OCTETS], ntohs(fip4h->len)); … … 279 282 frag_id ++; 280 283 ip4h->sum = 0; 281 ip4h->sum = in_cksum(ip4h, GET_IP4_HDR_SIZE( ip4h));284 ip4h->sum = in_cksum(ip4h, GET_IP4_HDR_SIZE(output)); 282 285 283 286 NET_COUNT_IP4(net_count_ip4[NC_IP4_OUT_OCTETS], ntohs(ip4h->len)); … … 301 304 frag_id ++; 302 305 ip4h->sum = 0; 303 ip4h->sum = in_cksum(ip4h, (uint_t)GET_IP4_HDR_SIZE( ip4h));306 ip4h->sum = in_cksum(ip4h, (uint_t)GET_IP4_HDR_SIZE(output)); 304 307 305 308 NET_COUNT_IP4(net_count_ip4[NC_IP4_OUT_OCTETS], ntohs(ip4h->len)); … … 327 330 return error; 328 331 } 332 333 #endif /* of #if defined(_IP4_CFG) */
Note:
See TracChangeset
for help on using the changeset viewer.