Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/netinet/raw_ip.c,v retrieving revision 1.41.6.1 retrieving revision 1.42 diff -u -p -r1.41.6.1 -r1.42 --- src/sys/netinet/raw_ip.c 1998/12/11 04:53:09 1.41.6.1 +++ src/sys/netinet/raw_ip.c 1999/01/30 21:43:16 1.42 @@ -1,4 +1,4 @@ -/* $NetBSD: raw_ip.c,v 1.41.6.1 1998/12/11 04:53:09 kenh 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) { @@ -308,7 +314,6 @@ rip_bind(inp, nam) struct mbuf *nam; { struct sockaddr_in *addr = mtod(nam, struct sockaddr_in *); - struct ifaddr *ifa = NULL; if (nam->m_len != sizeof(*addr)) return (EINVAL); @@ -318,11 +323,9 @@ rip_bind(inp, nam) addr->sin_family != AF_IMPLINK) return (EAFNOSUPPORT); if (!in_nullhost(addr->sin_addr) && - (ifa = ifa_ifwithaddr(sintosa(addr))) == 0) + ifa_ifwithaddr(sintosa(addr)) == 0) return (EADDRNOTAVAIL); inp->inp_laddr = addr->sin_addr; - if (ifa != NULL) - ifa_delref(ifa); return (0); }