Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet Don't let packets with a Class-D source address ...



details:   https://anonhg.NetBSD.org/src/rev/5f5221ba50db
branches:  trunk
changeset: 472685:5f5221ba50db
user:      hwr <hwr%NetBSD.org@localhost>
date:      Tue May 04 19:50:23 1999 +0000

description:
Don't let packets with a Class-D source address escape the host.
Fixes second half of kern/7003 by Jonathan Stone <jonathan%DSG.Stanford.EDU@localhost>.

diffstat:

 sys/netinet/ip_output.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r 5122ad19a3fc -r 5f5221ba50db sys/netinet/ip_output.c
--- a/sys/netinet/ip_output.c   Tue May 04 17:29:22 1999 +0000
+++ b/sys/netinet/ip_output.c   Tue May 04 19:50:23 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip_output.c,v 1.58 1999/03/27 01:24:50 aidan Exp $     */
+/*     $NetBSD: ip_output.c,v 1.59 1999/05/04 19:50:23 hwr Exp $       */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -325,6 +325,17 @@
        if (in_nullhost(ip->ip_src))
                ip->ip_src = ia->ia_addr.sin_addr;
 #endif
+
+       /*
+        * packets with Class-D address as source are not valid per 
+        * RFC 1112
+        */
+       if (IN_MULTICAST(ip->ip_src.s_addr)) {
+               ipstat.ips_odropped++;
+               error = EADDRNOTAVAIL;
+               goto bad;
+       }
+
        /*
         * Look for broadcast address and
         * and verify user is allowed to send



Home | Main Index | Thread Index | Old Index