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>
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user