From c753796769e4fb0cd813b6e5801b3c01f4681d4f Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 11 Nov 2010 17:07:48 -0800 Subject: 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 --- include/net/dn_route.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/net/dn_route.h') diff --git a/include/net/dn_route.h b/include/net/dn_route.h index ccadab3aa3f6..9b185df265fb 100644 --- a/include/net/dn_route.h +++ b/include/net/dn_route.h @@ -80,6 +80,16 @@ struct dn_route { unsigned rt_type; }; +static inline bool dn_is_input_route(struct dn_route *rt) +{ + return rt->fl.iif != 0; +} + +static inline bool dn_is_output_route(struct dn_route *rt) +{ + return rt->fl.iif == 0; +} + extern void dn_route_init(void); extern void dn_route_cleanup(void); -- cgit v1.2.3