]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/ipv4/ip_sockglue.c
[IPV4]: Add 'rtable' field in struct sk_buff to alias 'dst' and avoid casts
[net-next-2.6.git] / net / ipv4 / ip_sockglue.c
index 754b0a5bbfe9b225a52041b7a4ced135fded0afe..e7c9e4e72327e7649f6ffe9b567eaa4bc69dff5c 100644 (file)
@@ -57,7 +57,7 @@
 static void ip_cmsg_recv_pktinfo(struct msghdr *msg, struct sk_buff *skb)
 {
        struct in_pktinfo info;
-       struct rtable *rt = (struct rtable *)skb->dst;
+       struct rtable *rt = skb->rtable;
 
        info.ipi_addr.s_addr = ip_hdr(skb)->daddr;
        if (rt) {
@@ -514,11 +514,6 @@ static int do_ip_setsockopt(struct sock *sk, int level,
                        val &= ~3;
                        val |= inet->tos & 3;
                }
-               if (IPTOS_PREC(val) >= IPTOS_PREC_CRITIC_ECP &&
-                   !capable(CAP_NET_ADMIN)) {
-                       err = -EPERM;
-                       break;
-               }
                if (inet->tos != val) {
                        inet->tos = val;
                        sk->sk_priority = rt_tos2priority(val);