Commit e5df0765 authored by Pavel Emelyanov's avatar Pavel Emelyanov

net: Do not fail on absent rules image and fail on bad one

Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c9afd17a
...@@ -696,12 +696,14 @@ static inline int restore_rule(int pid) ...@@ -696,12 +696,14 @@ static inline int restore_rule(int pid)
int ret = 0; int ret = 0;
img = open_image(CR_FD_RULE, O_RSTR, pid); img = open_image(CR_FD_RULE, O_RSTR, pid);
if (!img) if (!img) {
goto out;
if (empty_image(img)) {
ret = -1; ret = -1;
goto close; goto out;
} }
if (empty_image(img))
goto close;
/* /*
* Delete 3 default rules to prevent duplicates. See kernel's * Delete 3 default rules to prevent duplicates. See kernel's
* function fib_default_rules_init() for the details. * function fib_default_rules_init() for the details.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment