[PATCH v1 06/25] j1939: socket: use pgn set by bind as rx filter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/socket.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c
index f19f21a62ffb..a58caf355279 100644
--- a/net/can/j1939/socket.c
+++ b/net/can/j1939/socket.c
@@ -143,6 +143,10 @@ static void j1939_sk_recv_one(struct j1939_sock *jsk, struct sk_buff *oskb)
 			    oskcb->addr.da != jsk->addr.sa)
 				return;
 		}
+
+		if (j1939_pgn_is_valid(jsk->pgn_rx_filter) &&
+		    jsk->pgn_rx_filter != oskcb->addr.dst_pgn)
+			return;
 	}
 
 	if (oskcb->insock == &jsk->sk && !(jsk->state & J1939_SOCK_RECV_OWN))
-- 
2.20.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux