Fix reconnection

Was failing to reconnect due to trying to reuse the same socket that
already had a BPF filter on it.
This commit is contained in:
2026-01-24 19:19:00 -05:00
parent c3b17f8267
commit 09152377ed
5 changed files with 20 additions and 15 deletions

View File

@@ -92,7 +92,10 @@ pub fn connect(self: Client, io: Io, payload: []const u8) !SaprusConnection {
};
log.debug("Setting bpf filter to port {}", .{connection.connection.src});
try self.socket.attachSaprusPortFilter(connection.connection.src);
self.socket.attachSaprusPortFilter(connection.connection.src) catch |err| {
log.err("Failed to set port filter: {t}", .{err});
return err;
};
log.debug("bpf set", .{});
var connection_buf: [2048]u8 = undefined;