aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-23 10:51:40 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-23 10:51:40 -0400
commitd5a92dd43739f59f77247cfbcbefd229e2948131 (patch)
treea16124c41e4da74c2a5f8edbd278b96e9d295c71 /net
parentd0b72a0817b0164986d35366c8ffe92fd985f713 (diff)
parent4e8a5201506423e0241202de1349422af4260296 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [PKT_SCHED] netem: Orphan SKB when adding to queue. [NET]: kernel-doc fix for sock.h [NET]: Reduce sizeof(struct flowi) by 20 bytes. [IPv6] fib: initialize tb6_lock in common place to give lockdep a key [ATM] nicstar: Fix a bogus casting warning [ATM] firestream: handle thrown error [ATM]: No need to return void [ATM]: handle sysfs errors [DCCP] ipv6: Fix opt_skb leak. [DCCP]: Fix Oops in DCCPv6
Diffstat (limited to 'net')
-rw-r--r--net/atm/atm_sysfs.c15
-rw-r--r--net/dccp/ipv4.c4
-rw-r--r--net/dccp/ipv6.c12
-rw-r--r--net/ipv6/ip6_fib.c9
-rw-r--r--net/sched/sch_netem.c2
5 files changed, 32 insertions, 10 deletions
diff --git a/net/atm/atm_sysfs.c b/net/atm/atm_sysfs.c
index c0a4ae28fcfa..62f6ed1f2f98 100644
--- a/net/atm/atm_sysfs.c
+++ b/net/atm/atm_sysfs.c
@@ -141,7 +141,7 @@ static struct class atm_class = {
141int atm_register_sysfs(struct atm_dev *adev) 141int atm_register_sysfs(struct atm_dev *adev)
142{ 142{
143 struct class_device *cdev = &adev->class_dev; 143 struct class_device *cdev = &adev->class_dev;
144 int i, err; 144 int i, j, err;
145 145
146 cdev->class = &atm_class; 146 cdev->class = &atm_class;
147 class_set_devdata(cdev, adev); 147 class_set_devdata(cdev, adev);
@@ -151,10 +151,19 @@ int atm_register_sysfs(struct atm_dev *adev)
151 if (err < 0) 151 if (err < 0)
152 return err; 152 return err;
153 153
154 for (i = 0; atm_attrs[i]; i++) 154 for (i = 0; atm_attrs[i]; i++) {
155 class_device_create_file(cdev, atm_attrs[i]); 155 err = class_device_create_file(cdev, atm_attrs[i]);
156 if (err)
157 goto err_out;
158 }
156 159
157 return 0; 160 return 0;
161
162err_out:
163 for (j = 0; j < i; j++)
164 class_device_remove_file(cdev, atm_attrs[j]);
165 class_device_del(cdev);
166 return err;
158} 167}
159 168
160void atm_unregister_sysfs(struct atm_dev *adev) 169void atm_unregister_sysfs(struct atm_dev *adev)
diff --git a/net/dccp/ipv4.c b/net/dccp/ipv4.c
index 7e746c4c1688..aaaf4d09516b 100644
--- a/net/dccp/ipv4.c
+++ b/net/dccp/ipv4.c
@@ -449,6 +449,8 @@ static inline u64 dccp_v4_init_sequence(const struct sock *sk,
449 dccp_hdr(skb)->dccph_sport); 449 dccp_hdr(skb)->dccph_sport);
450} 450}
451 451
452static struct request_sock_ops dccp_request_sock_ops;
453
452int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb) 454int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
453{ 455{
454 struct inet_request_sock *ireq; 456 struct inet_request_sock *ireq;
@@ -489,7 +491,7 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
489 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) 491 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
490 goto drop; 492 goto drop;
491 493
492 req = reqsk_alloc(sk->sk_prot->rsk_prot); 494 req = reqsk_alloc(&dccp_request_sock_ops);
493 if (req == NULL) 495 if (req == NULL)
494 goto drop; 496 goto drop;
495 497
diff --git a/net/dccp/ipv6.c b/net/dccp/ipv6.c
index 7171a78671aa..c8bf89bfb088 100644
--- a/net/dccp/ipv6.c
+++ b/net/dccp/ipv6.c
@@ -672,7 +672,6 @@ static struct sock *dccp_v6_hnd_req(struct sock *sk,struct sk_buff *skb)
672 672
673static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb) 673static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
674{ 674{
675 struct inet_request_sock *ireq;
676 struct dccp_sock dp; 675 struct dccp_sock dp;
677 struct request_sock *req; 676 struct request_sock *req;
678 struct dccp_request_sock *dreq; 677 struct dccp_request_sock *dreq;
@@ -701,7 +700,7 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
701 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1) 700 if (sk_acceptq_is_full(sk) && inet_csk_reqsk_queue_young(sk) > 1)
702 goto drop; 701 goto drop;
703 702
704 req = inet6_reqsk_alloc(sk->sk_prot->rsk_prot); 703 req = inet6_reqsk_alloc(&dccp6_request_sock_ops);
705 if (req == NULL) 704 if (req == NULL)
706 goto drop; 705 goto drop;
707 706
@@ -713,7 +712,6 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
713 goto drop_and_free; 712 goto drop_and_free;
714 713
715 ireq6 = inet6_rsk(req); 714 ireq6 = inet6_rsk(req);
716 ireq = inet_rsk(req);
717 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr); 715 ipv6_addr_copy(&ireq6->rmt_addr, &skb->nh.ipv6h->saddr);
718 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr); 716 ipv6_addr_copy(&ireq6->loc_addr, &skb->nh.ipv6h->daddr);
719 req->rcv_wnd = dccp_feat_default_sequence_window; 717 req->rcv_wnd = dccp_feat_default_sequence_window;
@@ -997,6 +995,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
997 if (sk->sk_state == DCCP_OPEN) { /* Fast path */ 995 if (sk->sk_state == DCCP_OPEN) { /* Fast path */
998 if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len)) 996 if (dccp_rcv_established(sk, skb, dccp_hdr(skb), skb->len))
999 goto reset; 997 goto reset;
998 if (opt_skb) {
999 /* This is where we would goto ipv6_pktoptions. */
1000 __kfree_skb(opt_skb);
1001 }
1000 return 0; 1002 return 0;
1001 } 1003 }
1002 1004
@@ -1021,6 +1023,10 @@ static int dccp_v6_do_rcv(struct sock *sk, struct sk_buff *skb)
1021 1023
1022 if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len)) 1024 if (dccp_rcv_state_process(sk, skb, dccp_hdr(skb), skb->len))
1023 goto reset; 1025 goto reset;
1026 if (opt_skb) {
1027 /* This is where we would goto ipv6_pktoptions. */
1028 __kfree_skb(opt_skb);
1029 }
1024 return 0; 1030 return 0;
1025 1031
1026reset: 1032reset:
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 8fcae7a6510b..f98ca30d7c1f 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -169,7 +169,6 @@ static __inline__ void rt6_release(struct rt6_info *rt)
169 169
170static struct fib6_table fib6_main_tbl = { 170static struct fib6_table fib6_main_tbl = {
171 .tb6_id = RT6_TABLE_MAIN, 171 .tb6_id = RT6_TABLE_MAIN,
172 .tb6_lock = RW_LOCK_UNLOCKED,
173 .tb6_root = { 172 .tb6_root = {
174 .leaf = &ip6_null_entry, 173 .leaf = &ip6_null_entry,
175 .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, 174 .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -187,6 +186,12 @@ static void fib6_link_table(struct fib6_table *tb)
187{ 186{
188 unsigned int h; 187 unsigned int h;
189 188
189 /*
190 * Initialize table lock at a single place to give lockdep a key,
191 * tables aren't visible prior to being linked to the list.
192 */
193 rwlock_init(&tb->tb6_lock);
194
190 h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1); 195 h = tb->tb6_id & (FIB_TABLE_HASHSZ - 1);
191 196
192 /* 197 /*
@@ -199,7 +204,6 @@ static void fib6_link_table(struct fib6_table *tb)
199#ifdef CONFIG_IPV6_MULTIPLE_TABLES 204#ifdef CONFIG_IPV6_MULTIPLE_TABLES
200static struct fib6_table fib6_local_tbl = { 205static struct fib6_table fib6_local_tbl = {
201 .tb6_id = RT6_TABLE_LOCAL, 206 .tb6_id = RT6_TABLE_LOCAL,
202 .tb6_lock = RW_LOCK_UNLOCKED,
203 .tb6_root = { 207 .tb6_root = {
204 .leaf = &ip6_null_entry, 208 .leaf = &ip6_null_entry,
205 .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO, 209 .fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO,
@@ -213,7 +217,6 @@ static struct fib6_table *fib6_alloc_table(u32 id)
213 table = kzalloc(sizeof(*table), GFP_ATOMIC); 217 table = kzalloc(sizeof(*table), GFP_ATOMIC);
214 if (table != NULL) { 218 if (table != NULL) {
215 table->tb6_id = id; 219 table->tb6_id = id;
216 table->tb6_lock = RW_LOCK_UNLOCKED;
217 table->tb6_root.leaf = &ip6_null_entry; 220 table->tb6_root.leaf = &ip6_null_entry;
218 table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO; 221 table->tb6_root.fn_flags = RTN_ROOT | RTN_TL_ROOT | RTN_RTINFO;
219 } 222 }
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 45939bafbdf8..ef8874babf6a 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -170,6 +170,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
170 return NET_XMIT_BYPASS; 170 return NET_XMIT_BYPASS;
171 } 171 }
172 172
173 skb_orphan(skb);
174
173 /* 175 /*
174 * If we need to duplicate packet, then re-insert at top of the 176 * If we need to duplicate packet, then re-insert at top of the
175 * qdisc tree, since parent queuer expects that only one 177 * qdisc tree, since parent queuer expects that only one