replace with upstream patch

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>
add patches from master

Signed-off-by: Vasiliy Tolstov <v.tolstov@selfip.ru>