Source-Changes-HG archive

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

[src/trunk]: src/sys/net initialize args the same way we do in filter.



details:   https://anonhg.NetBSD.org/src/rev/6adde26c30ca
branches:  trunk
changeset: 330472:6adde26c30ca
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jul 10 15:32:09 2014 +0000

description:
initialize args the same way we do in filter.

diffstat:

 sys/net/bpf.c |  16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diffs (42 lines):

diff -r 1224373f3412 -r 6adde26c30ca sys/net/bpf.c
--- a/sys/net/bpf.c     Thu Jul 10 15:26:30 2014 +0000
+++ b/sys/net/bpf.c     Thu Jul 10 15:32:09 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bpf.c,v 1.183 2014/06/24 10:53:30 alnsn Exp $  */
+/*     $NetBSD: bpf.c,v 1.184 2014/07/10 15:32:09 christos Exp $       */
 
 /*
  * Copyright (c) 1990, 1991, 1993
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.183 2014/06/24 10:53:30 alnsn Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bpf.c,v 1.184 2014/07/10 15:32:09 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_bpf.h"
@@ -1388,16 +1388,18 @@
     void *pkt, u_int pktlen, u_int buflen, const bool rcv)
 {
        struct timespec ts;
-       bpf_args_t args;
+       bpf_args_t args = {
+               .pkt = (const uint8_t *)pkt,
+               .wirelen = pktlen,
+               .buflen = buflen,
+               .mem = NULL,
+               .arg = NULL
+       };
        struct bpf_d *d;
 
        const bpf_ctx_t *bc = NULL;
        bool gottime = false;
 
-       args.pkt = (const uint8_t *)pkt;
-       args.wirelen = pktlen;
-       args.buflen = buflen;
-
        /*
         * Note that the IPL does not have to be raised at this point.
         * The only problem that could arise here is that if two different



Home | Main Index | Thread Index | Old Index