Giter Site home page Giter Site logo

erbium's Introduction

Erbium

Erbium1 provides networking services for use on small/home networks. Erbium currently supports both DNS and DHCP, with other protocols hopefully coming soon.

Erbium is in early development.

  • DNS is beta quality. Should be ready for test use.
  • DHCP is beta quality. Should be ready for test use.
  • Router Advertisements are beta quality. Should be ready for test use.

Building

Erbium uses the standard rust build chain: cargo.

To download, compile, link and install erbium you can use the following command:

$ cargo install erbium --bin erbium --root /usr/local

You will need a configuration file

IRC

We discuss erbium on #erbium on irc.libera.chat

Footnotes

  1. Erbium is the 68th element in the periodic table, the same as the client port number for DHCP. โ†ฉ

erbium's People

Contributors

isomer avatar jelmer avatar lukegb avatar msuriar avatar ruediger avatar stappersg avatar vandry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

erbium's Issues

dhcp should populate the arp table

erbium should optionally populate the arp table when giving out dhcp leases.

Either as a way to pre-warm the arp table, or providing a permanent entry making arp spoofing against the erbium host much harder.

Example configuration file

Hi,

Here another journal entry of my exploring erbium expedition ;-).

In man/erbium.conf.5 is an example configuration that did not work with a fresh git clone from early 2021.

I got

Error: Failed to load config from erbium.conf: Invalid Configuration: Policy contains unknown field 'dns-servers'

With

--- man/erbium.conf.5       2021-01-02 14:14:35.371601811 +0100
+++ man/erbium.conf.5       2021-01-02 19:24:32.162294063 +0100
@@ -361,8 +361,8 @@
         - prefix: 203.0.113.0/24
           next-hop: $self4
        policies:
-        - { match-hardware-address: 00:00:5E:00:53:01, apply-address: 198.51.100.110, dns-servers: null }
-        - { match-hardware-address: 00:00:5E:00:53:02, apply-address: 198.51.100.111, dns-servers: [8.8.8.8] }
+        - { match-hardware-address: 00:00:5E:00:53:01, apply-address: 198.51.100.110 }
+        - { match-hardware-address: 00:00:5E:00:53:02, apply-address: 198.51.100.111 }
 
      - apply-subnet: 203.0.113.0/24
        policies:

I got beyond that error.

I think it would be a good thing if erbium ships copy and paste ready examples of configuration files. (It would got me sooner to #10 ;-))

add mDNS support

Supporting mDNS would be nice from a service discovery point of view, possibly also allowing clients on different subnets to be able to share in service discovery.

DNS could also automatically look up .local names via mDNS.

mDNS, while sharing a packet format with DNS is actually a very different protocol making reusing the existing dns code difficult.

add ntp support

Clients need access to an ntp server to be able to set their time accurately. erbium should have an ntp client so that it has an accurate clock, and should act as an ntp server for it's clients.

I'm not sure how to advertise ntp to a v6 only client (without also implementing dhcpv6)

add lldp support

It would greatly easy debugging if all network elements implement lldp. We should be the change we want to see in the world and make sure erbium supports lldp.

phase 1: support sending lldp information on configured ports (default: all ethernet interfaces?)

phase 2: parse lldp information received on all interfaces and present it via /metrics and /api/v1/lldp.json.

extra points awarded for supporting lldp-med (both rx and tx).

doesn't handle IPv6 domain name servers - Add support for RDNSS

It appears to just parse IP addresses as IPv4. If I try to configure an IPv6 address in erbium.conf, I get an invalid IP error:

Error: DHCP Config loading error: Failed to parse apply-dns-servers: iplist contains an invalid IP: String("2001:4860:4860::8888")

dns should support dnssec

we should protect against cache poisoning by implementing dnssec, as well as protecting against information leakage by implementing RFC8198: Aggressive Use of DNSSEC-Validated Cache.

dhcp should support dhcp relay

dhcp currently doesnt support dhcp relays getting a lease. this is technically in violation of the rfc, and this should be fixed.

100% CPU usage just after starting erbium

Just after I start erbium 1.0.4 on debian, I get the version number in the logs. After that, erbium just uses 100% of one core and spins indefinitely.

Threads:

(gdb) info threads
  Id   Target Id                                          Frame
  1    Thread 0x7fb2e9522280 (LWP 6362) "erbium"          syscall ()
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  2    Thread 0x7fb2e95206c0 (LWP 6365) "tokio-runtime-w" 0x00007fb2e962bc06 in epoll_wait (epfd=3, events=0x55f2a69eade0, maxevents=1024, timeout=-1)
    at ../sysdeps/unix/sysv/linux/epoll_wait.c:30
  3    Thread 0x7fb2e931f6c0 (LWP 6366) "tokio-runtime-w" syscall ()
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
  4    Thread 0x7fb2e911e6c0 (LWP 6367) "tokio-runtime-w" 0x000055f2a4ddcf45 in tokio::sync::batch_semaphore::Semaphore::release (self=0x55f2a69f3ce0, added=536870911)
    at src/sync/batch_semaphore.rs:210
* 5    Thread 0x7fb2e8f1d6c0 (LWP 6368) "tokio-runtime-w" syscall ()
    at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38

Backtrace from the thread that appears to be spinning:

#0  0x000055f2a4ddcf45 in tokio::sync::batch_semaphore::Semaphore::release (self=0x55f2a69f3ce0, added=536870911) at src/sync/batch_semaphore.rs:210
#1  0x000055f2a4b4186c in tokio::sync::rwlock::write_guard::{impl#5}::drop<erbium_net::netinfo::NetInfo> (self=<optimized out>)
    at /usr/share/cargo/registry/tokio-1.24.2/src/sync/rwlock/write_guard.rs:272
#2  core::ptr::drop_in_place<tokio::sync::rwlock::write_guard::RwLockWriteGuard<erbium_net::netinfo::NetInfo>> () at /usr/src/rustc-1.65.0/library/core/src/ptr/mod.rs:487
#3  erbium_net::netinfo::{impl#4}::process_newlink::{async_fn#0} () at /usr/share/cargo/registry/erbium-net-1.0.4/src/netinfo.rs:243
#4  core::future::from_generator::{impl#1}::poll<erbium_net::netinfo::{impl#4}::process_newlink::{async_fn_env#0}> (self=..., cx=0x7fb2e911d0c8)
    at /usr/src/rustc-1.65.0/library/core/src/future/mod.rs:91
#5  erbium_net::netinfo::{impl#4}::process_message::{async_fn#0} () at /usr/share/cargo/registry/erbium-net-1.0.4/src/netinfo.rs:419
#6  core::future::from_generator::{impl#1}::poll<erbium_net::netinfo::{impl#4}::process_message::{async_fn_env#0}> (self=..., cx=0x7fb2e911d0c8)
    at /usr/src/rustc-1.65.0/library/core/src/future/mod.rs:91
#7  erbium_net::netinfo::{impl#4}::run::{async_fn#0} () at /usr/share/cargo/registry/erbium-net-1.0.4/src/netinfo.rs:467
#8  0x000055f2a4b28bd5 in core::future::from_generator::{impl#1}::poll<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}> (self=..., cx=0x7fb2e911d0c8)
    at /usr/src/rustc-1.65.0/library/core/src/future/mod.rs:91
#9  tokio::runtime::task::core::{impl#6}::poll::{closure#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (ptr=0x55f2a69e82d0) at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/core.rs:223
#10 tokio::loom::std::unsafe_cell::UnsafeCell<tokio::runtime::task::core::Stage<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>>>::with_mut<tokio::runtime::task::core::Stage<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>>, core::task::poll::Poll<()>, tokio::runtime::task::core::{impl#6}::poll::{closure_env#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>> (self=0x55f2a69e82d0, f=...) at /usr/share/cargo/registry/tokio-1.24.2/src/loom/std/unsafe_cell.rs:14
#11 tokio::runtime::task::core::Core<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>::poll<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (self=0x55f2a69e82c0, cx=...) at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/core.rs:212
#12 0x000055f2a4b0d606 in tokio::runtime::task::harness::poll_future::{closure#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> () at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/harness.rs:476
#13 core::panic::unwind_safe::{impl#23}::call_once<core::task::poll::Poll<()>, tokio::runtime::task::harness::poll_future::{closure_env#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>> (self=..., _args=<optimized out>)
    at /usr/src/rustc-1.65.0/library/core/src/panic/unwind_safe.rs:271
#14 std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>, core::task::poll::Poll<()>> (data=<optimized out>)
    at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:492
#15 std::panicking::try<core::task::poll::Poll<()>, core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>> (f=...)
    at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:456
#16 std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>>, core::task::poll::Poll<()>> (f=...)
    at /usr/src/rustc-1.65.0/library/std/src/panic.rs:137
#17 tokio::runtime::task::harness::poll_future<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (core=0x55f2a69e82c0, cx=...) at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/harness.rs:464
#18 tokio::runtime::task::harness::Harness<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>::poll_inner<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (self=<optimized out>) at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/harness.rs:198
#19 tokio::runtime::task::harness::Harness<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>::poll<core::future::from_generator::GenFuture<erbium_net::netinfo::{impl#4}::run::{async_fn_env#0}>, alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (self=...) at /usr/share/cargo/registry/tokio-1.24.2/src/runtime/task/harness.rs:152
#20 0x000055f2a4df8adb in tokio::runtime::task::raw::RawTask::poll (self=...) at src/runtime/task/raw.rs:200
#21 tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>>::run<alloc::sync::Arc<tokio::runtime::scheduler::multi_thread::handle::Handle>> (self=...) at src/runtime/task/mod.rs:394
--Type <RET> for more, q to quit, c to continue without paging--
#22 tokio::runtime::scheduler::multi_thread::worker::{impl#1}::run_task::{closure#0} () at src/runtime/scheduler/multi_thread/worker.rs:464
#23 tokio::runtime::coop::with_budget<core::result::Result<alloc::boxed::Box<tokio::runtime::scheduler::multi_thread::worker::Core, alloc::alloc::Global>, ()>, tokio::runtime::scheduler::multi_thread::worker::{impl#1}::run_task::{closure_env#0}> () at src/runtime/coop.rs:102
#24 tokio::runtime::coop::budget<core::result::Result<alloc::boxed::Box<tokio::runtime::scheduler::multi_thread::worker::Core, alloc::alloc::Global>, ()>, tokio::runtime::scheduler::multi_thread::worker::{impl#1}::run_task::{closure_env#0}> () at src/runtime/coop.rs:68
#25 tokio::runtime::scheduler::multi_thread::worker::Context::run_task (self=0x7fb2e911d978, task=..., core=0x55f2a69f2960) at src/runtime/scheduler/multi_thread/worker.rs:463
#26 0x000055f2a4df81d1 in tokio::runtime::scheduler::multi_thread::worker::Context::run (self=0x7fb2e911d978, core=0x55f2a69f2960)
    at src/runtime/scheduler/multi_thread/worker.rs:426
#27 0x000055f2a4deab79 in tokio::runtime::scheduler::multi_thread::worker::run::{closure#0} () at src/runtime/scheduler/multi_thread/worker.rs:406
#28 tokio::macros::scoped_tls::ScopedKey<tokio::runtime::scheduler::multi_thread::worker::Context>::set<tokio::runtime::scheduler::multi_thread::worker::Context, tokio::runtime::scheduler::multi_thread::worker::run::{closure_env#0}, ()> (self=<optimized out>, t=0x7fb2e911d978, f=...) at src/macros/scoped_tls.rs:61
#29 0x000055f2a4df7aa0 in tokio::runtime::scheduler::multi_thread::worker::run (worker=...) at src/runtime/scheduler/multi_thread/worker.rs:403
#30 0x000055f2a4dde8f2 in tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure#0} () at src/runtime/scheduler/multi_thread/worker.rs:365
#31 tokio::runtime::blocking::task::{impl#2}::poll<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}, ()> (self=..., _cx=<optimized out>)
    at src/runtime/blocking/task.rs:42
#32 tokio::runtime::task::core::{impl#6}::poll::{closure#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> (ptr=0x55f2a69f34f8) at src/runtime/task/core.rs:223
#33 tokio::loom::std::unsafe_cell::UnsafeCell<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>>>::with_mut<tokio::runtime::task::core::Stage<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>>, core::task::poll::Poll<()>, tokio::runtime::task::core::{impl#6}::poll::{closure_env#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>> (self=0x55f2a69f34f8, f=...) at src/loom/std/unsafe_cell.rs:14
#34 0x000055f2a4e0406c in tokio::runtime::task::core::Core<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> (self=0x55f2a69f34f0, cx=...) at src/runtime/task/core.rs:212
#35 0x000055f2a4e014df in tokio::runtime::task::harness::poll_future::{closure#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> () at src/runtime/task/harness.rs:476





#36 core::panic::unwind_safe::{impl#23}::call_once<core::task::poll::Poll<()>, tokio::runtime::task::harness::poll_future::{closure_env#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>> (self=..., _args=<optimized out>)
    at /usr/src/rustc-1.65.0/library/core/src/panic/unwind_safe.rs:271
#37 std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>, core::task::poll::Poll<()>> (
    data=<optimized out>) at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:492
#38 std::panicking::try<core::task::poll::Poll<()>, core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>> (f=...)
    at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:456
#39 std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::{closure_env#0}<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>>, core::task::poll::Poll<()>> (f=...)
    at /usr/src/rustc-1.65.0/library/std/src/panic.rs:137
#40 tokio::runtime::task::harness::poll_future<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> (core=0x55f2a69f34f0, cx=...) at src/runtime/task/harness.rs:464
#41 tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll_inner<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> (self=<optimized out>) at src/runtime/task/harness.rs:198
#42 tokio::runtime::task::harness::Harness<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule>::poll<tokio::runtime::blocking::task::BlockingTask<tokio::runtime::scheduler::multi_thread::worker::{impl#0}::launch::{closure_env#0}>, tokio::runtime::blocking::schedule::BlockingSchedule> (self=...) at src/runtime/task/harness.rs:152
#43 0x000055f2a4de48db in tokio::runtime::task::raw::RawTask::poll (self=...) at src/runtime/task/raw.rs:200
--Type <RET> for more, q to quit, c to continue without paging--
#44 tokio::runtime::task::UnownedTask<tokio::runtime::blocking::schedule::BlockingSchedule>::run<tokio::runtime::blocking::schedule::BlockingSchedule> (self=...)
    at src/runtime/task/mod.rs:431
#45 tokio::runtime::blocking::pool::Task::run (self=...) at src/runtime/blocking/pool.rs:159
#46 tokio::runtime::blocking::pool::Inner::run (self=0x55f2a69f03b0, worker_thread_id=<optimized out>) at src/runtime/blocking/pool.rs:511
#47 0x000055f2a4de8992 in tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure#0} () at src/runtime/blocking/pool.rs:469
#48 std::sys_common::backtrace::__rust_begin_short_backtrace<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()> (f=...)
    at /usr/src/rustc-1.65.0/library/std/src/sys_common/backtrace.rs:122
#49 0x000055f2a4dfe08e in std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure#0}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()> ()
    at /usr/src/rustc-1.65.0/library/std/src/thread/mod.rs:514
#50 core::panic::unwind_safe::{impl#23}::call_once<(), std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()>> (self=<error reading variable: Cannot access memory at address 0x0>, _args=<optimized out>) at /usr/src/rustc-1.65.0/library/core/src/panic/unwind_safe.rs:271
#51 std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()>>, ()> (data=<optimized out>) at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:492
#52 std::panicking::try<(), core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()>>> (f=<error reading variable: Cannot access memory at address 0x0>) at /usr/src/rustc-1.65.0/library/std/src/panicking.rs:456
#53 std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<std::thread::{impl#0}::spawn_unchecked_::{closure#1}::{closure_env#0}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()>>, ()> (f=<error reading variable: Cannot access memory at address 0x0>) at /usr/src/rustc-1.65.0/library/std/src/panic.rs:137
#54 std::thread::{impl#0}::spawn_unchecked_::{closure#1}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()> ()
    at /usr/src/rustc-1.65.0/library/std/src/thread/mod.rs:513
#55 core::ops::function::FnOnce::call_once<std::thread::{impl#0}::spawn_unchecked_::{closure_env#1}<tokio::runtime::blocking::pool::{impl#6}::spawn_thread::{closure_env#0}, ()>, ()>
    () at /usr/src/rustc-1.65.0/library/core/src/ops/function.rs:248
#56 0x000055f2a4e45883 in alloc::boxed::{impl#44}::call_once<(), dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global> (self=..., args=<optimized out>)
    at library/alloc/src/boxed.rs:1940
#57 alloc::boxed::{impl#44}::call_once<(), alloc::boxed::Box<dyn core::ops::function::FnOnce<(), Output=()>, alloc::alloc::Global>, alloc::alloc::Global> (self=0x55f2a69f3380,
    args=<optimized out>) at library/alloc/src/boxed.rs:1940
#58 std::sys::unix::thread::{impl#2}::new::thread_start (main=0x55f2a69f3380) at library/std/src/sys/unix/thread.rs:108
#59 0x00007fb2e95abfd4 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#60 0x00007fb2e962c5bc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81

exits with exit code 0 when configuration can't be parsed

When it fails to parse the configuration, erbium currently exits with exit code 0 - resulting in e.g. systemd thinking it ran successfully.

Found new interface IfInfo { name: "lo", addresses: [], lladdr: None, llbroadcast: None, mtu: 65536 }
...
Error: Yaml parse erorr while reading configuration: while parsing a block mapping, did not find expected key at line 3 column 43
# echo $?
0

Error: I/O Error in DHCP: Address already in use (os error 98)

Hi,

Here a progress report from my exploring erbium expedition ;-).

I'm stuck at

Error: I/O Error in DHCP: Address already in use (os error 98)

But I don't understand that fatal error message.

With sudo strace target/debug/erbium I can see

socket(AF_INET, SOCK_DGRAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 15
bind(15, {sa_family=AF_INET, sin_port=htons(67), sin_addr=inet_addr("0.0.0.0")}, 16) = -1 \
  EADDRINUSE (Address already in use)
close(15) 

With ss -n | grep :67 I did found a dhcp client, but after switching network configuration of my Linux laptop to static config, the error persists.

What should be done to get beyond the EADDRINUSE?

dns ratelimiter needs tuning.

dns attempts to rate limit error packets to avoid being used in reflection attacks, but currently the ratelimiter is very poorly tuned...

Build failed on nixos...

I'm gonna need to learn Rust, now.

[looney@nas:~/repos/erbium]$ nix-build 
these derivations will be built:
  /nix/store/3h5l2casllxqnl308yvq568pp161snqq-rust_erbium-0.2.8.drv
building '/nix/store/3h5l2casllxqnl308yvq568pp161snqq-rust_erbium-0.2.8.drv'...
unpacking sources
unpacking source archive /nix/store/4a932gp9iakh5qkx4mfrjvrn0m94lh0i-source
source root is source
patching sources
configuring
Running cd .
Building src/build.rs (erbium)
Running rustc --crate-name build_script_build src/build.rs --crate-type bin -C opt-level=3 -C codegen-units=8 --edition 2018 --cfg feature="default" --cfg feature="dhcp" --cfg feature="http" --cfg feature="hyper" --cfg feature="radv" --out-dir target/build/erbium --emit=dep-info,link -L dependency=target/buildDeps --extern vergen=/nix/store/a5vc3gs59w42ib5hwd403ilsx7aca23z-rust_vergen-3.1.0-lib/lib/libvergen-d4d256cf51.rlib --cap-lints allow --color always
Unable to generate 'cargo:rerun-if-changed'
building
Building src/lib.rs (erbium)
Running rustc --crate-name erbium src/lib.rs --out-dir target/lib -L dependency=target/deps --cap-lints allow -C opt-level=3 -C codegen-units=8 --remap-path-prefix=/build=/ --extern arbitrary=/nix/store/dn6zfnnrvnkca9zr2iqb2hp61qhwg0m2-rust_arbitrary-0.4.7-lib/lib/libarbitrary-d100770207.rlib --extern async_std=/nix/store/nz3hw81d3v3gr1s240bdqi2375vvxdsc-rust_async-std-1.9.0-lib/lib/libasync_std-4de38e40f9.rlib --extern async_trait=/nix/store/cd1dwgg89cw7qwvv7xpa1mfa7lh2g0wb-rust_async-trait-0.1.42-lib/lib/libasync_trait-3bbe283d5a.so --extern bytes=/nix/store/3v4igx2kaqlpk4n3f4dsx0mcrhv7n8c2-rust_bytes-1.0.1-lib/lib/libbytes-21751ed697.rlib --extern env_logger=/nix/store/zvaqb7lpsvvi7sv9qvkwrgmvq8g43dbv-rust_env_logger-0.8.2-lib/lib/libenv_logger-5d6cdb2cdb.rlib --extern futures=/nix/store/gpyc1qp2w71rv5gfcnx0pix5jgkfqv9a-rust_futures-0.3.12-lib/lib/libfutures-22983d466f.rlib --extern futures_core=/nix/store/pcaszkfis4q1m4nmifiinr3fnx8xlvjs-rust_futures-core-0.3.12-lib/lib/libfutures_core-0d308b3734.rlib --extern futures_sink=/nix/store/0ri8kw1v2ji6vh965y9aw0zcyirldkyf-rust_futures-sink-0.3.12-lib/lib/libfutures_sink-a5b1b27657.rlib --extern hostname=/nix/store/5gx0p64qcq2dk3106pv31x8flv05vv87-rust_hostname-0.3.1-lib/lib/libhostname-2be79d2be7.rlib --extern hyper=/nix/store/8smls2y5anzxkmgwd6b4yr8v66bwly0m-rust_hyper-0.14.2-lib/lib/libhyper-ce7c0c3fde.rlib --extern lazy_static=/nix/store/k2afirprgxspzsk9i9236dvrhvmcbfgy-rust_lazy_static-1.4.0-lib/lib/liblazy_static-28e1bf1896.rlib --extern log=/nix/store/xwb2w5ldx1m72g6wwq21bkk19p04jlyj-rust_log-0.4.14-lib/lib/liblog-ccc62af5e0.rlib --extern mio=/nix/store/i82z22nb34sr53hl26sf4qfzw2jw8mrn-rust_mio-0.7.7-lib/lib/libmio-857c5253dc.rlib --extern netlink_packet_route=/nix/store/2m7mzz4z22pj9wvqbn549p3q64f2563r-rust_netlink-packet-route-0.6.0-lib/lib/libnetlink_packet_route-92e7c2e0cf.rlib --extern netlink_sys=/nix/store/pwzbxa9lcancgcdjfcl4yr6dg4qz8d5q-rust_netlink-sys-0.5.0-lib/lib/libnetlink_sys-77d18327ba.rlib --extern nix=/nix/store/rwj4f7qwm6n72cr0fmac349cafpbxxdp-rust_nix-0.19.1-lib/lib/libnix-4e66967a7f.rlib --extern prometheus=/nix/store/1ny7gkqdhc5al2m4vv1mmvddd2zhi0v5-rust_prometheus-0.11.0-lib/lib/libprometheus-aed2d5f410.rlib --extern rand=/nix/store/26iql5ncrb1hgavdjrla06caw0z35zqr-rust_rand-0.8.3-lib/lib/librand-f25a635e5c.rlib --extern rusqlite=/nix/store/gl59gqmvwv8gnk0rvsvph6601z0884fq-rust_rusqlite-0.24.2-lib/lib/librusqlite-731fb340b9.rlib --extern tokio=/nix/store/p6n6m51vc90kmq1zy41ngp2wv5jzasmw-rust_tokio-1.1.1-lib/lib/libtokio-b261d6c443.rlib --extern tokio_compat_02=/nix/store/xif04i1jv049glm79z6gpkzid152ln4k-rust_tokio-compat-02-0.2.0-lib/lib/libtokio_compat_02-fe3afa5e1d.rlib --extern tokio_util=/nix/store/c3ilixm368cgl91rfd052n5zhkwq9svr-rust_tokio-util-0.6.3-lib/lib/libtokio_util-0b3d7e60a6.rlib --extern yaml_rust=/nix/store/938mi7p7icgbkclh3c8c32fhzf3b4wb0-rust_yaml-rust-0.4.5-lib/lib/libyaml_rust-7dda40ffa1.rlib --cfg feature="default" --cfg feature="dhcp" --cfg feature="http" --cfg feature="hyper" --cfg feature="radv" --edition 2018 -C metadata=0c6b4ab759 -C extra-filename=-0c6b4ab759 --crate-type lib -L /build/source/target/build/erbium.out -L native=/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib -l sqlite3 --color always
Building erbium-dns (src/bin/erbium-dns.rs)
Running rustc --crate-name erbium_dns src/bin/erbium-dns.rs --crate-type bin -C opt-level=3 -C codegen-units=8 --remap-path-prefix=/build=/ --extern arbitrary=/nix/store/dn6zfnnrvnkca9zr2iqb2hp61qhwg0m2-rust_arbitrary-0.4.7-lib/lib/libarbitrary-d100770207.rlib --extern async_std=/nix/store/nz3hw81d3v3gr1s240bdqi2375vvxdsc-rust_async-std-1.9.0-lib/lib/libasync_std-4de38e40f9.rlib --extern async_trait=/nix/store/cd1dwgg89cw7qwvv7xpa1mfa7lh2g0wb-rust_async-trait-0.1.42-lib/lib/libasync_trait-3bbe283d5a.so --extern bytes=/nix/store/3v4igx2kaqlpk4n3f4dsx0mcrhv7n8c2-rust_bytes-1.0.1-lib/lib/libbytes-21751ed697.rlib --extern env_logger=/nix/store/zvaqb7lpsvvi7sv9qvkwrgmvq8g43dbv-rust_env_logger-0.8.2-lib/lib/libenv_logger-5d6cdb2cdb.rlib --extern futures=/nix/store/gpyc1qp2w71rv5gfcnx0pix5jgkfqv9a-rust_futures-0.3.12-lib/lib/libfutures-22983d466f.rlib --extern futures_core=/nix/store/pcaszkfis4q1m4nmifiinr3fnx8xlvjs-rust_futures-core-0.3.12-lib/lib/libfutures_core-0d308b3734.rlib --extern futures_sink=/nix/store/0ri8kw1v2ji6vh965y9aw0zcyirldkyf-rust_futures-sink-0.3.12-lib/lib/libfutures_sink-a5b1b27657.rlib --extern hostname=/nix/store/5gx0p64qcq2dk3106pv31x8flv05vv87-rust_hostname-0.3.1-lib/lib/libhostname-2be79d2be7.rlib --extern hyper=/nix/store/8smls2y5anzxkmgwd6b4yr8v66bwly0m-rust_hyper-0.14.2-lib/lib/libhyper-ce7c0c3fde.rlib --extern lazy_static=/nix/store/k2afirprgxspzsk9i9236dvrhvmcbfgy-rust_lazy_static-1.4.0-lib/lib/liblazy_static-28e1bf1896.rlib --extern log=/nix/store/xwb2w5ldx1m72g6wwq21bkk19p04jlyj-rust_log-0.4.14-lib/lib/liblog-ccc62af5e0.rlib --extern mio=/nix/store/i82z22nb34sr53hl26sf4qfzw2jw8mrn-rust_mio-0.7.7-lib/lib/libmio-857c5253dc.rlib --extern netlink_packet_route=/nix/store/2m7mzz4z22pj9wvqbn549p3q64f2563r-rust_netlink-packet-route-0.6.0-lib/lib/libnetlink_packet_route-92e7c2e0cf.rlib --extern netlink_sys=/nix/store/pwzbxa9lcancgcdjfcl4yr6dg4qz8d5q-rust_netlink-sys-0.5.0-lib/lib/libnetlink_sys-77d18327ba.rlib --extern nix=/nix/store/rwj4f7qwm6n72cr0fmac349cafpbxxdp-rust_nix-0.19.1-lib/lib/libnix-4e66967a7f.rlib --extern prometheus=/nix/store/1ny7gkqdhc5al2m4vv1mmvddd2zhi0v5-rust_prometheus-0.11.0-lib/lib/libprometheus-aed2d5f410.rlib --extern rand=/nix/store/26iql5ncrb1hgavdjrla06caw0z35zqr-rust_rand-0.8.3-lib/lib/librand-f25a635e5c.rlib --extern rusqlite=/nix/store/gl59gqmvwv8gnk0rvsvph6601z0884fq-rust_rusqlite-0.24.2-lib/lib/librusqlite-731fb340b9.rlib --extern tokio=/nix/store/p6n6m51vc90kmq1zy41ngp2wv5jzasmw-rust_tokio-1.1.1-lib/lib/libtokio-b261d6c443.rlib --extern tokio_compat_02=/nix/store/xif04i1jv049glm79z6gpkzid152ln4k-rust_tokio-compat-02-0.2.0-lib/lib/libtokio_compat_02-fe3afa5e1d.rlib --extern tokio_util=/nix/store/c3ilixm368cgl91rfd052n5zhkwq9svr-rust_tokio-util-0.6.3-lib/lib/libtokio_util-0b3d7e60a6.rlib --extern yaml_rust=/nix/store/938mi7p7icgbkclh3c8c32fhzf3b4wb0-rust_yaml-rust-0.4.5-lib/lib/libyaml_rust-7dda40ffa1.rlib --cfg feature="default" --cfg feature="dhcp" --cfg feature="http" --cfg feature="hyper" --cfg feature="radv" --edition 2018 --out-dir target/bin -L dependency=target/deps -L native=/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib -l sqlite3 --extern erbium=target/lib/liberbium-0c6b4ab759.rlib --cap-lints allow -L /build/source/target/build/erbium.out -L native=/nix/store/y66v2n3chpg0qfn402ldihi38qdxllab-sqlite-3.33.0/lib -l sqlite3 --color always
error[E0432]: unresolved import `erbium::dns`
  --> src/bin/erbium-dns.rs:23:5
   |
23 | use erbium::dns;
   |     ^^^^^^^^^^^ no `dns` in the root

error: aborting due to previous error

For more information about this error, try `rustc --explain E0432`.
builder for '/nix/store/3h5l2casllxqnl308yvq568pp161snqq-rust_erbium-0.2.8.drv' failed with exit code 1
error: build of '/nix/store/3h5l2casllxqnl308yvq568pp161snqq-rust_erbium-0.2.8.drv' failed

doesn't say where it's attempting to read configuration from when it fails

Running erbium without a configuration file, I currently get a somewhat unhelpful error message:

# /usr/local/bin/erbium-dhcp 
Found new interface IfInfo { name: "lo", addresses: [], lladdr: None, llbroadcast: None, mtu: 65536 }
...
Found new interface IfInfo { name: "wlp4s0", addresses: [], lladdr: Ethernet([4, 240, 33, 12, 41, 218]), llbroadcast: Ethernet([255, 255, 255, 255, 255, 255]), mtu: 1500 }
Found new interface IfInfo { name: "wgnet0", addresses: [], lladdr: None, llbroadcast: None, mtu: 1420 }
Found addr 127.0.0.1/8 for if#1, now [(V4(127.0.0.1), 8)]
...
Error: I/O Error reading configuration file: No such file or directory (os error 2)

it would be great if it mentioned where it's trying to read the configuration from.

(Even if it succeeds, it may be useful to log where it read the configuration from - in case you have multiple configurations)

doesn't print usage information on --help or -h

If erbium is run with --help or -h, it appears to ignore the argument (maybe it interprets it as a configuration file path?) and loads as normal rather than printing information about its flags or lack thereof:

 /usr/local/bin/erbium-dhcp  --help
Found new interface IfInfo { name: "lo", addresses: [], lladdr: None, llbroadcast: None, mtu: 65536 }
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.