diff --git a/core/net/rime/chameleon-bitopt.c b/core/net/rime/chameleon-bitopt.c index 37b5028c6..5cf3657f3 100644 --- a/core/net/rime/chameleon-bitopt.c +++ b/core/net/rime/chameleon-bitopt.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: chameleon-bitopt.c,v 1.3 2008/04/01 13:10:22 nifi Exp $ + * $Id: chameleon-bitopt.c,v 1.4 2008/04/01 13:22:59 nifi Exp $ */ /** @@ -269,7 +269,7 @@ pack_header(struct channel *c) rimebuf_hdralloc(sizeof(struct bitopt_hdr)); hdr = (struct bitopt_hdr *)rimebuf_hdrptr(); hdr->channel[0] = c->channelno & 0xff; - hdr->channel[1] = (c->channelno & 0xff) << 8; + hdr->channel[1] = (c->channelno >> 8) & 0xff; return 1; /* Send out packet */ } @@ -289,7 +289,7 @@ unpack_header(void) for. */ hdr = (struct bitopt_hdr *)rimebuf_dataptr(); rimebuf_hdrreduce(sizeof(struct bitopt_hdr)); - c = channel_lookup((hdr->channel[1] << 8) + (hdr->channel[0])); + c = channel_lookup((hdr->channel[1] << 8) + hdr->channel[0]); if(c == NULL) { PRINTF("chameleon-bitopt: input: channel %d not found\n", hdr->channel); return NULL;