Skip to content

Commit

Permalink
Verify cause status for association response (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Osiński committed Mar 17, 2022
1 parent b303ec1 commit 6be4ce2
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/pfcpsim/pfcpsim.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,17 @@ func (c *PFCPClient) SetupAssociation() error {
return err
}

if _, ok := resp.(*message.AssociationSetupResponse); !ok {
assocResp, ok := resp.(*message.AssociationSetupResponse)
if !ok {
return NewInvalidResponseError()
}

cause, err := assocResp.Cause.Cause()
if err != nil {
return NewInvalidResponseError(err)
}

if cause != ieLib.CauseRequestAccepted {
return NewInvalidResponseError()
}

Expand Down

0 comments on commit 6be4ce2

Please sign in to comment.