net: Kill skb_truesize_check(), it only catches false-positives.
[safe/jmp/linux-2.6] / include / net / route.h
index 1985d82..4e8cae0 100644 (file)
 #include <net/dst.h>
 #include <net/inetpeer.h>
 #include <net/flow.h>
+#include <net/inet_sock.h>
 #include <linux/in_route.h>
 #include <linux/rtnetlink.h>
 #include <linux/route.h>
 #include <linux/ip.h>
 #include <linux/cache.h>
 #include <linux/security.h>
-#include <net/sock.h>
 
 #ifndef __KERNEL__
 #warning This file is not supposed to be used outside of kernel.
@@ -61,6 +61,7 @@ struct rtable
 
        struct in_device        *idev;
        
+       int                     rt_genid;
        unsigned                rt_flags;
        __u16                   rt_type;
 
@@ -110,12 +111,12 @@ struct in_device;
 extern int             ip_rt_init(void);
 extern void            ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
                                       __be32 src, struct net_device *dev);
-extern void            rt_cache_flush(int how);
+extern void            rt_cache_flush(struct net *net, int how);
 extern int             __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
 extern int             ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
 extern int             ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
 extern int             ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
-extern unsigned short  ip_rt_frag_needed(struct iphdr *iph, unsigned short new_mtu);
+extern unsigned short  ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
 extern void            ip_rt_send_redirect(struct sk_buff *skb);
 
 extern unsigned                inet_addr_type(struct net *net, __be32 addr);
@@ -149,6 +150,7 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
                                   int flags)
 {
        struct flowi fl = { .oif = oif,
+                           .mark = sk->sk_mark,
                            .nl_u = { .ip4_u = { .daddr = dst,
                                                 .saddr = src,
                                                 .tos   = tos } },
@@ -158,7 +160,11 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
                                         .dport = dport } } };
 
        int err;
-       struct net *net = sk->sk_net;
+       struct net *net = sock_net(sk);
+
+       if (inet_sk(sk)->transparent)
+               fl.flags |= FLOWI_FLAG_ANYSRC;
+
        if (!dst || !src) {
                err = __ip_route_output_key(net, rp, &fl);
                if (err)
@@ -186,7 +192,7 @@ static inline int ip_route_newports(struct rtable **rp, u8 protocol,
                ip_rt_put(*rp);
                *rp = NULL;
                security_sk_classify_flow(sk, &fl);
-               return ip_route_output_flow(sk->sk_net, rp, &fl, sk, 0);
+               return ip_route_output_flow(sock_net(sk), rp, &fl, sk, 0);
        }
        return 0;
 }
@@ -202,6 +208,9 @@ static inline struct inet_peer *rt_get_peer(struct rtable *rt)
        return rt->peer;
 }
 
-extern ctl_table ipv4_route_table[];
+static inline int inet_iif(const struct sk_buff *skb)
+{
+       return skb->rtable->rt_iif;
+}
 
 #endif /* _ROUTE_H */