summaryrefslogtreecommitdiffstats
path: root/sys/dev/wtap
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2012-02-10 12:35:57 +0000
committered <ed@FreeBSD.org>2012-02-10 12:35:57 +0000
commit28b4a002d6c95bc9e26ea30871aa91c1cc4b3563 (patch)
tree38fefd1e5bde255db2d3eab529d481ce373dec71 /sys/dev/wtap
parent7bf1094d6b76324d8ab7decb5dc0d06999a72842 (diff)
downloadFreeBSD-src-28b4a002d6c95bc9e26ea30871aa91c1cc4b3563.zip
FreeBSD-src-28b4a002d6c95bc9e26ea30871aa91c1cc4b3563.tar.gz
Remove direct access to si_name.
Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks
Diffstat (limited to 'sys/dev/wtap')
-rw-r--r--sys/dev/wtap/if_wtap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/wtap/if_wtap.c b/sys/dev/wtap/if_wtap.c
index c257517..4169368 100644
--- a/sys/dev/wtap/if_wtap.c
+++ b/sys/dev/wtap/if_wtap.c
@@ -84,7 +84,7 @@ wtap_node_write(struct cdev *dev, struct uio *uio, int ioflag)
uint8_t buf[1024];
int buf_len;
- uprintf("write device %s \"echo.\"\n", dev->si_name);
+ uprintf("write device %s \"echo.\"\n", devtoname(dev));
buf_len = MIN(uio->uio_iov->iov_len, 1024);
err = copyin(uio->uio_iov->iov_base, buf, buf_len);
@@ -101,7 +101,7 @@ wtap_node_write(struct cdev *dev, struct uio *uio, int ioflag)
TAILQ_FOREACH(ifp, &V_ifnet, if_link) {
printf("ifp->if_xname = %s\n", ifp->if_xname);
- if(strcmp(dev->si_name, ifp->if_xname) == 0){
+ if(strcmp(devtoname(dev), ifp->if_xname) == 0){
printf("found match, correspoding wtap = %s\n",
ifp->if_xname);
sc = (struct wtap_softc *)ifp->if_softc;
OpenPOWER on IntegriCloud