Skip to content

Commit

Permalink
ignore mcast with di that is not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
jkralik committed Jan 24, 2024
1 parent 88e9b2c commit 013855c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions bridge/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,18 @@ func (c *Service) DefaultRequestHandler(req *net.Request) (*pool.Message, error)
// ignore well-known/core
return nil, nil //nolint:nilnil
}
if req.Code() == codes.GET && uriPath == plgdResources.ResourceURI {
deviceID := req.DeviceID()
if req.Code() == codes.GET && uriPath == plgdResources.ResourceURI && deviceID == uuid.Nil {
return c.handleDiscoverAllLinks(req)
}
if req.DeviceID() == uuid.Nil {
if deviceID == uuid.Nil {
return nil, fmt.Errorf("invalid queries: di query is not set")
}
d, err := c.LoadDevice(req.DeviceID()) // check if device exists et
d, err := c.LoadDevice(deviceID) // check if device exists et
if err != nil {
if req.ControlMessage().Dst.IsMulticast() {
return nil, nil //nolint:nilnil
}
return nil, err
}
return d.HandleRequest(req)
Expand Down

0 comments on commit 013855c

Please sign in to comment.