Skip to content

Commit 3748ed0

Browse files
committed
Fixed contentkeeper firewall sso
1 parent 8e9bed6 commit 3748ed0

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

go/firewallsso/contentkeeper.go

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
"github.com/inverse-inc/go-radius/rfc2866"
1313
"github.com/inverse-inc/go-radius/rfc2869"
1414
"github.com/inverse-inc/go-utils/log"
15-
"github.com/inverse-inc/go-utils/sharedutils"
1615
"github.com/inverse-inc/packetfence/go/config/pfcrypt"
1716
)
1817

@@ -25,17 +24,14 @@ type ContentKeeper struct {
2524
// Send an SSO start to the ContentKeeper firewall
2625
// Returns an error unless there is a valid reply from the firewall
2726
func (fw *ContentKeeper) Start(ctx context.Context, info map[string]string, timeout int) (bool, error) {
27+
2828
p := fw.startRadiusPacket(ctx, info, timeout)
2929
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-
3530
// Use the background context since we don't want the lib to use our context
3631
ctx2, cancel := fw.RadiusContextWithTimeout()
3732
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)
3935
if err != nil {
4036
log.LoggerWContext(ctx).Error(fmt.Sprintf("Couldn't SSO to the ContentKeeper, got the following error: %s", err))
4137
return false, err

0 commit comments

Comments
 (0)