]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
afs: log ICMP errors for downed servers
authorAndrew Deason <adeason@sinenomine.net>
Tue, 13 Nov 2012 20:58:11 +0000 (14:58 -0600)
committerDerrick Brashear <shadow@your-file-system.com>
Tue, 4 Dec 2012 11:18:44 +0000 (03:18 -0800)
When we notice a server is unreachable, log the ICMP error we got for
that server, if any.

Change-Id: I9dcd40bf45fefa6679eac92a5d03d44eceac0816
Reviewed-on: http://gerrit.openafs.org/8410
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
src/afs/afs_util.c

index 9105beb09584e3bf50936a0055f93aa4e71eed04..bd406163a00131dabbd67c863b13de1ea1d87b73 100644 (file)
@@ -221,6 +221,33 @@ print_internet_address(char *preamble, struct srvAddr *sa, char *postamble,
                 (address >> 16) & 0xff, (address >> 8) & 0xff,
                 (address) & 0xff, aserver->cell->cellName, postamble, code, ptr);
 
+    if (flag == 1 && rxconn) {
+       /* server was marked down, check Rx to see if this was possibly due to
+        * an ICMP error received from the network */
+       int errorigin, errtype, errcode;
+       const char *errmsg;
+       if (rx_GetNetworkError(rxconn, &errorigin, &errtype, &errcode, &errmsg) == 0) {
+           const char *str1 = " (";
+           const char *str2 = ")";
+           if (!errmsg) {
+               errmsg = str1 = str2 = "";
+           }
+           afs_warn("afs: network error for %d.%d.%d.%d:%d: origin %d type %d code %d%s%s%s\n",
+                    (address >> 24),
+                    (address >> 16) & 0xff,
+                    (address >> 8) & 0xff,
+                    (address) & 0xff,
+                    (int)ntohs(sa->sa_portal),
+                    errorigin, errtype, errcode, str1, errmsg, str2);
+           afs_warnuser("afs: network error for %d.%d.%d.%d:%d: origin %d type %d code %d%s%s%s\n",
+                    (address >> 24),
+                    (address >> 16) & 0xff,
+                    (address >> 8) & 0xff,
+                    (address) & 0xff,
+                    (int)ntohs(sa->sa_portal),
+                    errorigin, errtype, errcode, str1, errmsg, str2);
+       }
+    }
 }                              /*print_internet_address */