diff options
author | ed <ed@FreeBSD.org> | 2012-02-10 12:35:57 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-02-10 12:35:57 +0000 |
commit | 28b4a002d6c95bc9e26ea30871aa91c1cc4b3563 (patch) | |
tree | 38fefd1e5bde255db2d3eab529d481ce373dec71 /sys/netgraph/ng_device.c | |
parent | 7bf1094d6b76324d8ab7decb5dc0d06999a72842 (diff) | |
download | FreeBSD-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/netgraph/ng_device.c')
-rw-r--r-- | sys/netgraph/ng_device.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/netgraph/ng_device.c b/sys/netgraph/ng_device.c index b8c339c..f6e6087 100644 --- a/sys/netgraph/ng_device.c +++ b/sys/netgraph/ng_device.c @@ -203,6 +203,7 @@ ng_device_rcvmsg(node_p node, item_p item, hook_p lasthook) const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *msg; struct ng_mesg *resp = NULL; + const char *dn; int error = 0; NGI_GET_MSG(item, msg); @@ -217,8 +218,8 @@ ng_device_rcvmsg(node_p node, item_p item, hook_p lasthook) if (resp == NULL) ERROUT(ENOMEM); - strlcpy((char *)resp->data, priv->ngddev->si_name, - strlen(priv->ngddev->si_name) + 1); + dn = devtoname(priv->ngddev); + strlcpy((char *)resp->data, dn, strlen(dn) + 1); break; default: |