Revision e81b440f proto/ospf/lsalib.c

View differences:

proto/ospf/lsalib.c
122 122
}
123 123

  
124 124
void
125
htonlsab(void *h, void *n, u16 type, u16 len)
125
htonlsab(void *h, void *n, u16 len)
126 126
{
127 127
  u32 *hid = h;
128 128
  u32 *nid = n;
129
  int i;
129
  unsigned i;
130 130

  
131 131
  for (i = 0; i < (len / sizeof(u32)); i++)
132 132
    nid[i] = htonl(hid[i]);
133 133
}
134 134

  
135 135
void
136
ntohlsab(void *n, void *h, u16 type, u16 len)
136
ntohlsab(void *n, void *h, u16 len)
137 137
{
138 138
  u32 *nid = n;
139 139
  u32 *hid = h;
140
  int i;
140
  unsigned i;
141 141

  
142 142
  for (i = 0; i < (len / sizeof(u32)); i++)
143 143
    hid[i] = ntohl(nid[i]);
......
185 185
lsasum_calculate(struct ospf_lsa_header *h, void *body)
186 186
{
187 187
  u16 length = h->length;
188
  u16 type = h->type;
189 188

  
190 189
  //  log(L_WARN "Checksum %R %R %d start (len %d)", h->id, h->rt, h->type, length);
191 190
  htonlsah(h, h);
192
  htonlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
191
  htonlsab(body, body, length - sizeof(struct ospf_lsa_header));
193 192

  
194 193
  /*
195 194
  char buf[1024];
......
203 202
  //  log(L_WARN "Checksum result %4x", h->checksum);
204 203

  
205 204
  ntohlsah(h, h);
206
  ntohlsab(body, body, type, length - sizeof(struct ospf_lsa_header));
205
  ntohlsab(body, body, length - sizeof(struct ospf_lsa_header));
207 206
}
208 207

  
209 208
/*
......
325 324
}
326 325

  
327 326
static int
328
lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body)
327
lsa_validate_net(struct ospf_lsa_header *lsa, struct ospf_lsa_net *body UNUSED)
329 328
{
330 329
  if (lsa->length < (HDRLEN + sizeof(struct ospf_lsa_net)))
331 330
    return 0;

Also available in: Unified diff