We can't have J1939_SOCK_CONNECTED without J1939_SOCK_BOUND. So, it is enough to test for J1939_SOCK_BOUND. Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> --- net/can/j1939/socket.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index 39df867cfe84..89174b517b28 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -253,7 +253,7 @@ static bool j1939_sk_match_filter(struct j1939_sock *jsk, static bool j1939_sk_recv_match_one(struct j1939_sock *jsk, const struct j1939_sk_buff_cb *skcb) { - if (!(jsk->state & (J1939_SOCK_BOUND | J1939_SOCK_CONNECTED))) + if (!(jsk->state & J1939_SOCK_BOUND)) return false; if (skcb->insock == &jsk->sk && !(jsk->state & J1939_SOCK_RECV_OWN)) -- 2.20.1