sctp: support for sending packet over udp4 sock
[linux-2.6-microblaze.git] / net / sctp / output.c
index fb16500..6614c9f 100644 (file)
@@ -514,8 +514,8 @@ merge:
        if (sctp_checksum_disable)
                return 1;
 
-       if (!(skb_dst(head)->dev->features & NETIF_F_SCTP_CRC) ||
-           dst_xfrm(skb_dst(head)) || packet->ipfragok) {
+       if (!(tp->dst->dev->features & NETIF_F_SCTP_CRC) ||
+           dst_xfrm(tp->dst) || packet->ipfragok || tp->encap_port) {
                struct sctphdr *sh =
                        (struct sctphdr *)skb_transport_header(head);
 
@@ -542,7 +542,6 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
        struct sctp_association *asoc = tp->asoc;
        struct sctp_chunk *chunk, *tmp;
        int pkt_count, gso = 0;
-       struct dst_entry *dst;
        struct sk_buff *head;
        struct sctphdr *sh;
        struct sock *sk;
@@ -579,13 +578,11 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
        sh->checksum = 0;
 
        /* drop packet if no dst */
-       dst = dst_clone(tp->dst);
-       if (!dst) {
+       if (!tp->dst) {
                IP_INC_STATS(sock_net(sk), IPSTATS_MIB_OUTNOROUTES);
                kfree_skb(head);
                goto out;
        }
-       skb_dst_set(head, dst);
 
        rcu_read_lock();
        if (__sk_dst_get(sk) != tp->dst) {