Skip to content

Commit 4d0534a

Browse files
committed
wireguardif: Fix output filter error path.
1 parent 83985ec commit 4d0534a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/wireguardif.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,11 @@ static err_t wireguardif_output(struct netif *netif, struct pbuf *q, const ip4_a
205205
ip_addr_copy_from_ip4(ipaddr, *ip4addr);
206206
struct wireguard_peer *peer = peer_lookup_by_allowed_ip(device, &ipaddr);
207207
if (peer) {
208-
if (device->out_filter_fn == NULL || device->out_filter_fn(q) == 0) {
209-
return wireguardif_output_to_peer(netif, q, &ipaddr, peer);
208+
int filter_err = device->out_filter_fn == NULL ? 0 : device->out_filter_fn(q);
209+
if (filter_err != 0) {
210+
return filter_err;
210211
}
212+
return wireguardif_output_to_peer(netif, q, &ipaddr, peer);
211213
} else {
212214
return ERR_RTE;
213215
}

0 commit comments

Comments
 (0)