Commit 23bc8886 authored by Phil Blundell's avatar Phil Blundell

couple of small fixes

parent cd15645f
1998-04-15 Phil Blundell <philb@gnu.org>
* lib/ash.c (pr_ash): Fix typo.
(in_ash): Hamming-encode the hops.
Fri Apr 10 22:26:48 1998 Philip Blundell <Philip.Blundell@pobox.com> Fri Apr 10 22:26:48 1998 Philip Blundell <Philip.Blundell@pobox.com>
* ifconfig.c (ife_print): Bracket Appletalk stuff in #if * ifconfig.c (ife_print): Bracket Appletalk stuff in #if
......
...@@ -39,7 +39,7 @@ pr_ash(unsigned char *ptr) ...@@ -39,7 +39,7 @@ pr_ash(unsigned char *ptr)
p[0] = '['; p++; p[0] = '['; p++;
while (ptr[i] != 0xc9 && ptr[i] != 0xff && (i < ASH_ALEN)) while (ptr[i] != 0xc9 && ptr[i] != 0xff && (i < ASH_ALEN))
sprintf (p++, "%01", ptr[i++]); sprintf (p++, "%1x", ptr[i++]);
*(p++) = ']'; *(p++) = ']';
*p = 0; *p = 0;
...@@ -57,6 +57,12 @@ pr_sash(struct sockaddr *sap) ...@@ -57,6 +57,12 @@ pr_sash(struct sockaddr *sap)
return pr_ash (sap->sa_data); return pr_ash (sap->sa_data);
} }
static unsigned char hamming[16] =
{
0x15, 0x02, 0x49, 0x5e, 0x64, 0x73, 0x38, 0x2f,
0xd0, 0xc7, 0x8c, 0x9b, 0xa1, 0xb6, 0xfd, 0xea
};
static int static int
in_ash(char *bufp, struct sockaddr *sap) in_ash(char *bufp, struct sockaddr *sap)
...@@ -70,7 +76,7 @@ in_ash(char *bufp, struct sockaddr *sap) ...@@ -70,7 +76,7 @@ in_ash(char *bufp, struct sockaddr *sap)
while (bufp && i < ASH_ALEN) { while (bufp && i < ASH_ALEN) {
char *next; char *next;
int hop = strtol (bufp, &next, 16); int hop = strtol (bufp, &next, 16);
ptr[i++] = hop; ptr[i++] = hamming[hop];
switch (*next) { switch (*next) {
case ':': case ':':
bufp = next + 1; bufp = next + 1;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <strings.h> #include <string.h>
char * char *
strsave(s) strsave(s)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment