]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/inet6_connection_sock.c
[MLSXFRM]: Add flow labeling
[linux-2.6-omap-h63xx.git] / net / ipv6 / inet6_connection_sock.c
index f8f3a37a14948f4d291ba85cac267b33ebdf3079..7a51a258615d515ac1d5d4abfafbce60fc4ca81a 100644 (file)
@@ -13,7 +13,6 @@
  *             2 of the License, or(at your option) any later version.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/in6.h>
 #include <linux/ipv6.h>
@@ -158,6 +157,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
        fl.oif = sk->sk_bound_dev_if;
        fl.fl_ip_sport = inet->sport;
        fl.fl_ip_dport = inet->dport;
+       security_sk_classify_flow(sk, &fl);
 
        if (np->opt && np->opt->srcrt) {
                struct rt0_hdr *rt0 = (struct rt0_hdr *)np->opt->srcrt;
@@ -173,6 +173,7 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
 
                if (err) {
                        sk->sk_err_soft = -err;
+                       kfree_skb(skb);
                        return err;
                }
 
@@ -181,12 +182,11 @@ int inet6_csk_xmit(struct sk_buff *skb, int ipfragok)
 
                if ((err = xfrm_lookup(&dst, &fl, sk, 0)) < 0) {
                        sk->sk_route_caps = 0;
+                       kfree_skb(skb);
                        return err;
                }
 
-               ip6_dst_store(sk, dst, NULL);
-               sk->sk_route_caps = dst->dev->features &
-                       ~(NETIF_F_IP_CSUM | NETIF_F_TSO);
+               __ip6_dst_store(sk, dst, NULL);
        }
 
        skb->dst = dst_clone(dst);