From 454829379951cb15d03d7e51ff292addde8548df Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 14 Aug 2016 02:08:56 +0200 Subject: libiproute: eliminate some redundant zero stores function old new delta do_iprule 974 955 -19 rtnl_dump_request 173 146 -27 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 0/2 up/down: 0/-46) Total: -46 bytes Signed-off-by: Denys Vlasenko --- networking/libiproute/iprule.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'networking/libiproute/iprule.c') diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index dba6434..c486834 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; -- cgit v1.1