summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_bridge.c4
-rw-r--r--sys/net/if_enc.c4
-rw-r--r--sys/net/if_faith.c4
-rw-r--r--sys/net/if_gif.c5
-rw-r--r--sys/net/if_loop.c4
-rw-r--r--sys/net/if_pflog.c4
-rw-r--r--sys/net/if_pfsync.c4
-rw-r--r--sys/net/if_ppp.c4
-rw-r--r--sys/net/if_sl.c5
-rw-r--r--sys/net/if_strip.c5
-rw-r--r--sys/net/if_tun.c4
-rw-r--r--sys/net/if_vlan.c4
12 files changed, 27 insertions, 24 deletions
diff --git a/sys/net/if_bridge.c b/sys/net/if_bridge.c
index 20def188a2c..b6a2aa0382a 100644
--- a/sys/net/if_bridge.c
+++ b/sys/net/if_bridge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_bridge.c,v 1.114 2003/03/31 22:59:47 millert Exp $ */
+/* $OpenBSD: if_bridge.c,v 1.115 2003/05/03 21:15:11 deraadt Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -206,7 +206,7 @@ bridgeattach(n)
LIST_INIT(&sc->sc_iflist);
LIST_INIT(&sc->sc_spanlist);
ifp = &sc->sc_if;
- sprintf(ifp->if_xname, "bridge%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "bridge%d", i);
ifp->if_softc = sc;
ifp->if_mtu = ETHERMTU;
ifp->if_ioctl = bridge_ioctl;
diff --git a/sys/net/if_enc.c b/sys/net/if_enc.c
index 8411f35eff5..4a7cc72a5c8 100644
--- a/sys/net/if_enc.c
+++ b/sys/net/if_enc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_enc.c,v 1.39 2002/06/30 13:04:36 itojun Exp $ */
+/* $OpenBSD: if_enc.c,v 1.40 2003/05/03 21:15:11 deraadt Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -101,7 +101,7 @@ encattach(int nenc)
for (i = 0; i < NENC; i++)
{
ifp = &encif[i].sc_if;
- sprintf(ifp->if_xname, "enc%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "enc%d", i);
ifp->if_softc = &encif[i];
ifp->if_mtu = ENCMTU;
ifp->if_ioctl = encioctl;
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 45d6d7a5192..32ab43db223 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_faith.c,v 1.13 2003/05/03 01:43:07 itojun Exp $ */
+/* $OpenBSD: if_faith.c,v 1.14 2003/05/03 21:15:11 deraadt Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -92,7 +92,7 @@ faithattach(faith)
for (i = 0; i < NFAITH; i++) {
ifp = &faithif[i];
bzero(ifp, sizeof(faithif[i]));
- sprintf(ifp->if_xname, "faith%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "faith%d", i);
ifp->if_mtu = FAITHMTU;
/* Change to BROADCAST experimentaly to announce its prefix. */
ifp->if_flags = /* IFF_LOOPBACK */ IFF_BROADCAST | IFF_MULTICAST;
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index d7bc71ed518..d790dcb256d 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.27 2003/05/03 01:43:07 itojun Exp $ */
+/* $OpenBSD: if_gif.c,v 1.28 2003/05/03 21:15:11 deraadt Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -83,7 +83,8 @@ gifattach(n)
M_DEVBUF, M_WAIT);
bzero(sc, ngif * sizeof(struct gif_softc));
for (i = 0; i < ngif; sc++, i++) {
- sprintf(sc->gif_if.if_xname, "gif%d", i);
+ snprintf(sc->gif_if.if_xname, sizeof sc->gif_if.if_xname,
+ "gif%d", i);
sc->gif_if.if_mtu = GIF_MTU;
sc->gif_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
sc->gif_if.if_ioctl = gif_ioctl;
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index 76a971badb6..6247c21ca84 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_loop.c,v 1.27 2003/05/03 01:43:07 itojun Exp $ */
+/* $OpenBSD: if_loop.c,v 1.28 2003/05/03 21:15:11 deraadt Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
@@ -191,7 +191,7 @@ loopattach(n)
bzero(ifp, sizeof(struct ifnet));
if (i == 0)
lo0ifp = ifp;
- sprintf(ifp->if_xname, "lo%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "lo%d", i);
ifp->if_softc = NULL;
ifp->if_mtu = LOMTU;
ifp->if_flags = IFF_LOOPBACK | IFF_MULTICAST;
diff --git a/sys/net/if_pflog.c b/sys/net/if_pflog.c
index 7c1648ce6e5..3c93560d329 100644
--- a/sys/net/if_pflog.c
+++ b/sys/net/if_pflog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pflog.c,v 1.7 2002/10/29 19:51:04 mickey Exp $ */
+/* $OpenBSD: if_pflog.c,v 1.8 2003/05/03 21:15:11 deraadt Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -93,7 +93,7 @@ pflogattach(int npflog)
for (i = 0; i < NPFLOG; i++) {
ifp = &pflogif[i].sc_if;
- sprintf(ifp->if_xname, "pflog%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "pflog%d", i);
ifp->if_softc = &pflogif[i];
ifp->if_mtu = PFLOGMTU;
ifp->if_ioctl = pflogioctl;
diff --git a/sys/net/if_pfsync.c b/sys/net/if_pfsync.c
index a14bd82f3b3..89a4f223ad9 100644
--- a/sys/net/if_pfsync.c
+++ b/sys/net/if_pfsync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pfsync.c,v 1.4 2002/12/23 18:53:59 mickey Exp $ */
+/* $OpenBSD: if_pfsync.c,v 1.5 2003/05/03 21:15:11 deraadt Exp $ */
/*
* Copyright (c) 2002 Michael Shalayeff
@@ -91,7 +91,7 @@ pfsyncattach(int npfsync)
pfsyncif.sc_ptr = NULL;
pfsyncif.sc_count = 8;
ifp = &pfsyncif.sc_if;
- strcpy(ifp->if_xname, "pfsync0");
+ strlcpy(ifp->if_xname, "pfsync0", sizeof ifp->if_xname);
ifp->if_softc = &pfsyncif;
ifp->if_ioctl = pfsyncioctl;
ifp->if_output = pfsyncoutput;
diff --git a/sys/net/if_ppp.c b/sys/net/if_ppp.c
index 738535168dd..563a94bcd3a 100644
--- a/sys/net/if_ppp.c
+++ b/sys/net/if_ppp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ppp.c,v 1.33 2003/02/12 14:41:07 jason Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.34 2003/05/03 21:15:11 deraadt Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
@@ -229,7 +229,7 @@ pppattach()
for (sc = ppp_softc; i < NPPP; sc++) {
sc->sc_unit = i; /* XXX */
- sprintf(sc->sc_if.if_xname, "ppp%d", i++);
+ snprintf(sc->sc_if.if_xname, sizeof sc->sc_if.if_xname, "ppp%d", i++);
sc->sc_if.if_softc = sc;
sc->sc_if.if_mtu = PPP_MTU;
sc->sc_if.if_flags = IFF_POINTOPOINT | IFF_MULTICAST;
diff --git a/sys/net/if_sl.c b/sys/net/if_sl.c
index d9b16826e61..a43d99e47e4 100644
--- a/sys/net/if_sl.c
+++ b/sys/net/if_sl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_sl.c,v 1.18 2003/01/07 09:00:33 kjc Exp $ */
+/* $OpenBSD: if_sl.c,v 1.19 2003/05/03 21:15:11 deraadt Exp $ */
/* $NetBSD: if_sl.c,v 1.39.4.1 1996/06/02 16:26:31 thorpej Exp $ */
/*
@@ -206,7 +206,8 @@ slattach(n)
bzero(sl_softc, n * sizeof(struct sl_softc));
for (sc = sl_softc; i < nsl; sc++) {
sc->sc_unit = i; /* XXX */
- sprintf(sc->sc_if.if_xname, "sl%d", i++);
+ snprintf(sc->sc_if.if_xname, sizeof sc->sc_if.if_xname,
+ "sl%d", i++);
sc->sc_if.if_softc = sc;
sc->sc_if.if_mtu = SLMTU;
sc->sc_if.if_flags =
diff --git a/sys/net/if_strip.c b/sys/net/if_strip.c
index f9b31036eba..1db330d1caa 100644
--- a/sys/net/if_strip.c
+++ b/sys/net/if_strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_strip.c,v 1.23 2003/01/07 09:00:33 kjc Exp $ */
+/* $OpenBSD: if_strip.c,v 1.24 2003/05/03 21:15:11 deraadt Exp $ */
/* $NetBSD: if_strip.c,v 1.2.4.3 1996/08/03 00:58:32 jtc Exp $ */
/* from: NetBSD: if_sl.c,v 1.38 1996/02/13 22:00:23 christos Exp $ */
@@ -351,7 +351,8 @@ stripattach(n)
for (sc = st_softc; i < NSTRIP; sc++) {
timeout_set(&sc->sc_timo, strip_timeout, sc);
sc->sc_unit = i; /* XXX */
- sprintf(sc->sc_if.if_xname, "strip%d", i++);
+ snprintf(sc->sc_if.if_xname, sizeof sc->sc_if.if_xname,
+ "strip%d", i++);
sc->sc_if.if_softc = sc;
sc->sc_if.if_mtu = SLMTU;
sc->sc_if.if_flags = 0;
diff --git a/sys/net/if_tun.c b/sys/net/if_tun.c
index 62046c91162..a0cfcc85016 100644
--- a/sys/net/if_tun.c
+++ b/sys/net/if_tun.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_tun.c,v 1.46 2003/04/18 05:26:13 jason Exp $ */
+/* $OpenBSD: if_tun.c,v 1.47 2003/05/03 21:15:11 deraadt Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
@@ -151,7 +151,7 @@ tunattach(n)
tunctl[i].tun_flags = TUN_INITED;
ifp = &tunctl[i].tun_if;
- sprintf(ifp->if_xname, "tun%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "tun%d", i);
ifp->if_softc = &tunctl[i];
ifp->if_mtu = TUNMTU;
ifp->if_ioctl = tun_ioctl;
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 22ee8975afe..5fcec917897 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.36 2003/05/03 01:43:07 itojun Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.37 2003/05/03 21:15:11 deraadt Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
*
@@ -113,7 +113,7 @@ vlanattach(int count)
LIST_INIT(&ifv_softc[i].vlan_mc_listhead);
ifp = &ifv_softc[i].ifv_if;
ifp->if_softc = &ifv_softc[i];
- sprintf(ifp->if_xname, "vlan%d", i);
+ snprintf(ifp->if_xname, sizeof ifp->if_xname, "vlan%d", i);
/* NB: flags are not set here */
/* NB: mtu is not set here */