Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Feb 2023 14:45:20 GMT
From:      Justin Hibbits <jhibbits@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: c50f70b5a93e - main - linsysfs: Use IfAPI accessors
Message-ID:  <202302031445.313EjKdU027899@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302031445.313EjKdU027899>