Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a64830af0fd4dbec908cfbab117def5086acd4a
Commit:     4a64830af0fd4dbec908cfbab117def5086acd4a
Parent:     efe9f68afeaf2ce12636990a8c811fb1cc23b12b
Author:     Patrick McHardy <[EMAIL PROTECTED]>
AuthorDate: Mon Jan 14 23:47:25 2008 -0800
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Mon Jan 28 15:02:37 2008 -0800

    [NETFILTER]: nf_conntrack_sctp: don't take sctp_lock once per chunk
    
    Don't take and release the lock once per SCTP chunk, simply hold it
    the entire time while iterating through the chunks.
    
    Signed-off-by: Patrick McHardy <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/netfilter/nf_conntrack_proto_sctp.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/net/netfilter/nf_conntrack_proto_sctp.c 
b/net/netfilter/nf_conntrack_proto_sctp.c
index 7baabc0..177e8f6 100644
--- a/net/netfilter/nf_conntrack_proto_sctp.c
+++ b/net/netfilter/nf_conntrack_proto_sctp.c
@@ -325,9 +325,8 @@ static int sctp_packet(struct nf_conn *ct,
        }
 
        old_state = new_state = SCTP_CONNTRACK_MAX;
+       write_lock_bh(&sctp_lock);
        for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) {
-               write_lock_bh(&sctp_lock);
-
                /* Special cases of Verification tag check (Sec 8.5.1) */
                if (sch->type == SCTP_CID_INIT) {
                        /* Sec 8.5.1 (A) */
@@ -378,8 +377,8 @@ static int sctp_packet(struct nf_conn *ct,
                ct->proto.sctp.state = new_state;
                if (old_state != new_state)
                        nf_conntrack_event_cache(IPCT_PROTOINFO, skb);
-               write_unlock_bh(&sctp_lock);
        }
+       write_unlock_bh(&sctp_lock);
 
        nf_ct_refresh_acct(ct, ctinfo, skb, *sctp_timeouts[new_state]);
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to