git: c50f70b5a93e - main - linsysfs: Use IfAPI accessors
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 03 Feb 2023 14:45:20 UTC
The branch main has been updated by jhibbits: URL: https://cgit.FreeBSD.org/src/commit/?id=c50f70b5a93e228d6b0d4a9f57b1f335a6be3f04 commit c50f70b5a93e228d6b0d4a9f57b1f335a6be3f04 Author: Justin Hibbits <jhibbits@FreeBSD.org> AuthorDate: 2023-02-02 21:43:56 +0000 Commit: Justin Hibbits <jhibbits@FreeBSD.org> CommitDate: 2023-02-03 14:38:03 +0000 linsysfs: Use IfAPI accessors Replace the only two ifnet member accesses with IfAPI accessor calls. Sponsored by: Juniper Networks, Inc. --- sys/compat/linsysfs/linsysfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linsysfs/linsysfs.c b/sys/compat/linsysfs/linsysfs.c index 9ec066ac34c4..f916858a17a7 100644 --- a/sys/compat/linsysfs/linsysfs.c +++ b/sys/compat/linsysfs/linsysfs.c @@ -116,7 +116,7 @@ linsysfs_ifnet_ifindex(PFS_FILL_ARGS) ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); if (ifp == NULL) return (ENOENT); - sbuf_printf(sb, "%u\n", ifp->if_index); + sbuf_printf(sb, "%u\n", if_getindex(ifp)); return (0); } @@ -128,7 +128,7 @@ linsysfs_ifnet_mtu(PFS_FILL_ARGS) ifp = ifname_linux_to_bsd(td, pn->pn_parent->pn_name, NULL); if (ifp == NULL) return (ENOENT); - sbuf_printf(sb, "%u\n", ifp->if_mtu); + sbuf_printf(sb, "%u\n", if_getmtu(ifp)); return (0); }