Make programs that use raw IP work again; trim the header length from ip_len
before handing the packet off to the socket.
This commit is contained in:
parent
0287662346
commit
a22cfcf3d4
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: raw_ip.c,v 1.41 1998/04/03 07:49:16 thorpej Exp $ */
|
||||
/* $NetBSD: raw_ip.c,v 1.42 1999/01/30 21:43:16 thorpej Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1982, 1986, 1988, 1993
|
||||
|
@ -112,6 +112,12 @@ rip_input(m, va_alist)
|
|||
ripsrc.sin_port = 0;
|
||||
bzero((caddr_t)ripsrc.sin_zero, sizeof(ripsrc.sin_zero));
|
||||
|
||||
/*
|
||||
* XXX Compatibility: programs using raw IP expect ip_len
|
||||
* XXX to have the header length subtracted.
|
||||
*/
|
||||
ip->ip_len -= ip->ip_hl << 2;
|
||||
|
||||
for (inp = rawcbtable.inpt_queue.cqh_first;
|
||||
inp != (struct inpcb *)&rawcbtable.inpt_queue;
|
||||
inp = inp->inp_queue.cqe_next) {
|
||||
|
|
Loading…
Reference in New Issue