Skip to content

Commit

Permalink
kernel/rtnl: declare RTA_* locally
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3ric committed Jan 26, 2025
1 parent 8b11a17 commit d7e2b50
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/kernel/rtnl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use crate::util::grace;
use clap::Args;
use futures::channel::mpsc::UnboundedReceiver;
use futures::{try_join, StreamExt, TryStreamExt};
use libc::{RTA_GATEWAY, RTA_OIF, RTA_VIA};
use rtnetlink::packet_core::{NetlinkMessage, NetlinkPayload};
use rtnetlink::packet_route::address::{AddressAttribute, AddressMessage};
use rtnetlink::packet_route::route::{RouteAddress, RouteAttribute, RouteMessage, RouteVia};
Expand All @@ -21,6 +20,12 @@ use std::time::Duration;
use tokio::select;
use tokio::time::{interval, Interval};

// Route attribute kinds. Some const declarations are missing in libc crate with
// musl targets, so define here.
const RTA_OIF: u16 = 4;
const RTA_GATEWAY: u16 = 5;
const RTA_VIA: u16 = 18;

// TODO: maintain device info similar to BIRD's "device" protocol, and use it to
// ensure only direct traffic to neighbours
// For now, we allow any address by `ip route get`.
Expand Down

0 comments on commit d7e2b50

Please sign in to comment.