mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
feat(relay): make interface for eBPF program configurable (#8592)
This commit is contained in:
@@ -20,7 +20,7 @@ pub struct Program {
|
||||
}
|
||||
|
||||
impl Program {
|
||||
pub fn try_load(interface: &'static str) -> Result<Self> {
|
||||
pub fn try_load(interface: &str) -> Result<Self> {
|
||||
let mut ebpf = aya::Ebpf::load(aya::include_bytes_aligned!(concat!(
|
||||
env!("OUT_DIR"),
|
||||
"/ebpf-turn-router-main"
|
||||
|
||||
@@ -82,6 +82,10 @@ struct Args {
|
||||
#[arg(long, env, hide = true)]
|
||||
google_cloud_project_id: Option<String>,
|
||||
|
||||
/// Which interface to load the eBPF program onto.
|
||||
#[arg(long, env, hide = true, default_value = "eth0")]
|
||||
primary_interface: String,
|
||||
|
||||
#[command(flatten)]
|
||||
health_check: http_health_check::HealthCheckArgs,
|
||||
|
||||
@@ -132,7 +136,7 @@ fn main() {
|
||||
async fn try_main(args: Args) -> Result<()> {
|
||||
setup_tracing(&args)?;
|
||||
|
||||
let mut ebpf = ebpf::Program::try_load("eth0")
|
||||
let mut ebpf = ebpf::Program::try_load(&args.primary_interface)
|
||||
.inspect_err(|e| tracing::info!("Failed to load eBPF TURN router: {e:#}"))
|
||||
.ok();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user