smoltcp-rs / smoltcp

a smol tcp/ip stack
BSD Zero Clause License
3.63k stars 402 forks source link

run server example panics #911

Closed e1732a364fed closed 3 months ago

e1732a364fed commented 3 months ago

cargo run --example server -- --tap tap0

smoltcp version: https://github.com/smoltcp-rs/smoltcp/commit/4c27918434fde9b7ca6266d1eaee6da15ba8c4e8

result:

thread 'main' panicked at examples/server.rs:47:14:
called `Result::unwrap()` on an `Err` value: Ipv6(Cidr { address: Address([254, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1]), prefix_len: 64 })

it turns out that somehow ip_addrs only has capcity of 2, but the example insert 3

e1732a364fed commented 3 months ago

turns out we need provide env SMOLTCP_IFACE_MAX_ADDR_COUNT=3

advise: either put this in examples/server.rs section in README.md, or remove extra push in the example code

e1732a364fed commented 3 months ago

I think the author might think this is unnecessary. So I close this issue by myself.