svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate
Andre Albsmeier
Andre.Albsmeier at siemens.com
Mon Apr 29 07:41:36 UTC 2019
On Sat, 27-Apr-2019 at 02:13:15 +0000, Rick Macklem wrote:
> Author: rmacklem
> Date: Sat Apr 27 02:13:15 2019
> New Revision: 346775
> URL: https://svnweb.freebsd.org/changeset/base/346775
>
> Log:
> MFC: r346190
> Fix nfsdumpstate(8) so that it can print out INET6 callback addresses.
>
> The patch adds support for printing of INET6 callback addresses.
> It also adds the #ifdef INET, INET6 as requested by bz at .
We should also put ifdefs around the nbuf def:
#ifdef INET6
char nbuf[INET6_ADDRSTRLEN];
#endif
-Andre
>
> Modified:
> stable/11/usr.sbin/nfsdumpstate/Makefile
> stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c
> Directory Properties:
> stable/11/ (props changed)
>
> Modified: stable/11/usr.sbin/nfsdumpstate/Makefile
> ==============================================================================
> --- stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:05:04 2019 (r346774)
> +++ stable/11/usr.sbin/nfsdumpstate/Makefile Sat Apr 27 02:13:15 2019 (r346775)
> @@ -1,6 +1,15 @@
> # $FreeBSD$
>
> +.include <src.opts.mk>
> +
> PROG= nfsdumpstate
> MAN= nfsdumpstate.8
> +
> +.if ${MK_INET_SUPPORT} != "no"
> +CFLAGS+= -DINET
> +.endif
> +.if ${MK_INET6_SUPPORT} != "no"
> +CFLAGS+= -DINET6
> +.endif
>
> .include <bsd.prog.mk>
>
> Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c
> ==============================================================================
> --- stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:05:04 2019 (r346774)
> +++ stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c Sat Apr 27 02:13:15 2019 (r346775)
> @@ -121,13 +121,14 @@ dump_openstate(void)
> {
> struct nfsd_dumplist dumplist;
> int cnt, i;
> + char nbuf[INET6_ADDRSTRLEN];
>
> dumplist.ndl_size = DUMPSIZE;
> dumplist.ndl_list = (void *)dp;
> if (nfssvc(NFSSVC_DUMPCLIENTS, &dumplist) < 0)
> errx(1, "Can't perform dump clients syscall");
>
> - printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-15s %s\n",
> + printf("%-13s %9.9s %9.9s %9.9s %9.9s %9.9s %9.9s %-45s %s\n",
> "Flags", "OpenOwner", "Open", "LockOwner",
> "Lock", "Deleg", "OldDeleg", "Clientaddr", "ClientID");
> /*
> @@ -143,9 +144,23 @@ dump_openstate(void)
> dp[cnt].ndcl_nlocks,
> dp[cnt].ndcl_ndelegs,
> dp[cnt].ndcl_nolddelegs);
> - if (dp[cnt].ndcl_addrfam == AF_INET)
> - printf("%-15s ",
> + switch (dp[cnt].ndcl_addrfam) {
> +#ifdef INET
> + case AF_INET:
> + printf("%-45s ",
> inet_ntoa(dp[cnt].ndcl_cbaddr.sin_addr));
> + break;
> +#endif
> +#ifdef INET6
> + case AF_INET6:
> + if (inet_ntop(AF_INET6, &dp[cnt].ndcl_cbaddr.sin6_addr,
> + nbuf, sizeof(nbuf)) != NULL)
> + printf("%-45s ", nbuf);
> + else
> + printf("%-45s ", " ");
> + break;
> +#endif
> + }
> for (i = 0; i < dp[cnt].ndcl_clid.nclid_idlen; i++)
> printf("%02x", dp[cnt].ndcl_clid.nclid_id[i]);
> printf("\n");
> _______________________________________________
> svn-src-stable-11 at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/svn-src-stable-11
> To unsubscribe, send any mail to "svn-src-stable-11-unsubscribe at freebsd.org"
--
Linux is only free if your time is worthless.
More information about the svn-src-stable
mailing list