Revision 511d2b14 slirp/ip_input.c
b/slirp/ip_input.c | ||
---|---|---|
60 | 60 |
* All protocols not implemented in kernel go to raw IP protocol handler. |
61 | 61 |
*/ |
62 | 62 |
void |
63 |
ip_init() |
|
63 |
ip_init(void)
|
|
64 | 64 |
{ |
65 | 65 |
ipq.ip_link.next = ipq.ip_link.prev = &ipq.ip_link; |
66 | 66 |
ip_id = tt.tv_sec & 0xffff; |
... | ... | |
73 | 73 |
* try to reassemble. Process options. Pass to next level. |
74 | 74 |
*/ |
75 | 75 |
void |
76 |
ip_input(m) |
|
77 |
struct mbuf *m; |
|
76 |
ip_input(struct mbuf *m) |
|
78 | 77 |
{ |
79 | 78 |
register struct ip *ip; |
80 | 79 |
int hlen; |
... | ... | |
222 | 221 |
if (ip->ip_tos & 1 || ip->ip_off) { |
223 | 222 |
STAT(ipstat.ips_fragments++); |
224 | 223 |
ip = ip_reass(ip, fp); |
225 |
if (ip == 0)
|
|
224 |
if (ip == NULL)
|
|
226 | 225 |
return; |
227 | 226 |
STAT(ipstat.ips_reassembled++); |
228 | 227 |
m = dtom(ip); |
... | ... | |
289 | 288 |
/* |
290 | 289 |
* If first fragment to arrive, create a reassembly queue. |
291 | 290 |
*/ |
292 |
if (fp == 0) {
|
|
291 |
if (fp == NULL) {
|
|
293 | 292 |
struct mbuf *t; |
294 | 293 |
if ((t = m_get()) == NULL) goto dropfrag; |
295 | 294 |
fp = mtod(t, struct ipq *); |
... | ... | |
357 | 356 |
for (q = fp->frag_link.next; q != (struct ipasfrag*)&fp->frag_link; |
358 | 357 |
q = q->ipf_next) { |
359 | 358 |
if (q->ipf_off != next) |
360 |
return (0);
|
|
359 |
return NULL;
|
|
361 | 360 |
next += q->ipf_len; |
362 | 361 |
} |
363 | 362 |
if (((struct ipasfrag *)(q->ipf_prev))->ipf_tos & 1) |
364 |
return (0);
|
|
363 |
return NULL;
|
|
365 | 364 |
|
366 | 365 |
/* |
367 | 366 |
* Reassembly is complete; concatenate fragments. |
... | ... | |
414 | 413 |
dropfrag: |
415 | 414 |
STAT(ipstat.ips_fragdropped++); |
416 | 415 |
m_freem(m); |
417 |
return (0);
|
|
416 |
return NULL;
|
|
418 | 417 |
} |
419 | 418 |
|
420 | 419 |
/* |
... | ... | |
466 | 465 |
* queue, discard it. |
467 | 466 |
*/ |
468 | 467 |
void |
469 |
ip_slowtimo() |
|
468 |
ip_slowtimo(void)
|
|
470 | 469 |
{ |
471 | 470 |
struct qlink *l; |
472 | 471 |
|
... | ... | |
474 | 473 |
|
475 | 474 |
l = ipq.ip_link.next; |
476 | 475 |
|
477 |
if (l == 0)
|
|
476 |
if (l == NULL)
|
|
478 | 477 |
return; |
479 | 478 |
|
480 | 479 |
while (l != &ipq.ip_link) { |
... | ... | |
702 | 701 |
* (XXX) should be deleted; last arg currently ignored. |
703 | 702 |
*/ |
704 | 703 |
void |
705 |
ip_stripoptions(m, mopt) |
|
706 |
register struct mbuf *m; |
|
707 |
struct mbuf *mopt; |
|
704 |
ip_stripoptions(register struct mbuf *m, struct mbuf *mopt) |
|
708 | 705 |
{ |
709 | 706 |
register int i; |
710 | 707 |
struct ip *ip = mtod(m, struct ip *); |
Also available in: Unified diff