Skip to content
Snippets Groups Projects
Commit d9915da3 authored by takt's avatar takt Committed by Daniel Czerwonk
Browse files

BGP: Validate NLRI (valid Prefix) (#246)

parent b5d43b4f
No related branches found
No related tags found
No related merge requests found
......@@ -39,5 +39,10 @@ func deserializePrefix(b []byte, pfxLen uint8, afi uint16) (*bnet.Prefix, error)
return nil, err
}
return bnet.NewPfx(ip, pfxLen).Dedup(), nil
pfx := bnet.NewPfx(ip, pfxLen)
if !pfx.Valid() {
return nil, fmt.Errorf("Invalid prefix: %q", pfx.String())
}
return pfx.Dedup(), nil
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment