Module Name: src
Committed By: maxv
Date: Sat Dec 9 10:14:04 UTC 2017
Modified Files:
src/sys/netatalk: aarp.c
Log Message:
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.40 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.40
--- src/sys/netatalk/aarp.c:1.39 Mon Aug 1 03:15:30 2016
+++ src/sys/netatalk/aarp.c Sat Dec 9 10:14:04 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: aarp.c,v 1.39 2016/08/01 03:15:30 ozaki-r Exp $ */
+/* $NetBSD: aarp.c,v 1.40 2017/12/09 10:14:04 maxv 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.40 2017/12/09 10:14:04 maxv 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 */