62 |
p->len -= *offset; |
p->len -= *offset; |
63 |
while (len) { |
while (len) { |
64 |
l = len < p->len ? len : p->len; |
l = len < p->len ? len : p->len; |
65 |
bcopy(p->payload, buffer, l); |
memcpy(buffer, p->payload, l); |
66 |
buffer += l; |
buffer += l; |
67 |
len -= l; |
len -= l; |
68 |
if (len) |
if (len) |
112 |
buffer. The timer is updated with the maximum age. */ |
buffer. The timer is updated with the maximum age. */ |
113 |
if (ip_reasstmr == 0) { |
if (ip_reasstmr == 0) { |
114 |
DEBUGF(IP_REASS_DEBUG, ("ip_reass: new packet\n")); |
DEBUGF(IP_REASS_DEBUG, ("ip_reass: new packet\n")); |
115 |
bcopy(fraghdr, iphdr, IP_HLEN); |
memcpy(iphdr, fraghdr, IP_HLEN); |
116 |
ip_reasstmr = IP_REASS_MAXAGE; |
ip_reasstmr = IP_REASS_MAXAGE; |
117 |
sys_timeout(IP_REASS_TMO, (sys_timeout_handler) ip_reass_timer, NULL); |
sys_timeout(IP_REASS_TMO, (sys_timeout_handler) ip_reass_timer, NULL); |
118 |
ip_reassflags = 0; |
ip_reassflags = 0; |
119 |
/* Clear the bitmap. */ |
/* Clear the bitmap. */ |
120 |
bzero(ip_reassbitmap, sizeof(ip_reassbitmap)); |
memset(ip_reassbitmap, 0, sizeof(ip_reassbitmap)); |
121 |
} |
} |
122 |
|
|
123 |
/* Check if the incoming fragment matches the one currently present |
/* Check if the incoming fragment matches the one currently present |
235 |
avaliable data in the pbuf is given by the q->len |
avaliable data in the pbuf is given by the q->len |
236 |
variable. */ |
variable. */ |
237 |
DEBUGF(IP_REASS_DEBUG, |
DEBUGF(IP_REASS_DEBUG, |
238 |
("ip_reass: bcopy from %p (%d) to %p, %d bytes\n", |
("ip_reass: memcpy from %p (%d) to %p, %d bytes\n", |
239 |
&ip_reassbuf[i], i, q->payload, |
&ip_reassbuf[i], i, q->payload, |
240 |
q->len > ip_reasslen - i ? ip_reasslen - i : q->len)); |
q->len > ip_reasslen - i ? ip_reasslen - i : q->len)); |
241 |
bcopy(&ip_reassbuf[i], q->payload, |
memcpy(q->payload, &ip_reassbuf[i], |
242 |
q->len > ip_reasslen - i ? ip_reasslen - i : q->len); |
q->len > ip_reasslen - i ? ip_reasslen - i : q->len); |
243 |
i += q->len; |
i += q->len; |
244 |
} |
} |
284 |
|
|
285 |
/* Copy the IP header in it */ |
/* Copy the IP header in it */ |
286 |
iphdr = rambuf->payload; |
iphdr = rambuf->payload; |
287 |
bcopy(p->payload, iphdr, IP_HLEN); |
memcpy(iphdr, p->payload, IP_HLEN); |
288 |
|
|
289 |
/* Save original offset */ |
/* Save original offset */ |
290 |
tmp = ntohs(IPH_OFFSET(iphdr)); |
tmp = ntohs(IPH_OFFSET(iphdr)); |