aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/iprule.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/iprule.c')
-rw-r--r--networking/libiproute/iprule.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c
index dba64346f..c486834b0 100644
--- a/networking/libiproute/iprule.c
+++ b/networking/libiproute/iprule.c
@@ -197,9 +197,11 @@ static int iprule_modify(int cmd, char **argv)
req.n.nlmsg_flags = NLM_F_REQUEST;
req.r.rtm_family = preferred_family;
req.r.rtm_protocol = RTPROT_BOOT;
- req.r.rtm_scope = RT_SCOPE_UNIVERSE;
- req.r.rtm_table = 0;
- req.r.rtm_type = RTN_UNSPEC;
+ if (RT_SCOPE_UNIVERSE != 0)
+ req.r.rtm_scope = RT_SCOPE_UNIVERSE;
+ /*req.r.rtm_table = 0; - already is */
+ if (RTN_UNSPEC != 0)
+ req.r.rtm_type = RTN_UNSPEC;
if (cmd == RTM_NEWRULE) {
req.n.nlmsg_flags |= NLM_F_CREATE|NLM_F_EXCL;