You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a quick look at this. The failure is in prepending an ASPath to a route that has no existing AS_SET or AS_SEQUENCE. The code checks the length, but doesn't deal with that lack of length in the second part:
let data = if len != 0 && buf[0] == Attribute::AS_PATH_TYPE_SEQ && buf[1] < 255 {
let mut new_buf = Vec::with_capacity(len as usize + 4);
new_buf.put_u8(buf[0]);
new_buf.put_u8(buf[1] + 1);
new_buf.put_u32(as_number);
new_buf.put(&buf[2..]);
AttributeData::Bin(new_buf)
} else {
let mut new_buf = Vec::with_capacity(len as usize + 6);
new_buf.put_u8(Attribute::AS_PATH_TYPE_SEQ);
new_buf.put_u8(1);
new_buf.put_u32(as_number);
new_buf.put(&buf[4..]);
AttributeData::Bin(new_buf)
};
Looking in the bview file, I see the following. Note the prefix at line 81357 has no AS Path.
So we don't take the first path because len is zero, but then there's an assumption data is there. I think the 'len != 0' check is to protect the AS_PATH_TYPE_SEQ check.
Hello,
While trying out rustybgp, I am hitting this panic on injecting routes from the mrt dump http://data.ris.ripe.net/rrc01/2010.01/bview.20100101.0759.gz. Was able to inject ~ 80k routes without any issues, before hitting the issue
thread '<unnamed>' panicked at 'range start index 4 out of range for slice of length 0', daemon/src/packet/bgp.rs:936:26
Config
stack backtrace
The text was updated successfully, but these errors were encountered: