Commit 2eed758a authored by Matthieu Boutier's avatar Matthieu Boutier Committed by Juliusz Chroboczek

Fix unlikely corner-cases (not bugs).

parent 13ad5faf
...@@ -586,14 +586,14 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -586,14 +586,14 @@ parse_packet(const unsigned char *from, struct interface *ifp,
format_address(from), ifp->name); format_address(from), ifp->name);
if(message[2] == 0) { if(message[2] == 0) {
rc = parse_other_subtlv(message + 12, len - 8);
if(rc < 0)
goto done;
if(metric < 0xFFFF) { if(metric < 0xFFFF) {
fprintf(stderr, fprintf(stderr,
"Received wildcard update with finite metric.\n"); "Received wildcard update with finite metric.\n");
goto done; goto done;
} }
rc = parse_other_subtlv(message + 12, len - 8);
if(rc < 0)
goto done;
retract_neighbour_routes(neigh); retract_neighbour_routes(neigh);
goto done; goto done;
} else if(message[2] == 1) { } else if(message[2] == 1) {
...@@ -606,15 +606,16 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -606,15 +606,16 @@ parse_packet(const unsigned char *from, struct interface *ifp,
nh = neigh->address; nh = neigh->address;
} }
rc = parse_update_subtlv(ifp, metric, message + 2 + parsed_len,
len - parsed_len, channels, &channels_len);
if (rc < 0)
goto done;
if(message[2] == 1) { if(message[2] == 1) {
if(!ifp->ipv4) if(!ifp->ipv4)
goto done; goto done;
} }
rc = parse_update_subtlv(ifp, metric, message + 2 + parsed_len,
len - parsed_len, channels, &channels_len);
if (rc < 0)
goto done;
update_route(router_id, prefix, plen, src_prefix, src_plen, seqno, update_route(router_id, prefix, plen, src_prefix, src_plen, seqno,
metric, interval, neigh, nh, metric, interval, neigh, nh,
channels, channels_len); channels, channels_len);
...@@ -730,6 +731,9 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -730,6 +731,9 @@ parse_packet(const unsigned char *from, struct interface *ifp,
if(ae == 0) { if(ae == 0) {
debugf("Received invalid Source-Specific wildcard update.\n"); debugf("Received invalid Source-Specific wildcard update.\n");
rc = parse_other_subtlv(message + 12, len - 8);
if(rc < 0)
goto done;
retract_neighbour_routes(neigh); retract_neighbour_routes(neigh);
goto done; goto done;
} else if(ae == 1) { } else if(ae == 1) {
...@@ -742,15 +746,16 @@ parse_packet(const unsigned char *from, struct interface *ifp, ...@@ -742,15 +746,16 @@ parse_packet(const unsigned char *from, struct interface *ifp,
nh = neigh->address; nh = neigh->address;
} }
rc = parse_update_subtlv(ifp, metric, message + 2 + parsed_len,
len - parsed_len, channels, &channels_len);
if(rc < 0)
goto done;
if(ae == 1) { if(ae == 1) {
if(!ifp->ipv4) if(!ifp->ipv4)
goto done; goto done;
} }
rc = parse_update_subtlv(ifp, metric, message + 2 + parsed_len,
len - parsed_len, channels, &channels_len);
if(rc < 0)
goto done;
update_route(router_id, prefix, plen, src_prefix, src_plen, update_route(router_id, prefix, plen, src_prefix, src_plen,
seqno, metric, interval, neigh, nh, seqno, metric, interval, neigh, nh,
channels, channels_len); channels, channels_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment