diff options
author | David S. Miller <davem@davemloft.net> | 2010-11-12 01:07:48 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-12 01:07:48 (GMT) |
commit | c753796769e4fb0cd813b6e5801b3c01f4681d4f (patch) | |
tree | f137ec0b76593a2aa1a6a263bcc1e4cf82bdf7b5 /include/net/route.h | |
parent | ed1deb7021b4dfee1d544b91edff4ef92f5c3b54 (diff) | |
download | linux-fsl-qoriq-c753796769e4fb0cd813b6e5801b3c01f4681d4f.tar.xz |
ipv4: Make rt->fl.iif tests lest obscure.
When we test rt->fl.iif against zero, we're seeing if it's
an output or an input route.
Make that explicit with some helper functions.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/route.h')
-rw-r--r-- | include/net/route.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/route.h b/include/net/route.h index cea533e..5cd46d1 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -71,6 +71,16 @@ struct rtable { struct inet_peer *peer; /* long-living peer info */ }; +static inline bool rt_is_input_route(struct rtable *rt) +{ + return rt->fl.iif != 0; +} + +static inline bool rt_is_output_route(struct rtable *rt) +{ + return rt->fl.iif == 0; +} + struct ip_rt_acct { __u32 o_bytes; __u32 o_packets; |