Revision c11007bc proto/ospf/lsalib.c

View differences:

proto/ospf/lsalib.c
337 337
  u8 *sp, *ep, *p, *q, *b;
338 338
  int c0 = 0, c1 = 0;
339 339
  int x, y;
340
  u16 length,chsum;
340
  u16 length;
341 341

  
342
  b=body;
342
  b = body;
343 343
  sp = (char *) &h->options;
344
  length=ntohs(h->length)-2;
344
  length = ntohs(h->length)-2;
345 345
  h->checksum = 0;
346 346

  
347 347
  for (ep = sp + length; sp < ep; sp = q)
......
376 376
  y = 510 - c0 - x;
377 377
  if (y > 255) y -= 255;
378 378

  
379
  chsum= x + (y << 8);
380
  h->checksum = chsum;
381
  return chsum;
379
  ((u8*)&h->checksum)[0] = x;
380
  ((u8*)&h->checksum)[1] = y;
381
  return h->checksum;
382 382
}
383 383

  
384 384
int

Also available in: Unified diff