-/* $OpenBSD: if_bridge.c,v 1.299 2017/11/20 10:17:40 mpi Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.300 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
struct ifnet *ifp;
int i;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (!sc)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
sc->sc_stp = bstp_create(&sc->sc_if);
if (!sc->sc_stp) {
free(sc, M_DEVBUF, sizeof *sc);
-/* $OpenBSD: if_etherip.c,v 1.28 2017/11/20 10:35:24 mpi Exp $ */
+/* $OpenBSD: if_etherip.c,v 1.29 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2015 Kazuya GODA <goda@openbsd.org>
*
struct ifnet *ifp;
struct etherip_softc *sc;
- if ((sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return ENOMEM;
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = &sc->sc_ac.ac_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "etherip%d", unit);
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-/* $OpenBSD: if_gif.c,v 1.106 2018/01/09 10:08:01 mpi Exp $ */
+/* $OpenBSD: if_gif.c,v 1.107 2018/01/09 15:24:24 bluhm Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
{
struct gif_softc *sc;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (!sc)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(sc->gif_if.if_xname, sizeof sc->gif_if.if_xname,
"%s%d", ifc->ifc_name, unit);
sc->gif_if.if_mtu = GIF_MTU;
-/* $OpenBSD: if_gre.c,v 1.88 2017/10/20 09:35:09 mpi Exp $ */
+/* $OpenBSD: if_gre.c,v 1.89 2018/01/09 15:24:24 bluhm Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
{
struct gre_softc *sc;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (!sc)
- return (ENOMEM);
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(sc->sc_if.if_xname, sizeof sc->sc_if.if_xname, "%s%d",
ifc->ifc_name, unit);
sc->sc_if.if_softc = sc;
sc->sc_if.if_type = IFT_TUNNEL;
- sc->sc_if.if_addrlen = 0;
sc->sc_if.if_hdrlen = 24; /* IP + GRE */
sc->sc_if.if_mtu = GREMTU;
sc->sc_if.if_flags = IFF_POINTOPOINT|IFF_MULTICAST;
sc->sc_if.if_output = gre_output;
sc->sc_if.if_ioctl = gre_ioctl;
sc->sc_if.if_rtrequest = p2p_rtrequest;
- sc->sc_if.if_collisions = 0;
- sc->sc_if.if_ierrors = 0;
- sc->sc_if.if_oerrors = 0;
- sc->sc_if.if_ipackets = 0;
- sc->sc_if.if_opackets = 0;
sc->g_dst.s_addr = sc->g_src.s_addr = INADDR_ANY;
sc->sc_ka_state = GRE_STATE_UKNWN;
-/* $OpenBSD: if_loop.c,v 1.84 2017/12/15 01:37:30 dlg Exp $ */
+/* $OpenBSD: if_loop.c,v 1.85 2018/01/09 15:24:24 bluhm Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
{
struct ifnet *ifp;
- ifp = malloc(sizeof(*ifp), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (ifp == NULL)
- return (ENOMEM);
-
+ ifp = malloc(sizeof(*ifp), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(ifp->if_xname, sizeof ifp->if_xname, "lo%d", unit);
ifp->if_softc = NULL;
ifp->if_mtu = LOMTU;
ifp->if_output = looutput;
ifp->if_type = IFT_LOOP;
ifp->if_hdrlen = sizeof(u_int32_t);
- ifp->if_addrlen = 0;
if (unit == 0) {
if_attachhead(ifp);
if_addgroup(ifp, ifc->ifc_name);
-/* $OpenBSD: if_mpe.c,v 1.63 2017/11/29 19:36:03 claudio Exp $ */
+/* $OpenBSD: if_mpe.c,v 1.64 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@spootnik.org>
struct ifnet *ifp;
struct mpe_softc *mpeif;
- if ((mpeif = malloc(sizeof(*mpeif),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ mpeif = malloc(sizeof(*mpeif), M_DEVBUF, M_WAITOK|M_ZERO);
mpeif->sc_unit = unit;
ifp = &mpeif->sc_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "mpe%d", unit);
-/* $OpenBSD: if_mpw.c,v 1.22 2017/05/15 14:03:53 mpi Exp $ */
+/* $OpenBSD: if_mpw.c,v 1.23 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2015 Rafael Zalamena <rzalamena@openbsd.org>
struct mpw_softc *sc;
struct ifnet *ifp;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT | M_ZERO);
- if (sc == NULL)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = &sc->sc_if;
snprintf(ifp->if_xname, sizeof(ifp->if_xname), "mpw%d", unit);
ifp->if_softc = sc;
-/* $OpenBSD: if_pair.c,v 1.10 2017/01/23 11:37:29 mpi Exp $ */
+/* $OpenBSD: if_pair.c,v 1.11 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org>
struct ifnet *ifp;
struct pair_softc *sc;
- if ((sc = malloc(sizeof(*sc),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = &sc->sc_ac.ac_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "pair%d", unit);
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-/* $OpenBSD: if_pflog.c,v 1.80 2017/08/11 21:24:19 mpi Exp $ */
+/* $OpenBSD: if_pflog.c,v 1.81 2018/01/09 15:24:24 bluhm Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
struct ifnet *ifp;
struct pflog_softc *pflogif;
- if ((pflogif = malloc(sizeof(*pflogif),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ pflogif = malloc(sizeof(*pflogif), M_DEVBUF, M_WAITOK|M_ZERO);
pflogif->sc_unit = unit;
ifp = &pflogif->sc_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "pflog%d", unit);
-/* $OpenBSD: if_pflow.c,v 1.85 2017/10/31 22:05:12 sashan Exp $ */
+/* $OpenBSD: if_pflow.c,v 1.86 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2011 Florian Obser <florian@narrans.de>
struct ifnet *ifp;
struct pflow_softc *pflowif;
- if ((pflowif = malloc(sizeof(*pflowif),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ pflowif = malloc(sizeof(*pflowif), M_DEVBUF, M_WAITOK|M_ZERO);
MGET(pflowif->send_nam, M_WAIT, MT_SONAME);
-
pflowif->sc_version = PFLOW_PROTO_DEFAULT;
/* ipfix template init */
-/* $OpenBSD: if_pfsync.c,v 1.255 2017/11/20 10:35:24 mpi Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.256 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
pfsync_sync_ok = 1;
- sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_WAITOK | M_ZERO);
-
+ sc = malloc(sizeof(*pfsyncif), M_DEVBUF, M_WAITOK|M_ZERO);
for (q = 0; q < PFSYNC_S_COUNT; q++)
TAILQ_INIT(&sc->sc_qs[q]);
-/* $OpenBSD: if_ppp.c,v 1.109 2017/08/11 21:24:19 mpi Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.110 2018/01/09 15:24:24 bluhm Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
{
struct ppp_softc *sc;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (!sc)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
sc->sc_unit = unit;
snprintf(sc->sc_if.if_xname, sizeof sc->sc_if.if_xname, "%s%d",
ifc->ifc_name, unit);
-/* $OpenBSD: if_pppoe.c,v 1.65 2017/09/08 05:36:53 deraadt Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.66 2018/01/09 15:24:24 bluhm Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
struct pppoe_softc *sc, *tmpsc;
u_int32_t unique;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_CANFAIL|M_ZERO);
- if (sc == NULL)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
snprintf(sc->sc_sppp.pp_if.if_xname,
sizeof(sc->sc_sppp.pp_if.if_xname),
"pppoe%d", unit);
-/* $OpenBSD: if_switch.c,v 1.21 2017/11/20 10:17:40 mpi Exp $ */
+/* $OpenBSD: if_switch.c,v 1.22 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2016 Kazuya GODA <goda@openbsd.org>
sc = malloc(sizeof(struct switch_softc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = &sc->sc_if;
-
snprintf(ifp->if_xname, sizeof ifp->if_xname, "switch%d", unit);
ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU;
ifp->if_output = NULL;
ifp->if_start = NULL;
ifp->if_type = IFT_BRIDGE;
- ifp->if_addrlen = 0;
ifp->if_hdrlen = ETHER_HDR_LEN;
TAILQ_INIT(&sc->sc_swpo_list);
-/* $OpenBSD: if_trunk.c,v 1.134 2017/08/14 08:31:00 reyk Exp $ */
+/* $OpenBSD: if_trunk.c,v 1.135 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2005, 2006, 2007 Reyk Floeter <reyk@openbsd.org>
struct ifnet *ifp;
int i, error = 0;
- if ((tr = malloc(sizeof *tr, M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ tr = malloc(sizeof(*tr), M_DEVBUF, M_WAITOK|M_ZERO);
tr->tr_unit = unit;
tr->tr_proto = TRUNK_PROTO_NONE;
for (i = 0; trunk_protos[i].ti_proto != TRUNK_PROTO_NONE; i++) {
-/* $OpenBSD: if_tun.c,v 1.179 2017/12/30 23:08:29 guenther Exp $ */
+/* $OpenBSD: if_tun.c,v 1.180 2018/01/09 15:24:24 bluhm Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
struct tun_softc *tp;
struct ifnet *ifp;
- tp = malloc(sizeof(*tp), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (tp == NULL)
- return (ENOMEM);
-
+ tp = malloc(sizeof(*tp), M_DEVBUF, M_WAITOK|M_ZERO);
tp->tun_unit = unit;
tp->tun_flags = TUN_INITED|TUN_STAYUP;
-/* $OpenBSD: if_vether.c,v 1.29 2017/01/22 10:17:39 dlg Exp $ */
+/* $OpenBSD: if_vether.c,v 1.30 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2009 Theo de Raadt
struct ifnet *ifp;
struct vether_softc *sc;
- if ((sc = malloc(sizeof(*sc),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
ifp = &sc->sc_ac.ac_if;
snprintf(ifp->if_xname, sizeof ifp->if_xname, "vether%d", unit);
ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST;
-/* $OpenBSD: if_vlan.c,v 1.174 2017/06/22 11:34:51 tom Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.175 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
struct ifvlan *ifv;
struct ifnet *ifp;
- ifv = malloc(sizeof(*ifv), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (ifv == NULL)
- return (ENOMEM);
-
+ ifv = malloc(sizeof(*ifv), M_DEVBUF, M_WAITOK|M_ZERO);
LIST_INIT(&ifv->vlan_mc_listhead);
ifp = &ifv->ifv_if;
ifp->if_softc = ifv;
-/* $OpenBSD: if_vxlan.c,v 1.64 2017/11/20 10:35:24 mpi Exp $ */
+/* $OpenBSD: if_vxlan.c,v 1.65 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2013 Reyk Floeter <reyk@openbsd.org>
struct ifnet *ifp;
struct vxlan_softc *sc;
- if ((sc = malloc(sizeof(*sc),
- M_DEVBUF, M_NOWAIT|M_ZERO)) == NULL)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
sc->sc_imo.imo_membership = malloc(
(sizeof(struct in_multi *) * IP_MIN_MEMBERSHIPS), M_IPMOPTS,
M_WAITOK|M_ZERO);
-/* $OpenBSD: ip_carp.c,v 1.320 2017/11/23 13:32:25 mpi Exp $ */
+/* $OpenBSD: ip_carp.c,v 1.321 2018/01/09 15:24:24 bluhm Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff. All rights reserved.
struct carp_softc *sc;
struct ifnet *ifp;
- sc = malloc(sizeof(*sc), M_DEVBUF, M_NOWAIT|M_ZERO);
- if (!sc)
- return (ENOMEM);
-
+ sc = malloc(sizeof(*sc), M_DEVBUF, M_WAITOK|M_ZERO);
refcnt_init(&sc->sc_refcnt);
SRPL_INIT(&sc->carp_vhosts);