feat(openconnect): log HIP reporting mode on connection

This commit is contained in:
Kevin Yue committed 2026-10-02 21:07:49 +08:00
1 parent 87ffc46551
commit eec18375cd
1 file changed
+16
+16
View File
@@ -139,6 +139,22 @@ impl Vpn {
} }
pub fn connect(&self, on_connected: impl FnOnce(VpnSessionInfo) + 'static + Send + Sync) -> i32 { pub fn connect(&self, on_connected: impl FnOnce(VpnSessionInfo) + 'static + Send + Sync) -> i32 {
match &self.hip_source {
HipSource::Disabled => info!("HIP reporting: disabled"),
HipSource::Generator(_) => info!("HIP reporting: enabled, source=callback"),
HipSource::Script(script) => {
#[cfg(unix)]
{
let uid = script.user.unwrap_or_else(|| unsafe { libc::geteuid() });
info!("HIP reporting: enabled, source=script, uid={uid}");
}
#[cfg(not(unix))]
match script.user {
Some(uid) => info!("HIP reporting: enabled, source=script, uid={uid}"),
None => info!("HIP reporting: enabled, source=script, user=process-user"),
}
}
}
self.callback.write().unwrap().replace(Box::new(on_connected)); self.callback.write().unwrap().replace(Box::new(on_connected));
let mut options = self.build_connect_options(); let mut options = self.build_connect_options();
let environment = match &self.hip_source { let environment = match &self.hip_source {