X-Git-Url: https://bbs.cooldavid.org/git/?a=blobdiff_plain;f=include%2Fnet%2Froute.h;h=b8c1f7703fc6d7695ed0eba73552ffd349e7b484;hb=5811662b15db018c740c57d037523683fd3e6123;hp=7e5e73bfa4dec8e2d45c834507f74d86484b8715;hpb=e4c5bf8e3dca827a1b3a6fac494eae8c74b7e1e7;p=net-next-2.6.git diff --git a/include/net/route.h b/include/net/route.h index 7e5e73bfa4d..b8c1f7703fc 100644 --- a/include/net/route.h +++ b/include/net/route.h @@ -55,8 +55,6 @@ struct rtable { /* Cache lookup keys */ struct flowi fl; - struct in_device *idev; - int rt_genid; unsigned rt_flags; __u16 rt_type; @@ -73,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; @@ -161,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst, { struct flowi fl = { .oif = oif, .mark = sk->sk_mark, - .nl_u = { .ip4_u = { .daddr = dst, - .saddr = src, - .tos = tos } }, + .fl4_dst = dst, + .fl4_src = src, + .fl4_tos = tos, .proto = protocol, - .uli_u = { .ports = - { .sport = sport, - .dport = dport } } }; - + .fl_ip_sport = sport, + .fl_ip_dport = dport }; int err; struct net *net = sock_net(sk);