Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/net/lib/libvirtif Trim alignment out of packet leng...



details:   https://anonhg.NetBSD.org/src/rev/ea87d33c2834
branches:  trunk
changeset: 327848:ea87d33c2834
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Mar 18 18:10:08 2014 +0000

description:
Trim alignment out of packet length before passing it up.

diffstat:

 sys/rump/net/lib/libvirtif/if_virt.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (30 lines):

diff -r 7940392548a0 -r ea87d33c2834 sys/rump/net/lib/libvirtif/if_virt.c
--- a/sys/rump/net/lib/libvirtif/if_virt.c      Tue Mar 18 17:11:19 2014 +0000
+++ b/sys/rump/net/lib/libvirtif/if_virt.c      Tue Mar 18 18:10:08 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $       */
+/*     $NetBSD: if_virt.c,v 1.45 2014/03/18 18:10:08 pooka Exp $       */
 
 /*
  * Copyright (c) 2008, 2013 Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.44 2014/03/13 21:11:12 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_virt.c,v 1.45 2014/03/18 18:10:08 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -353,8 +353,10 @@
                        return;
                }
        }
+       m->m_data += align;
+       m->m_pkthdr.len -= align;
+       m->m_len -= align;
 
-       m->m_data += align;
        eth = mtod(m, struct ether_header *);
        if (memcmp(eth->ether_dhost, CLLADDR(ifp->if_sadl),
            ETHER_ADDR_LEN) == 0) {



Home | Main Index | Thread Index | Old Index