diff options
author | wkj <devnull@localhost> | 2004-07-03 17:48:02 +0000 |
---|---|---|
committer | wkj <devnull@localhost> | 2004-07-03 17:48:02 +0000 |
commit | 5241ed2bc2c0a0553c75b628d16d3b588cdee685 (patch) | |
tree | 4cc67cab95483522941582fce328978a985a3517 /src/libip | |
parent | 13afc7e57c2dd8001f23a8875719d57db2a8633c (diff) | |
download | plan9port-5241ed2bc2c0a0553c75b628d16d3b588cdee685.tar.gz plan9port-5241ed2bc2c0a0553c75b628d16d3b588cdee685.tar.bz2 plan9port-5241ed2bc2c0a0553c75b628d16d3b588cdee685.zip |
Placate the Sun monster.
Diffstat (limited to 'src/libip')
-rw-r--r-- | src/libip/eipfmt.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/libip/eipfmt.c b/src/libip/eipfmt.c index 8333225a..b3fc44c7 100644 --- a/src/libip/eipfmt.c +++ b/src/libip/eipfmt.c @@ -7,6 +7,9 @@ enum Isprefix= 16, }; +// XXX: manually initialize once to placate the Sun monster +uchar prefixvals[256]; +#ifdef NOTDEF uchar prefixvals[256] = { [0x00] 0 | Isprefix, @@ -19,6 +22,7 @@ uchar prefixvals[256] = [0xFE] 7 | Isprefix, [0xFF] 8 | Isprefix, }; +#endif int eipfmt(Fmt *f) @@ -31,6 +35,22 @@ eipfmt(Fmt *f) ushort s; int i, j, n, eln, eli; + static int once = 0; // XXX: placate the Sun monster + + if(!once){ + once = 1; + memset(prefixvals, 0, sizeof(prefixvals)); + prefixvals[0x00] = 0 | Isprefix; + prefixvals[0x80] = 1 | Isprefix; + prefixvals[0xC0] = 2 | Isprefix; + prefixvals[0xE0] = 3 | Isprefix; + prefixvals[0xF0] = 4 | Isprefix; + prefixvals[0xF8] = 5 | Isprefix; + prefixvals[0xFC] = 6 | Isprefix; + prefixvals[0xFE] = 7 | Isprefix; + prefixvals[0xFF] = 8 | Isprefix; + } + switch(f->r) { case 'E': /* Ethernet address */ p = va_arg(f->args, uchar*); |