Skip to content
Snippets Groups Projects

Resolve "AddLink crashes goSDN when Link without correct port config is send."

4 files
+ 86
97
Compare changes
  • Side-by-side
  • Inline
Files
4
  • 2e4a2a05
    Store for links adjusted · 2e4a2a05
    Malte Bauch authored
    Handling of links with the help of a store is handled quite differently
    than how it is done in other cases (e.g., network element, user, roles).
    Therefore the methods have been adjusted to deal with this fact.
@@ -78,8 +78,19 @@ func (t *TopologyServer) AddLink(ctx context.Context, request *topopb.AddLinkReq
return nil, status.Errorf(codes.Aborted, "%v", err)
}
// check if UUID is set
var id uuid.UUID
if requestId := request.Link.Id; requestId != "" {
id, err = uuid.Parse(requestId)
if err != nil {
return nil, err
}
} else {
id = uuid.New()
}
link := links.Link{
ID: uuid.New(),
ID: id,
Name: request.Link.Name,
SourceNode: sourceNode,
SourcePort: sourcePort,
Loading