#ifndef afs_strcasecmp
int
-afs_strcasecmp(char *s1, char *s2)
+afs_strcasecmp(const char *s1, const char *s2)
{
while (*s1 && *s2) {
char c1, c2;
void
print_internet_address(char *preamble, struct srvAddr *sa, char *postamble,
- int flag)
+ int flag, int code, struct rx_connection *rxconn)
{
struct server *aserver = sa->server;
char *ptr = "\n";
" (multi-homed address; other same-host interfaces may still be down)\n";
}
}
- afs_warn("%s%d.%d.%d.%d in cell %s%s%s", preamble, (address >> 24),
+ afs_warnall("%s%d.%d.%d.%d in cell %s%s (code %d)%s", preamble, (address >> 24),
(address >> 16) & 0xff, (address >> 8) & 0xff, (address) & 0xff,
- aserver->cell->cellName, postamble, ptr);
- afs_warnuser("%s%d.%d.%d.%d in cell %s%s%s", preamble, (address >> 24),
- (address >> 16) & 0xff, (address >> 8) & 0xff,
- (address) & 0xff, aserver->cell->cellName, postamble, ptr);
-
+ 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_warnall("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 */