diff options
author | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-19 02:54:30 +0000 |
---|---|---|
committer | Jun-ichiro itojun Hagino <itojun@cvs.openbsd.org> | 1999-12-19 02:54:30 +0000 |
commit | 299cb47d4b91dd39397f1381470b01a59576b3e0 (patch) | |
tree | e3ae7c8e8015e806d8b7ce6378d68ad6af4b34ea /sys | |
parent | be9086c62b7e91b764ea52a42f9fff7836b3ef21 (diff) |
disallow AF mismatch on inbound.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/raw_ip.c | 6 | ||||
-rw-r--r-- | sys/netinet6/raw_ipv6.c | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index aaa68c43380..6dc96735557 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ip.c,v 1.19 1999/09/23 07:20:35 deraadt Exp $ */ +/* $OpenBSD: raw_ip.c,v 1.20 1999/12/19 02:54:29 itojun Exp $ */ /* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */ /* @@ -121,6 +121,10 @@ rip_input(m, va_alist) for (inp = rawcbtable.inpt_queue.cqh_first; inp != (struct inpcb *)&rawcbtable.inpt_queue; inp = inp->inp_queue.cqe_next) { +#ifdef INET6 + if (inp->inp_flags & INP_IPV6) + continue; +#endif if (inp->inp_ip.ip_p && inp->inp_ip.ip_p != ip->ip_p) continue; if (inp->inp_laddr.s_addr && diff --git a/sys/netinet6/raw_ipv6.c b/sys/netinet6/raw_ipv6.c index fa3a45ba5bf..34f7f68f341 100644 --- a/sys/netinet6/raw_ipv6.c +++ b/sys/netinet6/raw_ipv6.c @@ -1,4 +1,4 @@ -/* $OpenBSD: raw_ipv6.c,v 1.9 1999/12/15 07:08:00 itojun Exp $ */ +/* $OpenBSD: raw_ipv6.c,v 1.10 1999/12/19 02:54:29 itojun Exp $ */ /* %%% copyright-nrl-95 This software is Copyright 1995-1998 by Randall Atkinson, Ronald Lee, @@ -43,7 +43,7 @@ didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>. * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $Id: raw_ipv6.c,v 1.9 1999/12/15 07:08:00 itojun Exp $ + * $Id: raw_ipv6.c,v 1.10 1999/12/19 02:54:29 itojun Exp $ */ #include <sys/param.h> @@ -264,6 +264,8 @@ rip6_input(mp, offp, proto) inp != (struct inpcb *)&rawin6pcbtable.inpt_queue; inp = inp->inp_queue.cqe_next) { + if (!(inp->inp_flags & INP_IPV6)) + continue; if (inp->inp_ipv6.ip6_nxt && inp->inp_ipv6.ip6_nxt != nexthdr) continue; if (!IN6_IS_ADDR_UNSPECIFIED(&inp->inp_laddr6) && |