diff --git a/net/can/isotp.c b/net/can/isotp.c index 8bd565f2073e..a9b96a6e6317 100644 --- a/net/can/isotp.c +++ b/net/can/isotp.c @@ -1212,7 +1212,8 @@ static int isotp_setsockopt(struct socket *sock, int level, int optname, if (ll.mtu != CAN_MTU && ll.mtu != CANFD_MTU) return -EINVAL; - if (ll.mtu == CAN_MTU && ll.tx_dl > CAN_MAX_DLEN) + if (ll.mtu == CAN_MTU && + (ll.tx_dl > CAN_MAX_DLEN || ll.tx_flags != 0)) return -EINVAL; memcpy(&so->ll, &ll, sizeof(ll));