diff options
author | pst <pst@FreeBSD.org> | 1996-09-11 06:18:26 +0000 |
---|---|---|
committer | pst <pst@FreeBSD.org> | 1996-09-11 06:18:26 +0000 |
commit | 457abb0654769e5447910628ea81baaec32a9ce5 (patch) | |
tree | 5e7df6d967f469bb69335c848b2983e444a9b081 | |
parent | 9fff8b7ea3f4eedb71ebd24e466da7e936bed064 (diff) | |
download | FreeBSD-src-457abb0654769e5447910628ea81baaec32a9ce5.zip FreeBSD-src-457abb0654769e5447910628ea81baaec32a9ce5.tar.gz |
Print appletalk layer 3 addresses as 16 bit unsigned decimal numbers,
not two 8 bit values. This conforms to industry standard.
These changes have been sent back to LBL.
-rw-r--r-- | contrib/tcpdump/print-atalk.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/contrib/tcpdump/print-atalk.c b/contrib/tcpdump/print-atalk.c index 7b1696c..aa64faf 100644 --- a/contrib/tcpdump/print-atalk.c +++ b/contrib/tcpdump/print-atalk.c @@ -504,26 +504,24 @@ ataddr_string(u_short atnet, u_char athost) if (first && (first = 0, !nflag) && (fp = fopen("/etc/atalk.names", "r"))) { char line[256]; - int i1, i2, i3; + int i1, i2; while (fgets(line, sizeof(line), fp)) { if (line[0] == '\n' || line[0] == 0 || line[0] == '#') continue; - if (sscanf(line, "%d.%d.%d %s", &i1, &i2, &i3, - nambuf) == 4) + if (sscanf(line, "%d.%d %s", &i1, &i2, nambuf) == 3) /* got a hostname. */ - i3 |= ((i1 << 8) | i2) << 8; - else if (sscanf(line, "%d.%d %s", &i1, &i2, - nambuf) == 3) + i2 |= (i1 << 8); + else if (sscanf(line, "%d %s", &i1, nambuf) == 2) /* got a net name */ - i3 = (((i1 << 8) | i2) << 8) | 255; + i2 = (i1 << 8) | 255; else continue; - for (tp = &hnametable[i3 & (HASHNAMESIZE-1)]; + for (tp = &hnametable[i2 & (HASHNAMESIZE-1)]; tp->nxt; tp = tp->nxt) ; - tp->addr = i3; + tp->addr = i2; tp->nxt = newhnamemem(); tp->name = savestr(nambuf); } @@ -548,10 +546,9 @@ ataddr_string(u_short atnet, u_char athost) tp->addr = (atnet << 8) | athost; tp->nxt = newhnamemem(); if (athost != 255) - (void)sprintf(nambuf, "%d.%d.%d", - atnet >> 8, atnet & 0xff, athost); + (void)sprintf(nambuf, "%d.%d", atnet, athost); else - (void)sprintf(nambuf, "%d.%d", atnet >> 8, atnet & 0xff); + (void)sprintf(nambuf, "%d", atnet); tp->name = savestr(nambuf); return (tp->name); |