This patch replaces the current hack with a better version of the RFC patch has been accepted upstream. Signed-off-by: Christian Lamparter <chunkeey@gmail.com>