Compare commits

..

2 Commits

Author SHA1 Message Date
_ 30ebb528eb bump to v0.1.5 2021-12-08 21:53:27 -06:00
_ 221a0bef2f ignore errors if an interface can't join multicast
This works okay on my home network, but it's a little more magical than
I wanted - I can't force it to pick up the wifi interface. If the
Ethernet is plugged in, the laptop always and only picks that, even
if I know the server only asked the Ethernet interface.

This is fine, but only because my Ethernet happens to be faster than
my Wifi. I'm not sure how it will behave at work, where WiFi and
Ethernet may be separate networks.

At least the error messages are better now, so I can figure out why
it wasn't auto-starting with systemd.
2021-12-08 21:48:41 -06:00
5 changed files with 22 additions and 13 deletions

2
Cargo.lock generated
View File

@ -54,7 +54,7 @@ dependencies = [
[[package]]
name = "lookaround"
version = "0.1.4"
version = "0.1.5"
dependencies = [
"mac_address",
"rand",

View File

@ -9,7 +9,7 @@ license = "AGPL-3.0"
name = "lookaround"
readme = "README.md"
repository = "https://six-five-six-four.com/git/reactor/lookaround"
version = "0.1.4"
version = "0.1.5"
[dependencies]
mac_address = "1.1.2"

View File

@ -3,9 +3,6 @@
_Has this ever happened to you?_
LookAround is a Rust program for looking up your computers' MAC and IP addresses
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
```text
$ lookaround client
@ -15,12 +12,14 @@ Found 3 peers:
33:33:33:33:33:33 = 192.168.1.103 `old-laptop`
```
The LookAround client uses IP multicast to find LookAround servers within the
same multicast domain.
LookAround is a Rust program for looking up your computers' MAC and IP addresses
within a LAN. There's no central server, so it's not a look-up, it's a look-around.
MAC addresses change slower than IP addresses, so if you know that
`11:11:11:11:11:11` is your laptop, and your laptop is running LookAround,
LookAround will find the IP for you.
The client uses IP multicast to find servers within the
same multicast domain, similar to Avahi and Bonjour.
Systems self-identify by MAC address and nicknames. Public keys with
TOFU semantics are intended before v1.0.0.
## Installation
@ -57,7 +56,7 @@ systemctl --user enable lookaround
Run the server manually: (If you haven't installed it with systemd yet)
```bash
lookaround server
lookaround server --nickname my-desktop
```
Run a client to ping all servers in the same multi-cast domain:
@ -66,6 +65,12 @@ Run a client to ping all servers in the same multi-cast domain:
lookaround client
```
Check which IP addresses LookAround will auto-detect:
```bash
lookaround my-ips
```
## Contributing
Pull requests are welcome. This is a hobby project, so I may reject
contributions that are too big to review.

View File

@ -30,7 +30,9 @@ pub async fn client <I : Iterator <Item=String>> (mut args: I) -> Result <(), Ap
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, 0)).await?;
for bind_addr in bind_addrs {
socket.join_multicast_v4 (common_params.multicast_addr, bind_addr)?;
if let Err (e) = socket.join_multicast_v4 (common_params.multicast_addr, bind_addr) {
println! ("Error joining multicast group with iface {}: {:?}", bind_addr, e);
}
}
let mut idem_id = [0u8; 8];

View File

@ -15,7 +15,9 @@ pub async fn server <I: Iterator <Item=String>> (args: I) -> Result <(), AppErro
let socket = UdpSocket::bind (SocketAddrV4::new (Ipv4Addr::UNSPECIFIED, params.common.server_port)).await?;
for bind_addr in &params.bind_addrs {
socket.join_multicast_v4 (params.common.multicast_addr, *bind_addr)?;
if let Err (e) = socket.join_multicast_v4 (params.common.multicast_addr, *bind_addr) {
println! ("Error joining multicast group with iface {}: {:?}", bind_addr, e);
}
}
serve_interface (params, socket).await?;