Source-Changes-HG archive

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

[src/trunk]: src/sys/netatalk Make sure to set length in AARP-response packet...



details:   https://anonhg.NetBSD.org/src/rev/34a7b094f28e
branches:  trunk
changeset: 747385:34a7b094f28e
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Sep 12 20:43:18 2009 +0000

description:
Make sure to set length in AARP-response packets. PR kern/41124

diffstat:

 sys/netatalk/aarp.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (31 lines):

diff -r fe1f9f49e3cf -r 34a7b094f28e sys/netatalk/aarp.c
--- a/sys/netatalk/aarp.c       Sat Sep 12 19:55:29 2009 +0000
+++ b/sys/netatalk/aarp.c       Sat Sep 12 20:43:18 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: aarp.c,v 1.33 2009/04/18 14:58:05 tsutsui Exp $        */
+/*     $NetBSD: aarp.c,v 1.34 2009/09/12 20:43:18 tsutsui 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.33 2009/04/18 14:58:05 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: aarp.c,v 1.34 2009/09/12 20:43:18 tsutsui Exp $");
 
 #include "opt_mbuftrace.h"
 
@@ -443,6 +443,12 @@
                m_freem(m);
                return;
        }
+
+       /*
+        * Prepare and send AARP-response.
+        */
+       m->m_len = sizeof(*ea);
+       m->m_pkthdr.len = sizeof(*ea);
        memcpy(ea->aarp_tha, ea->aarp_sha, sizeof(ea->aarp_sha));
        memcpy(ea->aarp_sha, CLLADDR(ifp->if_sadl), sizeof(ea->aarp_sha));
 



Home | Main Index | Thread Index | Old Index