From 33a8a5933b4760fb36453ac4e7f16dcca01e6499 Mon Sep 17 00:00:00 2001 From: hwr Date: Mon, 3 May 1999 21:14:47 +0000 Subject: [PATCH] Drop packets, that have a Class-D address as source address. Implements the first half of PR 7003. --- sys/netinet/ip_input.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/sys/netinet/ip_input.c b/sys/netinet/ip_input.c index 4f933a948648..45187ac521fe 100644 --- a/sys/netinet/ip_input.c +++ b/sys/netinet/ip_input.c @@ -1,4 +1,4 @@ -/* $NetBSD: ip_input.c,v 1.84 1999/04/07 05:34:32 proff Exp $ */ +/* $NetBSD: ip_input.c,v 1.85 1999/05/03 21:14:47 hwr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -340,6 +340,15 @@ next: } ip = mtod(m, struct ip *); } + /* + * we drop packets that have a multicast address as source + * as wanted by rfc 1112 + */ + if (IN_MULTICAST(ip->ip_src.s_addr)) { + ipstat.ips_odropped++; + goto bad; + } + if (in_cksum(m, hlen) != 0) { ipstat.ips_badsum++; goto bad;