--- zzzz-none-000/linux-2.6.19.2/include/net/sock.h 2007-01-10 19:10:37.000000000 +0000 +++ davinci-8020-5505/linux-2.6.19.2/include/net/sock.h 2008-02-20 09:56:11.000000000 +0000 @@ -251,6 +251,7 @@ __u32 sk_sndmsg_off; int sk_write_pending; void *sk_security; + unsigned long sk_tc_index; void (*sk_state_change)(struct sock *sk); void (*sk_data_ready)(struct sock *sk, int bytes); void (*sk_write_space)(struct sock *sk); @@ -452,6 +453,7 @@ static inline void sk_stream_set_owner_r(struct sk_buff *skb, struct sock *sk) { + skb_orphan(skb); skb->sk = sk; skb->destructor = sk_stream_rfree; atomic_add(skb->truesize, &sk->sk_rmem_alloc); @@ -883,23 +885,18 @@ } /** - * sk_filter_rcu_free: Free a socket filter - * @rcu: rcu_head that contains the sk_filter to free + * sk_filter_release: Release a socket filter + * @rcu: rcu_head that contains the sk_filter info to remove + * + * Remove a filter from a socket and release its resources. */ + static inline void sk_filter_rcu_free(struct rcu_head *rcu) { struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); kfree(fp); } -/** - * sk_filter_release: Release a socket filter - * @sk: socket - * @fp: filter to remove - * - * Remove a filter from a socket and release its resources. - */ - static inline void sk_filter_release(struct sock *sk, struct sk_filter *fp) { unsigned int size = sk_filter_len(fp); @@ -1113,11 +1110,15 @@ sock_hold(sk); skb->sk = sk; skb->destructor = sock_wfree; +#ifdef CONFIG_NET_SCHED + skb->tc_index = sk->sk_tc_index; +#endif atomic_add(skb->truesize, &sk->sk_wmem_alloc); } static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk) { + skb_orphan(skb); skb->sk = sk; skb->destructor = sock_rfree; atomic_add(skb->truesize, &sk->sk_rmem_alloc);