fix: fixing revshell example and its routes
This commit is contained in:
@@ -122,7 +122,10 @@ impl Link {
|
||||
|
||||
impl Debug for Link {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Link").field("name", &self.name()).finish()
|
||||
f.debug_struct("Link")
|
||||
.field("name", &self.name())
|
||||
.field("ifindex", &self.ifindex())
|
||||
.finish()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,6 +177,14 @@ pub fn get_macs_and_src_for_ip(
|
||||
|
||||
let link = netlink::get_link_by_index(links, link_ind)?;
|
||||
|
||||
let neighs_ = neighs.iter().collect::<Vec<_>>();
|
||||
|
||||
dbg!(neighs_.len());
|
||||
|
||||
for neigh in neighs_.iter() {
|
||||
println!("Neigh: {:?} -> {:?} ({})", neigh.lladdr(), neigh.dst(), neigh.ifindex());
|
||||
}
|
||||
|
||||
let neigh = neighs.iter().find(|n| n.ifindex() == link.ifindex())?;
|
||||
|
||||
let srcip = addrs.iter().find(|a| a.ifindex() == link.ifindex())?;
|
||||
|
||||
Reference in New Issue
Block a user