Index: /trunk/docs/Changelog
===================================================================
--- /trunk/docs/Changelog	(revision 249)
+++ /trunk/docs/Changelog	(revision 250)
@@ -2,4 +2,5 @@
 	* remove stale file record when creating handle, and raise diagnostic
 	  error to find origin of stale record
+	* sh_port2proc.c: check /proc/net/upd6 for IPv6-only UDP sockets
 
 2.5.9a:
Index: /trunk/src/sh_port2proc.c
===================================================================
--- /trunk/src/sh_port2proc.c	(revision 249)
+++ /trunk/src/sh_port2proc.c	(revision 250)
@@ -320,13 +320,10 @@
 /* returns the command and fills the 'user' array 
  */
-char * sh_port2proc_query(int proto, struct in_addr * saddr, int sport, unsigned long * pid,
-			  char * user, size_t userlen)
+static char * port2proc_query(char * file, int proto, struct in_addr * saddr, int sport, 
+			      unsigned long * pid, char * user, size_t userlen)
 {
   FILE * fd;
 
-  if (proto == IPPROTO_TCP)
-    fd = fopen("/proc/net/tcp", "r");
-  else
-    fd = fopen("/proc/net/udp", "r");
+  fd = fopen(file, "r");
 
   *pid = 0;
@@ -377,4 +374,31 @@
   sl_strlcpy(user, "-", userlen);
   return sh_util_strdup("-");
+}
+
+/* returns the command and fills the 'user' array 
+ */
+char * sh_port2proc_query(int proto, struct in_addr * saddr, int sport, 
+			  unsigned long * pid, char * user, size_t userlen)
+{
+  char file[32];
+
+  if (proto == IPPROTO_TCP)
+    {
+      sl_strlcpy(file, _("/proc/net/tcp"), sizeof(file));
+      return port2proc_query(file, proto, saddr, sport, pid, user, userlen);
+    }
+  else
+    {
+      char * ret;
+      sl_strlcpy(file, _("/proc/net/udp"), sizeof(file));
+      ret = port2proc_query(file, proto, saddr, sport, pid, user, userlen);
+      if (ret[0] == '-' && ret[1] == '\0')
+	{
+	  SH_FREE(ret);
+	  sl_strlcpy(file, _("/proc/net/udp6"), sizeof(file));
+	  ret = port2proc_query(file, proto, saddr, sport, pid, user, userlen);
+	}
+      return ret;
+    }
 }
 
