66a71dd1f7
This patch is based on Dmitry Torokhov's patch with some modifications and cleanups. Signed-off-by: Corentin Chary <corentincj@iksaif.net>