diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-03 18:25:14 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-12-03 18:25:14 +0100 |
commit | 69fbf9a25190e0149dcc31e830e952c586fe2024 (patch) | |
tree | b681ef1f421727f0b69af45a8313f998afdf0493 /proto/ospf/lsupd.c | |
parent | e4a810b0ce3d7904e87a210c44c36eda7cba7a3e (diff) | |
download | bird-69fbf9a25190e0149dcc31e830e952c586fe2024.tar bird-69fbf9a25190e0149dcc31e830e952c586fe2024.zip |
Minor fix in LSA update.
Diffstat (limited to 'proto/ospf/lsupd.c')
-rw-r--r-- | proto/ospf/lsupd.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/proto/ospf/lsupd.c b/proto/ospf/lsupd.c index b1f6f46..75c6702 100644 --- a/proto/ospf/lsupd.c +++ b/proto/ospf/lsupd.c @@ -449,8 +449,9 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa, struct ospf_lsa_header *lsa = (void *) (((u8 *) ps) + offset); unsigned int lsalen = ntohs(lsa->length); - - if (((offset + lsalen) > size) || ((lsalen % 4) != 0) || + offset += lsalen; + + if ((offset > size) || ((lsalen % 4) != 0) || (lsalen <= sizeof(struct ospf_lsa_header))) { log(L_WARN "Received LSA from %I with bad length", n->ip); |