@@ -12,7 +12,6 @@ import (
12
12
"github.com/inverse-inc/go-radius/rfc2866"
13
13
"github.com/inverse-inc/go-radius/rfc2869"
14
14
"github.com/inverse-inc/go-utils/log"
15
- "github.com/inverse-inc/go-utils/sharedutils"
16
15
"github.com/inverse-inc/packetfence/go/config/pfcrypt"
17
16
)
18
17
@@ -25,17 +24,14 @@ type ContentKeeper struct {
25
24
// Send an SSO start to the ContentKeeper firewall
26
25
// Returns an error unless there is a valid reply from the firewall
27
26
func (fw * ContentKeeper ) Start (ctx context.Context , info map [string ]string , timeout int ) (bool , error ) {
27
+
28
28
p := fw .startRadiusPacket (ctx , info , timeout )
29
29
client := fw .getRadiusClient (ctx )
30
-
31
- var err error
32
- client .Dialer .LocalAddr , err = net .ResolveUDPAddr ("udp" , fw .getSourceIp (ctx ).String ()+ ":0" )
33
- sharedutils .CheckError (err )
34
-
35
30
// Use the background context since we don't want the lib to use our context
36
31
ctx2 , cancel := fw .RadiusContextWithTimeout ()
37
32
defer cancel ()
38
- _ , err = client .Exchange (ctx2 , p , fw .PfconfigHashNS + ":" + fw .Port )
33
+ dst := fw .getDst (ctx , "udp" , fw .PfconfigHashNS , fw .Port )
34
+ _ , err := client .Exchange (ctx2 , p , dst )
39
35
if err != nil {
40
36
log .LoggerWContext (ctx ).Error (fmt .Sprintf ("Couldn't SSO to the ContentKeeper, got the following error: %s" , err ))
41
37
return false , err
0 commit comments