Date: Mon, 29 Apr 2019 13:52:32 +0000 From: Rick Macklem <rmacklem@uoguelph.ca> To: Andre Albsmeier <Andre.Albsmeier@siemens.com>, Rick Macklem <rmacklem@FreeBSD.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-stable@freebsd.org" <svn-src-stable@freebsd.org>, "svn-src-stable-11@freebsd.org" <svn-src-stable-11@freebsd.org> Subject: Re: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate Message-ID: <YQBPR0101MB2260A944F05DDDEABAF716C9DD390@YQBPR0101MB2260.CANPRD01.PROD.OUTLOOK.COM> In-Reply-To: <20190429072208.GA73248@bali> References: <201904270213.x3R2DF8A098274@repo.freebsd.org>, <20190429072208.GA73248@bali>
next in thread | previous in thread | raw e-mail | index | archive | help
Yes. Someone pointed out that was needed for some builds to avoid an "unused variable" warning. (I don't get the warning when I do a build.) The change was committed to head as r346856 yesterday with a 1 week MFC. rick ________________________________________ From: Andre Albsmeier <Andre.Albsmeier@siemens.com> Sent: Monday, April 29, 2019 3:22:08 AM To: Rick Macklem Cc: src-committers@freebsd.org; svn-src-all@freebsd.org; svn-src-stable@fre= ebsd.org; svn-src-stable-11@freebsd.org Subject: Re: svn commit: r346775 - stable/11/usr.sbin/nfsdumpstate 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@. 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 > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- 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=3D nfsdumpstate > MAN=3D nfsdumpstate.8 > + > +.if ${MK_INET_SUPPORT} !=3D "no" > +CFLAGS+=3D -DINET > +.endif > +.if ${MK_INET6_SUPPORT} !=3D "no" > +CFLAGS+=3D -DINET6 > +.endif > > .include <bsd.prog.mk> > > Modified: stable/11/usr.sbin/nfsdumpstate/nfsdumpstate.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D > --- 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 =3D DUMPSIZE; > dumplist.ndl_list =3D (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 =3D=3D 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_a= ddr, > + nbuf, sizeof(nbuf)) !=3D NULL) > + printf("%-45s ", nbuf); > + else > + printf("%-45s ", " "); > + break; > +#endif > + } > for (i =3D 0; i < dp[cnt].ndcl_clid.nclid_idlen; i++) > printf("%02x", dp[cnt].ndcl_clid.nclid_id[i]); > printf("\n"); > _______________________________________________ > svn-src-stable-11@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@freebsd.o= rg" -- Linux is only free if your time is worthless.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQBPR0101MB2260A944F05DDDEABAF716C9DD390>