[Linux-decnet-commit] CVS: dnprogs/nml nml.c,1.5,1.6
Brought to you by:
chrissie_c,
ph3-der-loewe
From: Christine C. <chr...@us...> - 2008-09-06 15:02:52
|
Update of /cvsroot/linux-decnet/dnprogs/nml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2426/nml Modified Files: nml.c Log Message: Make router display work in big-endian systems Index: nml.c =================================================================== RCS file: /cvsroot/linux-decnet/dnprogs/nml/nml.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** nml.c 6 Sep 2008 13:53:00 -0000 1.5 --- nml.c 6 Sep 2008 15:02:49 -0000 1.6 *************** *** 134,139 **** } fclose(procfile); ! if (verbose) ! fprintf(stderr, "Router node is %x\n", router); return router; } --- 134,138 ---- } fclose(procfile); ! dnetlog(LOG_DEBUG, "Router node is %x\n", router); return router; } *************** *** 168,171 **** --- 167,175 ---- if (state != NODESTATE_UNKNOWN) { struct nodeent *rn; + struct nodeent scratch_n; + unsigned char scratch_na[2]; + + scratch_na[0] = router_node & 0xFF; + scratch_na[1] = router_node >>8; buf[ptr++] = 0; // Node state *************** *** 179,183 **** if (((n->n_addr[0] | n->n_addr[1]<<8) & 0xFC00) != (router_node & 0xFC00)) { ! rn = getnodebyaddr((char *)&router_node, 2, AF_DECnet); } else { --- 183,192 ---- if (((n->n_addr[0] | n->n_addr[1]<<8) & 0xFC00) != (router_node & 0xFC00)) { ! rn = getnodebyaddr((char *)scratch_na, 2, AF_DECnet); ! if (!rn) { ! rn = &scratch_n; ! scratch_n.n_addr = scratch_na; ! scratch_n.n_name = NULL; ! } } else { *************** *** 194,198 **** buf[ptr++] = 0x40; // ASCII text ! if (rn) { makeupper(rn->n_name); buf[ptr++] = strlen(rn->n_name); --- 203,207 ---- buf[ptr++] = 0x40; // ASCII text ! if (rn && rn->n_name) { makeupper(rn->n_name); buf[ptr++] = strlen(rn->n_name); |