pkt_sched: pedit use proper struct
[safe/jmp/linux-2.6] / net / ipv6 / ip6_output.c
index dd1a980..cd48801 100644 (file)
@@ -194,7 +194,8 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
        struct ipv6hdr *hdr;
        u8  proto = fl->proto;
        int seg_len = skb->len;
-       int hlimit, tclass;
+       int hlimit = -1;
+       int tclass = 0;
        u32 mtu;
 
        if (opt) {
@@ -237,19 +238,13 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
        /*
         *      Fill in the IPv6 header
         */
-
-       hlimit = -1;
-       if (np)
+       if (np) {
+               tclass = np->tclass;
                hlimit = np->hop_limit;
+       }
        if (hlimit < 0)
                hlimit = ip6_dst_hoplimit(dst);
 
-       tclass = -1;
-       if (np)
-               tclass = np->tclass;
-       if (tclass < 0)
-               tclass = 0;
-
        *(__be32 *)hdr = htonl(0x60000000 | (tclass << 20)) | fl->fl6_flowlabel;
 
        hdr->payload_len = htons(seg_len);
@@ -1474,7 +1469,6 @@ int ip6_push_pending_frames(struct sock *sk)
                skb->len += tmp_skb->len;
                skb->data_len += tmp_skb->len;
                skb->truesize += tmp_skb->truesize;
-               __sock_put(tmp_skb->sk);
                tmp_skb->destructor = NULL;
                tmp_skb->sk = NULL;
        }
@@ -1517,7 +1511,7 @@ int ip6_push_pending_frames(struct sock *sk)
        err = ip6_local_out(skb);
        if (err) {
                if (err > 0)
-                       err = np->recverr ? net_xmit_errno(err) : 0;
+                       err = net_xmit_errno(err);
                if (err)
                        goto error;
        }
@@ -1526,6 +1520,7 @@ out:
        ip6_cork_release(inet, np);
        return err;
 error:
+       IP6_INC_STATS(net, rt->rt6i_idev, IPSTATS_MIB_OUTDISCARDS);
        goto out;
 }