Source-Changes-HG archive

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

[src/trunk]: src/sys/net Don't assume if_init is always set



details:   https://anonhg.NetBSD.org/src/rev/032f1462cd8a
branches:  trunk
changeset: 330787:032f1462cd8a
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Mon Jul 21 12:03:38 2014 +0000

description:
Don't assume if_init is always set

if_init may be NULL, e.g., if_vlan.

PR kern/48997

diffstat:

 sys/net/link_proto.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r d751cd16b673 -r 032f1462cd8a sys/net/link_proto.c
--- a/sys/net/link_proto.c      Mon Jul 21 05:56:26 2014 +0000
+++ b/sys/net/link_proto.c      Mon Jul 21 12:03:38 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: link_proto.c,v 1.16 2014/07/15 20:17:53 joerg Exp $    */
+/*     $NetBSD: link_proto.c,v 1.17 2014/07/21 12:03:38 ozaki-r Exp $  */
 
 /*-
  * Copyright (c) 1982, 1986, 1993
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.16 2014/07/15 20:17:53 joerg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: link_proto.c,v 1.17 2014/07/21 12:03:38 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/socket.h>
@@ -213,7 +213,8 @@
                splx(s);
                if (error != ENETRESET)
                        return error;
-               else if ((ifp->if_flags & IFF_RUNNING) != 0)
+               else if ((ifp->if_flags & IFF_RUNNING) != 0 &&
+                        ifp->if_init != NULL)
                        return (*ifp->if_init)(ifp);
                else
                        return 0;



Home | Main Index | Thread Index | Old Index