]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - net/sctp/output.c
sctp: add dst_pending_confirm flag
[mirror_ubuntu-zesty-kernel.git] / net / sctp / output.c
index f5320a87341e160d46b1160edf4c38b569e7e79b..116488a2b574e893a1d35f6029d79cbf2cd3f2ca 100644 (file)
@@ -550,6 +550,7 @@ 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;
+       int confirm;
        struct dst_entry *dst;
        struct sk_buff *head;
        struct sctphdr *sh;
@@ -628,7 +629,14 @@ int sctp_packet_transmit(struct sctp_packet *packet, gfp_t gfp)
                        asoc->peer.last_sent_to = tp;
        }
        head->ignore_df = packet->ipfragok;
-       tp->af_specific->sctp_xmit(head, tp);
+       confirm = tp->dst_pending_confirm;
+       if (confirm)
+               skb_set_dst_pending_confirm(head, 1);
+       /* neighbour should be confirmed on successful transmission or
+        * positive error
+        */
+       if (tp->af_specific->sctp_xmit(head, tp) >= 0 && confirm)
+               tp->dst_pending_confirm = 0;
 
 out:
        list_for_each_entry_safe(chunk, tmp, &packet->chunk_list, list) {