Module Name:    src
Committed By:   snj
Date:           Tue Jan  9 19:20:17 UTC 2018

Modified Files:
        src/sys/netatalk [netbsd-8]: aarp.c

Log Message:
Pull up following revision(s) (requested by maxv in ticket #479):
        sys/netatalk/aarp.c: revision 1.40
Mmh, pull up the packet to ether_aarp, otherwise we're reading past the
end of the mbuf.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.39.8.1 src/sys/netatalk/aarp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/netatalk/aarp.c
diff -u src/sys/netatalk/aarp.c:1.39 src/sys/netatalk/aarp.c:1.39.8.1
--- src/sys/netatalk/aarp.c:1.39	Mon Aug  1 03:15:30 2016
+++ src/sys/netatalk/aarp.c	Tue Jan  9 19:20:17 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: aarp.c,v 1.39 2016/08/01 03:15:30 ozaki-r Exp $	*/
+/*	$NetBSD: aarp.c,v 1.39.8.1 2018/01/09 19:20:17 snj Exp $	*/
 
 /*
  * Copyright (c) 1990,1991 Regents of The University of Michigan.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.39 2016/08/01 03:15:30 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.39.8.1 2018/01/09 19:20:17 snj Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -351,6 +351,11 @@ at_aarpinput(struct ifnet *ifp, struct m
 	struct psref	psref;
 	struct ifaddr *ifa;
 
+	/* We should also check ar_hln and ar_pln. */
+	if ((m = m_pullup(m, sizeof(struct ether_aarp))) == NULL) {
+		return;
+	}
+
 	ea = mtod(m, struct ether_aarp *);
 
 	/* Check to see if from my hardware address */

Reply via email to