*** input.c@@/main/1	2011-04-08 16:37:40.000000000 +0530
--- input.c@@/main/4	2011-04-13 14:52:24.000000000 +0530
***************
*** 32,37 ****
--- 32,38 ----
   *    lksctp developers <lksctp-developers@lists.sourceforge.net>
   *
   * Or submit a bug report through the following website:
+  *    http:/www.sf.net/projects/lksctp
   *
   * Written or modified by:
   *    La Monte H.P. Yarroll <piggy@acm.org>
***************
*** 128,133 ****
--- 129,145 ----
  	int family;
  	struct sctp_af *af;
  
+ 	if(unlikely(skb->sk)) {
+ 
+                 struct sock* sk;
+                 if(skb->sk != NULL)
+                         sk = skb->sk;
+ 
+                 skb->destructor = NULL;
+                 skb->sk = NULL;
+          }
+ 
  	if (skb->pkt_type!=PACKET_HOST)
  		goto discard_it;
  
***************
*** 745,751 ****
  }
  
  /* Look up an endpoint. */
! static struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr)
  {
  	struct sctp_hashbucket *head;
  	struct sctp_ep_common *epb;
--- 757,763 ----
  }
  
  /* Look up an endpoint. */
! struct sctp_endpoint *__sctp_rcv_lookup_endpoint(const union sctp_addr *laddr)
  {
  	struct sctp_hashbucket *head;
  	struct sctp_ep_common *epb;
***************
*** 770,775 ****
--- 782,789 ----
  	return ep;
  }
  
+ EXPORT_SYMBOL_GPL(__sctp_rcv_lookup_endpoint);
+ 
  /* Insert association into the hash table.  */
  static void __sctp_hash_established(struct sctp_association *asoc)
  {
***************
*** 834,839 ****
--- 848,855 ----
  					const union sctp_addr *peer,
  					struct sctp_transport **pt)
  {
+ 
+ 	
  	struct sctp_hashbucket *head;
  	struct sctp_ep_common *epb;
  	struct sctp_association *asoc;
***************
*** 841,849 ****
--- 857,868 ----
  	struct hlist_node *node;
  	int hash;
  
+ 
  	/* Optimize here for direct hit, only listening connections can
  	 * have wildcards anyways.
  	 */
  	hash = sctp_assoc_hashfn(ntohs(local->v4.sin_port), ntohs(peer->v4.sin_port));
  	head = &sctp_assoc_hashtable[hash];
  	read_lock(&head->lock);
***************
*** 859,864 ****
--- 878,885 ----
  	return NULL;
  
  hit:
+ 
  	*pt = transport;
  	sctp_association_hold(asoc);
  	read_unlock(&head->lock);
***************
*** 887,892 ****
--- 908,915 ----
  	struct sctp_association *asoc;
  	struct sctp_transport *transport;
  
+ 
  	if ((asoc = sctp_lookup_association(laddr, paddr, &transport))) {
  		sctp_association_put(asoc);
  		return 1;
***************
*** 926,931 ****
--- 949,956 ----
  	struct sctp_transport *transport;
  	struct sctp_af *af;
  
+ 
  	ch = (sctp_chunkhdr_t *) skb->data;
  
  	/*
***************
*** 989,994 ****
--- 1014,1021 ----
  	union sctp_addr_param *param;
  	union sctp_addr paddr;
  
+ 
  	/* Skip over the ADDIP header and find the Address parameter */
  	param = (union sctp_addr_param *)(asconf + 1);
  
***************
*** 1021,1026 ****
--- 1048,1055 ----
  	unsigned int chunk_num = 1;
  	__u8 *ch_end;
  
+ 	printk(KERN_INFO "__sctp_rcv_walk_lookup entry");
+ 
  	/* Walk through the chunks looking for AUTH or ASCONF chunks
  	 * to help us find the association.
  	 */
***************
*** 1076,1085 ****
   * include looking inside of INIT/INIT-ACK chunks or after the AUTH
   * chunks.
   */
! static struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb,
  				      const union sctp_addr *laddr,
  				      struct sctp_transport **transportp)
  {
  	sctp_chunkhdr_t *ch;
  
  	ch = (sctp_chunkhdr_t *) skb->data;
--- 1105,1131 ----
   * include looking inside of INIT/INIT-ACK chunks or after the AUTH
   * chunks.
   */
! struct sctp_association *__sctp_rcv_lookup_harder(struct sk_buff *skb,
  				      const union sctp_addr *laddr,
  				      struct sctp_transport **transportp)
  {
+ 
+ 
+ 	if(unlikely(skb->sk)) {
+ 
+ 		struct sock* sk;
+ 		if(skb->sk != NULL)
+                 	sk = skb->sk;
+ 
+                 skb->destructor = NULL;
+                 skb->sk = NULL;
+          }
+ 
+ 	else{
+ 
+ 
  	sctp_chunkhdr_t *ch;
  
  	ch = (sctp_chunkhdr_t *) skb->data;
***************
*** 1104,1119 ****
--- 1150,1185 ----
  		break;
  	}
  
+ 	}
+ 
  
  	return NULL;
  }
  
+ EXPORT_SYMBOL_GPL(__sctp_rcv_lookup_harder);
+ 
  /* Lookup an association for an inbound skb. */
  static struct sctp_association *__sctp_rcv_lookup(struct sk_buff *skb,
  				      const union sctp_addr *paddr,
  				      const union sctp_addr *laddr,
  				      struct sctp_transport **transportp)
  {
+ 
+ 
+ 	if(unlikely(skb->sk)) {
+ 
+                 struct sock* sk;
+ 		if(skb->sk != NULL)
+                 	sk = skb->sk;
+ 
+                 skb->destructor = NULL;
+                 skb->sk = NULL;
+ 		
+          }
+ 
+ 
  	struct sctp_association *asoc;
  
  	asoc = __sctp_lookup_association(laddr, paddr, transportp);
***************
*** 1124,1129 ****
--- 1190,1196 ----
  	 */
  	if (!asoc)
  		asoc = __sctp_rcv_lookup_harder(skb, laddr, transportp);
+ 	
  
  	return asoc;
  }
