diff options
author | Ondrej Filip <feela@network.cz> | 2003-08-26 12:41:02 +0200 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2003-08-26 12:41:02 +0200 |
commit | c11007bc423188872d37e277fe4637094a40d90f (patch) | |
tree | f758216e0b277c3e3498e219fc76db14a33be70b /proto/ospf/lsalib.c | |
parent | 1d1a3c1c2a72ef91b785f5ed08ca5ab3f001b14e (diff) | |
download | bird-c11007bc423188872d37e277fe4637094a40d90f.tar bird-c11007bc423188872d37e277fe4637094a40d90f.zip |
Endian-related bug fixes sent by Krzysztof Szuster <kszuster@polbox.com>
Diffstat (limited to 'proto/ospf/lsalib.c')
-rw-r--r-- | proto/ospf/lsalib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/proto/ospf/lsalib.c b/proto/ospf/lsalib.c index e79c015..c12c5bd 100644 --- a/proto/ospf/lsalib.c +++ b/proto/ospf/lsalib.c @@ -337,11 +337,11 @@ lsasum_check(struct ospf_lsa_header *h,void *body,struct proto_ospf *po) u8 *sp, *ep, *p, *q, *b; int c0 = 0, c1 = 0; int x, y; - u16 length,chsum; + u16 length; - b=body; + b = body; sp = (char *) &h->options; - length=ntohs(h->length)-2; + length = ntohs(h->length)-2; h->checksum = 0; for (ep = sp + length; sp < ep; sp = q) @@ -376,9 +376,9 @@ lsasum_check(struct ospf_lsa_header *h,void *body,struct proto_ospf *po) y = 510 - c0 - x; if (y > 255) y -= 255; - chsum= x + (y << 8); - h->checksum = chsum; - return chsum; + ((u8*)&h->checksum)[0] = x; + ((u8*)&h->checksum)[1] = y; + return h->checksum; } int |