-
Notifications
You must be signed in to change notification settings - Fork 17
Tunnel state is not returned correctly using govici api's #49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you share the version of the Go module? Is it v0.7.0 or something older? Can you also share a snippet of the relevant Go code?
Is this output from something you ran? Or just a rough copy of https://github.com/strongswan/strongswan/blob/master/src/libcharon/plugins/vici/README.md#list-sa? |
I am using go version 1.23.2 Yes list-sa was just copy of link you shared
|
yes i am using vici version 0.7.0 |
Okay, thanks. You have a lot of debugging print statements in there. Do you have output from that program which demonstrates the issue you are describing? It would help me trace your sample code a bit. |
yes |
Oh, you're always doing the request with You probably don't want that, in which case I would recommend removing Can you see if that fixes the issue? |
Maybe the same for There are many fields where if the charon daemon sees unset, it will apply a reasonable default. But explicitly setting to the empty value can clobber that. |
Thanks Nick for looking into this.
Note that the unique IDs of IKE or Child SAs will never be 0. And 0 is also the value that's assumed as default if either key is omitted in the request and then causes no filtering.
That could be more of an issue as the empty string is obviously not Neither should affect whether |
Thanks for the explanation
@tobiasbrunner when above thing happens then in that case it will indeed return state parameter in |
No, the complete |
Hi |
Hi Team
We are using version strongSwan swanctl 5.9.6
We are trying to fetch state of ipsec tunnel periodically in go routine after every 60 seconds through govici api using streamedCommandRequest of list-sas. But encountering one issue wherein state is returned empty randomly after few days..it is an intermittent issue
we tried running bash script along with go program and that bash script prints tunnel status in a file using swanctl --list-sas command. we observed that at same time tunnel status was actually ESTABLISHED but govici api returned empty at same time.
{
<IKE_SA config name> = {
uniqueid = <IKE_SA unique identifier>
version = <IKE version, 1 or 2>
state = <IKE_SA state name>
local-host =
local-port =
local-id =
remote-host =
remote-port =
remote-id =
remote-xauth-id = <remote XAuth identity, if XAuth-authenticated>
remote-eap-id = <remote EAP identity, if EAP-authenticated>
initiator = <yes, if initiator of IKE_SA>
initiator-spi = <hex encoded initiator SPI / cookie>
responder-spi = <hex encoded responder SPI / cookie>
nat-local = <yes, if local endpoint is behind a NAT>
nat-remote = <yes, if remote endpoint is behind a NAT>
nat-fake = <yes, if NAT situation has been faked as responder>
nat-any = <yes, if any endpoint is behind a NAT (also if faked)>
if-id-in =
if-id-out =
encr-alg =
encr-keysize = <key size for encr-alg, if applicable>
integ-alg =
integ-keysize = <key size for encr-alg, if applicable>
prf-alg =
dh-group =
established =
rekey-time =
reauth-time =
local-vips = [
<list of virtual IPs assigned by the remote peer, installed locally>
]
remote-vips = [
]
tasks-queued = [
]
tasks-active = [
]
tasks-passive = [
]
child-sas = {
name =
uniqueid =
reqid =
state =
mode = <IPsec mode, tunnel|transport|beet>
protocol = <IPsec protocol AH|ESP>
encap =
spi-in =
spi-out =
cpi-in = <hex encoded inbound CPI, if using compression>
cpi-out = <hex encoded outbound CPI, if using compression>
mark-in =
mark-mask-in =
mark-out =
mark-mask-out =
if-id-in =
if-id-out =
label =
encr-alg = <ESP encryption algorithm name, if any>
encr-keysize = <ESP encryption key size, if applicable>
integ-alg = <ESP or AH integrity algorithm name, if any>
integ-keysize = <ESP or AH integrity key size, if applicable>
prf-alg = <CHILD_SA pseudo random function name>
dh-group = <CHILD_SA PFS rekeying DH group name, if any>
esn = <1 if using extended sequence numbers>
bytes-in =
packets-in =
use-in = <seconds since last inbound packet, if any>
bytes-out =
packets-out =
use-out = <seconds since last outbound packet, if any>
rekey-time =
life-time =
install-time =
local-ts = [
]
remote-ts = [
]
}
}
}
}
To Reproduce
Bug can be reproduced by running go routine which periodically prints state of tunnel for few days..and after some time state is printed as empty
Expected behavior
as swanctl client returns correct behavior at the same time..wondering why govici is not able to fetch correct status
Can someone please help me. Any pointers are highly appreciated.
Thanks!
The text was updated successfully, but these errors were encountered: