diff options
author | maxim <maxim@FreeBSD.org> | 2002-07-03 11:00:55 +0000 |
---|---|---|
committer | maxim <maxim@FreeBSD.org> | 2002-07-03 11:00:55 +0000 |
commit | 2c468fd2eed5a23aed7daf8a49bc2f1e3e88d70d (patch) | |
tree | 0407845497453f68237f605cbccae96fd7567ce3 /sys | |
parent | 4f6ffa4183037ce887b9b69664f8eed5e8020022 (diff) | |
download | FreeBSD-src-2c468fd2eed5a23aed7daf8a49bc2f1e3e88d70d.zip FreeBSD-src-2c468fd2eed5a23aed7daf8a49bc2f1e3e88d70d.tar.gz |
o Strict interface names comparison. The old code assumed "fxp1" == "fxp11".
o Use an appropriate constant for interface name buffer.
Reviewed by: luigi
Approved by: luigi
MFC after: 1 month
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/bridge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net/bridge.c b/sys/net/bridge.c index 2baeadc..421d9cf 100644 --- a/sys/net/bridge.c +++ b/sys/net/bridge.c @@ -436,10 +436,10 @@ parse_bdg_cfg() * now search in interface list for a matching name */ TAILQ_FOREACH(ifp, &ifnet, if_link) { - char buf[32]; + char buf[IFNAMSIZ]; - sprintf(buf, "%s%d", ifp->if_name, ifp->if_unit); - if (!strncmp(beg, buf, l)) { + snprintf(buf, sizeof(buf), "%s%d", ifp->if_name, ifp->if_unit); + if (!strncmp(beg, buf, max(l, strlen(buf)))) { struct bdg_softc *b = &ifp2sc[ifp->if_index]; if (ifp->if_type != IFT_ETHER && ifp->if_type != IFT_L2VLAN) { printf("%s is not an ethernet, continue\n", buf); |