bin/128871: commit references a PR

dfilter service dfilter at FreeBSD.ORG
Wed Dec 31 09:00:07 UTC 2008


The following reply was made to PR bin/128871; it has been noted by GNATS.

From: dfilter at FreeBSD.ORG (dfilter service)
To: bug-followup at FreeBSD.org
Cc:  
Subject: Re: bin/128871: commit references a PR
Date: Wed, 31 Dec 2008 08:56:59 +0000 (UTC)

 Author: maxim
 Date: Wed Dec 31 08:56:49 2008
 New Revision: 186644
 URL: http://svn.freebsd.org/changeset/base/186644
 
 Log:
   o With -L flag show unix sockets listen queues stats.  It is useful
   to know number of not accepted connections for monitoring purposes.
   
   PR:		bin/128871
   Submitted by:	Anton Yuzhaninov
   MFC after:	1 month
 
 Modified:
   head/usr.bin/netstat/main.c
   head/usr.bin/netstat/unix.c
 
 Modified: head/usr.bin/netstat/main.c
 ==============================================================================
 --- head/usr.bin/netstat/main.c	Wed Dec 31 08:07:10 2008	(r186643)
 +++ head/usr.bin/netstat/main.c	Wed Dec 31 08:56:49 2008	(r186644)
 @@ -593,7 +593,7 @@ main(int argc, char *argv[])
  		for (tp = netgraphprotox; tp->pr_name; tp++)
  			printproto(tp, tp->pr_name);
  #endif /* NETGRAPH */
 -	if ((af == AF_UNIX || af == AF_UNSPEC) && !Lflag && !sflag)
 +	if ((af == AF_UNIX || af == AF_UNSPEC) && !sflag)
  		unixpr(nl[N_UNP_COUNT].n_value, nl[N_UNP_GENCNT].n_value,
  		    nl[N_UNP_DHEAD].n_value, nl[N_UNP_SHEAD].n_value);
  	exit(0);
 
 Modified: head/usr.bin/netstat/unix.c
 ==============================================================================
 --- head/usr.bin/netstat/unix.c	Wed Dec 31 08:07:10 2008	(r186643)
 +++ head/usr.bin/netstat/unix.c	Wed Dec 31 08:56:49 2008	(r186644)
 @@ -247,6 +247,7 @@ unixdomainpr(struct xunpcb *xunp, struct
  	struct unpcb *unp;
  	struct sockaddr_un *sa;
  	static int first = 1;
 +	char buf1[15];
  
  	unp = &xunp->xu_unp;
  	if (unp->unp_addr)
 @@ -254,7 +255,7 @@ unixdomainpr(struct xunpcb *xunp, struct
  	else
  		sa = (struct sockaddr_un *)0;
  
 -	if (first) {
 +	if (first && !Lflag) {
  		printf("Active UNIX domain sockets\n");
  		printf(
  "%-8.8s %-6.6s %-6.6s %-6.6s %8.8s %8.8s %8.8s %8.8s Addr\n",
 @@ -262,11 +263,21 @@ unixdomainpr(struct xunpcb *xunp, struct
  		    "Inode", "Conn", "Refs", "Nextref");
  		first = 0;
  	}
 -	printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx",
 -	       (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc,
 -	       so->so_snd.sb_cc,
 -	       (long)unp->unp_vnode, (long)unp->unp_conn,
 -	       (long)LIST_FIRST(&unp->unp_refs), (long)LIST_NEXT(unp, unp_reflink));
 +
 +	if (Lflag && so->so_qlimit == 0)
 +		return;
 +
 +	if (Lflag) {
 +		snprintf(buf1, 15, "%d/%d/%d", so->so_qlen,
 +		    so->so_incqlen, so->so_qlimit);
 +		printf("unix  %-14.14s", buf1);
 +	} else {
 +		printf("%8lx %-6.6s %6u %6u %8lx %8lx %8lx %8lx",
 +		    (long)so->so_pcb, socktype[so->so_type], so->so_rcv.sb_cc,
 +		    so->so_snd.sb_cc, (long)unp->unp_vnode, (long)unp->unp_conn,
 +		    (long)LIST_FIRST(&unp->unp_refs),
 +		    (long)LIST_NEXT(unp, unp_reflink));
 +	}
  	if (sa)
  		printf(" %.*s",
  		    (int)(sa->sun_len - offsetof(struct sockaddr_un, sun_path)),
 _______________________________________________
 svn-src-all at freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
 


More information about the freebsd-bugs mailing list