aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 18:50:32 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 18:50:32 -0400
commit06dbbfef8296d6dc23e5d8030a0e8e7b20df3b7c (patch)
tree9f93c1a56082d80e5741bb2a231e93314efbcd7e /net/sctp
parent22fa8d59be28affbecc6ae87abf528aebeebff24 (diff)
parent03cf786c4e83dba404ad23ca58f49147ae52dffd (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: [IPV4]: Explicitly call fib_get_table() in fib_frontend.c [NET]: Use BUILD_BUG_ON in net/core/flowi.c [NET]: Remove in-code externs for some functions from net/core/dev.c [NET]: Don't declare extern variables in net/core/sysctl_net_core.c [TCP]: Remove unneeded implicit type cast when calling tcp_minshall_update() [NET]: Treat the sign of the result of skb_headroom() consistently [9P]: Fix missing unlock before return in p9_mux_poll_start [PKT_SCHED]: Fix sch_prio.c build with CONFIG_NETDEVICES_MULTIQUEUE [IPV4] ip_gre: sendto/recvfrom NBMA address [SCTP]: Consolidate sctp_ulpq_renege_xxx functions [NETLINK]: Fix ACK processing after netlink_dump_start [VLAN]: MAINTAINERS update [DCCP]: Implement SIOCINQ/FIONREAD [NET]: Validate device addr prior to interface-up
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/ulpqueue.c34
1 files changed, 10 insertions, 24 deletions
diff --git a/net/sctp/ulpqueue.c b/net/sctp/ulpqueue.c
index b9370956b187..4be92d0a2cab 100644
--- a/net/sctp/ulpqueue.c
+++ b/net/sctp/ulpqueue.c
@@ -908,8 +908,8 @@ void sctp_ulpq_skip(struct sctp_ulpq *ulpq, __u16 sid, __u16 ssn)
908 return; 908 return;
909} 909}
910 910
911/* Renege 'needed' bytes from the ordering queue. */ 911static __u16 sctp_ulpq_renege_list(struct sctp_ulpq *ulpq,
912static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed) 912 struct sk_buff_head *list, __u16 needed)
913{ 913{
914 __u16 freed = 0; 914 __u16 freed = 0;
915 __u32 tsn; 915 __u32 tsn;
@@ -919,7 +919,7 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
919 919
920 tsnmap = &ulpq->asoc->peer.tsn_map; 920 tsnmap = &ulpq->asoc->peer.tsn_map;
921 921
922 while ((skb = __skb_dequeue_tail(&ulpq->lobby)) != NULL) { 922 while ((skb = __skb_dequeue_tail(list)) != NULL) {
923 freed += skb_headlen(skb); 923 freed += skb_headlen(skb);
924 event = sctp_skb2event(skb); 924 event = sctp_skb2event(skb);
925 tsn = event->tsn; 925 tsn = event->tsn;
@@ -933,30 +933,16 @@ static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
933 return freed; 933 return freed;
934} 934}
935 935
936/* Renege 'needed' bytes from the ordering queue. */
937static __u16 sctp_ulpq_renege_order(struct sctp_ulpq *ulpq, __u16 needed)
938{
939 return sctp_ulpq_renege_list(ulpq, &ulpq->lobby, needed);
940}
941
936/* Renege 'needed' bytes from the reassembly queue. */ 942/* Renege 'needed' bytes from the reassembly queue. */
937static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed) 943static __u16 sctp_ulpq_renege_frags(struct sctp_ulpq *ulpq, __u16 needed)
938{ 944{
939 __u16 freed = 0; 945 return sctp_ulpq_renege_list(ulpq, &ulpq->reasm, needed);
940 __u32 tsn;
941 struct sk_buff *skb;
942 struct sctp_ulpevent *event;
943 struct sctp_tsnmap *tsnmap;
944
945 tsnmap = &ulpq->asoc->peer.tsn_map;
946
947 /* Walk backwards through the list, reneges the newest tsns. */
948 while ((skb = __skb_dequeue_tail(&ulpq->reasm)) != NULL) {
949 freed += skb_headlen(skb);
950 event = sctp_skb2event(skb);
951 tsn = event->tsn;
952
953 sctp_ulpevent_free(event);
954 sctp_tsnmap_renege(tsnmap, tsn);
955 if (freed >= needed)
956 return freed;
957 }
958
959 return freed;
960} 946}
961 947
962/* Partial deliver the first message as there is pressure on rwnd. */ 948/* Partial deliver the first message as there is pressure on rwnd. */