diff options
Diffstat (limited to 'net/can/isotp.c')
-rw-r--r-- | net/can/isotp.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/can/isotp.c b/net/can/isotp.c index 2caeeae8ec16..4a4007f10970 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1232,6 +1232,11 @@ static int isotp_bind(struct socket *sock, struct sockaddr *uaddr, int len) else rx_id &= CAN_SFF_MASK; + /* give feedback on wrong CAN-ID values */ + if (tx_id != addr->can_addr.tp.tx_id || + rx_id != addr->can_addr.tp.rx_id) + return -EINVAL; + if (!addr->can_ifindex) return -ENODEV; |