aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-10-31 03:17:34 -0400
committerDavid S. Miller <davem@davemloft.net>2008-10-31 03:17:34 -0400
commita1744d3bee19d3b9cbfb825ab316a101b9c9f109 (patch)
treec0e2324c09beca0eb5782eb5abf241ea2b7a4a11 /net
parent275f165fa970174f8a98205529750e8abb6c0a33 (diff)
parenta432226614c5616e3cfd211e0acffa0acfb4770c (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/p54/p54common.c
Diffstat (limited to 'net')
-rw-r--r--net/core/net_namespace.c32
-rw-r--r--net/core/pktgen.c27
-rw-r--r--net/ipv4/cipso_ipv4.c7
-rw-r--r--net/mac80211/rc80211_minstrel_debugfs.c6
-rw-r--r--net/netfilter/nf_conntrack_proto_gre.c4
-rw-r--r--net/netlabel/netlabel_addrlist.c2
-rw-r--r--net/netlabel/netlabel_addrlist.h22
-rw-r--r--net/netlabel/netlabel_mgmt.c2
-rw-r--r--net/rfkill/rfkill-input.c5
-rw-r--r--net/sunrpc/auth.c18
-rw-r--r--net/sunrpc/xprtsock.c58
-rw-r--r--net/xfrm/xfrm_policy.c2
12 files changed, 144 insertions, 41 deletions
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
index 861b4cbf40db..55cffad2f328 100644
--- a/net/core/net_namespace.c
+++ b/net/core/net_namespace.c
@@ -324,6 +324,38 @@ void unregister_pernet_subsys(struct pernet_operations *module)
324} 324}
325EXPORT_SYMBOL_GPL(unregister_pernet_subsys); 325EXPORT_SYMBOL_GPL(unregister_pernet_subsys);
326 326
327int register_pernet_gen_subsys(int *id, struct pernet_operations *ops)
328{
329 int rv;
330
331 mutex_lock(&net_mutex);
332again:
333 rv = ida_get_new_above(&net_generic_ids, 1, id);
334 if (rv < 0) {
335 if (rv == -EAGAIN) {
336 ida_pre_get(&net_generic_ids, GFP_KERNEL);
337 goto again;
338 }
339 goto out;
340 }
341 rv = register_pernet_operations(first_device, ops);
342 if (rv < 0)
343 ida_remove(&net_generic_ids, *id);
344 mutex_unlock(&net_mutex);
345out:
346 return rv;
347}
348EXPORT_SYMBOL_GPL(register_pernet_gen_subsys);
349
350void unregister_pernet_gen_subsys(int id, struct pernet_operations *ops)
351{
352 mutex_lock(&net_mutex);
353 unregister_pernet_operations(ops);
354 ida_remove(&net_generic_ids, id);
355 mutex_unlock(&net_mutex);
356}
357EXPORT_SYMBOL_GPL(unregister_pernet_gen_subsys);
358
327/** 359/**
328 * register_pernet_device - register a network namespace device 360 * register_pernet_device - register a network namespace device
329 * @ops: pernet operations structure for the subsystem 361 * @ops: pernet operations structure for the subsystem
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 18dd83c2ead0..fa4973bf73e9 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1972,28 +1972,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev)
1972 1972
1973 /* make sure that we don't pick a non-existing transmit queue */ 1973 /* make sure that we don't pick a non-existing transmit queue */
1974 ntxq = pkt_dev->odev->real_num_tx_queues; 1974 ntxq = pkt_dev->odev->real_num_tx_queues;
1975 if (ntxq <= num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { 1975 if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) {
1976 printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " 1976 printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU "
1977 "disabled because CPU count (%d) exceeds number ", 1977 "disabled because CPU count (%d) exceeds number "
1978 num_online_cpus()); 1978 "of tx queues (%d) on %s\n", num_online_cpus(), ntxq,
1979 printk(KERN_WARNING "pktgen: WARNING: of tx queues " 1979 pkt_dev->odev->name);
1980 "(%d) on %s \n", ntxq, pkt_dev->odev->name);
1981 pkt_dev->flags &= ~F_QUEUE_MAP_CPU; 1980 pkt_dev->flags &= ~F_QUEUE_MAP_CPU;
1982 } 1981 }
1983 if (ntxq <= pkt_dev->queue_map_min) { 1982 if (ntxq <= pkt_dev->queue_map_min) {
1984 printk(KERN_WARNING "pktgen: WARNING: Requested " 1983 printk(KERN_WARNING "pktgen: WARNING: Requested "
1985 "queue_map_min (%d) exceeds number of tx\n", 1984 "queue_map_min (zero-based) (%d) exceeds valid range "
1986 pkt_dev->queue_map_min); 1985 "[0 - %d] for (%d) queues on %s, resetting\n",
1987 printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " 1986 pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq,
1988 "%s, resetting\n", ntxq, pkt_dev->odev->name); 1987 pkt_dev->odev->name);
1989 pkt_dev->queue_map_min = ntxq - 1; 1988 pkt_dev->queue_map_min = ntxq - 1;
1990 } 1989 }
1991 if (ntxq <= pkt_dev->queue_map_max) { 1990 if (pkt_dev->queue_map_max >= ntxq) {
1992 printk(KERN_WARNING "pktgen: WARNING: Requested " 1991 printk(KERN_WARNING "pktgen: WARNING: Requested "
1993 "queue_map_max (%d) exceeds number of tx\n", 1992 "queue_map_max (zero-based) (%d) exceeds valid range "
1994 pkt_dev->queue_map_max); 1993 "[0 - %d] for (%d) queues on %s, resetting\n",
1995 printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " 1994 pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq,
1996 "%s, resetting\n", ntxq, pkt_dev->odev->name); 1995 pkt_dev->odev->name);
1997 pkt_dev->queue_map_max = ntxq - 1; 1996 pkt_dev->queue_map_max = ntxq - 1;
1998 } 1997 }
1999 1998
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 4bcec7f77251..e52799047a5f 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -2062,9 +2062,10 @@ int cipso_v4_skbuff_setattr(struct sk_buff *skb,
2062 u32 opt_len; 2062 u32 opt_len;
2063 int len_delta; 2063 int len_delta;
2064 2064
2065 buf_len = cipso_v4_genopt(buf, buf_len, doi_def, secattr); 2065 ret_val = cipso_v4_genopt(buf, buf_len, doi_def, secattr);
2066 if (buf_len < 0) 2066 if (ret_val < 0)
2067 return buf_len; 2067 return ret_val;
2068 buf_len = ret_val;
2068 opt_len = (buf_len + 3) & ~3; 2069 opt_len = (buf_len + 3) & ~3;
2069 2070
2070 /* we overwrite any existing options to ensure that we have enough 2071 /* we overwrite any existing options to ensure that we have enough
diff --git a/net/mac80211/rc80211_minstrel_debugfs.c b/net/mac80211/rc80211_minstrel_debugfs.c
index 0b024cd6b809..98f480708050 100644
--- a/net/mac80211/rc80211_minstrel_debugfs.c
+++ b/net/mac80211/rc80211_minstrel_debugfs.c
@@ -94,8 +94,8 @@ minstrel_stats_open(struct inode *inode, struct file *file)
94 prob / 10, prob % 10, 94 prob / 10, prob % 10,
95 mr->last_success, 95 mr->last_success,
96 mr->last_attempts, 96 mr->last_attempts,
97 mr->succ_hist, 97 (unsigned long long)mr->succ_hist,
98 mr->att_hist); 98 (unsigned long long)mr->att_hist);
99 } 99 }
100 p += sprintf(p, "\nTotal packet count:: ideal %d " 100 p += sprintf(p, "\nTotal packet count:: ideal %d "
101 "lookaround %d\n\n", 101 "lookaround %d\n\n",
@@ -106,7 +106,7 @@ minstrel_stats_open(struct inode *inode, struct file *file)
106 return 0; 106 return 0;
107} 107}
108 108
109static int 109static ssize_t
110minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *o) 110minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *o)
111{ 111{
112 struct minstrel_stats_info *ms; 112 struct minstrel_stats_info *ms;
diff --git a/net/netfilter/nf_conntrack_proto_gre.c b/net/netfilter/nf_conntrack_proto_gre.c
index a2cdbcbf64c4..4ab62ad85dd4 100644
--- a/net/netfilter/nf_conntrack_proto_gre.c
+++ b/net/netfilter/nf_conntrack_proto_gre.c
@@ -335,7 +335,7 @@ static int __init nf_ct_proto_gre_init(void)
335 rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4); 335 rv = nf_conntrack_l4proto_register(&nf_conntrack_l4proto_gre4);
336 if (rv < 0) 336 if (rv < 0)
337 return rv; 337 return rv;
338 rv = register_pernet_gen_device(&proto_gre_net_id, &proto_gre_net_ops); 338 rv = register_pernet_gen_subsys(&proto_gre_net_id, &proto_gre_net_ops);
339 if (rv < 0) 339 if (rv < 0)
340 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); 340 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
341 return rv; 341 return rv;
@@ -344,7 +344,7 @@ static int __init nf_ct_proto_gre_init(void)
344static void nf_ct_proto_gre_fini(void) 344static void nf_ct_proto_gre_fini(void)
345{ 345{
346 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4); 346 nf_conntrack_l4proto_unregister(&nf_conntrack_l4proto_gre4);
347 unregister_pernet_gen_device(proto_gre_net_id, &proto_gre_net_ops); 347 unregister_pernet_gen_subsys(proto_gre_net_id, &proto_gre_net_ops);
348} 348}
349 349
350module_init(nf_ct_proto_gre_init); 350module_init(nf_ct_proto_gre_init);
diff --git a/net/netlabel/netlabel_addrlist.c b/net/netlabel/netlabel_addrlist.c
index 8b1c58b0820c..2fc49e56c5a7 100644
--- a/net/netlabel/netlabel_addrlist.c
+++ b/net/netlabel/netlabel_addrlist.c
@@ -315,6 +315,7 @@ struct netlbl_af6list *netlbl_af6list_remove(const struct in6_addr *addr,
315 * Audit Helper Functions 315 * Audit Helper Functions
316 */ 316 */
317 317
318#ifdef CONFIG_AUDIT
318/** 319/**
319 * netlbl_af4list_audit_addr - Audit an IPv4 address 320 * netlbl_af4list_audit_addr - Audit an IPv4 address
320 * @audit_buf: audit buffer 321 * @audit_buf: audit buffer
@@ -386,3 +387,4 @@ void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
386 } 387 }
387} 388}
388#endif /* IPv6 */ 389#endif /* IPv6 */
390#endif /* CONFIG_AUDIT */
diff --git a/net/netlabel/netlabel_addrlist.h b/net/netlabel/netlabel_addrlist.h
index 0242bead405f..07ae7fd82be1 100644
--- a/net/netlabel/netlabel_addrlist.h
+++ b/net/netlabel/netlabel_addrlist.h
@@ -120,9 +120,19 @@ struct netlbl_af4list *netlbl_af4list_search(__be32 addr,
120struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr, 120struct netlbl_af4list *netlbl_af4list_search_exact(__be32 addr,
121 __be32 mask, 121 __be32 mask,
122 struct list_head *head); 122 struct list_head *head);
123
124#ifdef CONFIG_AUDIT
123void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf, 125void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
124 int src, const char *dev, 126 int src, const char *dev,
125 __be32 addr, __be32 mask); 127 __be32 addr, __be32 mask);
128#else
129static inline void netlbl_af4list_audit_addr(struct audit_buffer *audit_buf,
130 int src, const char *dev,
131 __be32 addr, __be32 mask)
132{
133 return;
134}
135#endif
126 136
127#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 137#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
128 138
@@ -179,11 +189,23 @@ struct netlbl_af6list *netlbl_af6list_search(const struct in6_addr *addr,
179struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr, 189struct netlbl_af6list *netlbl_af6list_search_exact(const struct in6_addr *addr,
180 const struct in6_addr *mask, 190 const struct in6_addr *mask,
181 struct list_head *head); 191 struct list_head *head);
192
193#ifdef CONFIG_AUDIT
182void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf, 194void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
183 int src, 195 int src,
184 const char *dev, 196 const char *dev,
185 const struct in6_addr *addr, 197 const struct in6_addr *addr,
186 const struct in6_addr *mask); 198 const struct in6_addr *mask);
199#else
200static inline void netlbl_af6list_audit_addr(struct audit_buffer *audit_buf,
201 int src,
202 const char *dev,
203 const struct in6_addr *addr,
204 const struct in6_addr *mask)
205{
206 return;
207}
208#endif
187#endif /* IPV6 */ 209#endif /* IPV6 */
188 210
189#endif 211#endif
diff --git a/net/netlabel/netlabel_mgmt.c b/net/netlabel/netlabel_mgmt.c
index ee769ecaa13c..0a0ef17b2a40 100644
--- a/net/netlabel/netlabel_mgmt.c
+++ b/net/netlabel/netlabel_mgmt.c
@@ -265,7 +265,7 @@ add_failure:
265static int netlbl_mgmt_listentry(struct sk_buff *skb, 265static int netlbl_mgmt_listentry(struct sk_buff *skb,
266 struct netlbl_dom_map *entry) 266 struct netlbl_dom_map *entry)
267{ 267{
268 int ret_val; 268 int ret_val = 0;
269 struct nlattr *nla_a; 269 struct nlattr *nla_a;
270 struct nlattr *nla_b; 270 struct nlattr *nla_b;
271 struct netlbl_af4list *iter4; 271 struct netlbl_af4list *iter4;
diff --git a/net/rfkill/rfkill-input.c b/net/rfkill/rfkill-input.c
index 21124ec0a73d..bfdade72e066 100644
--- a/net/rfkill/rfkill-input.c
+++ b/net/rfkill/rfkill-input.c
@@ -256,6 +256,11 @@ static struct input_handler rfkill_handler = {
256 256
257static int __init rfkill_handler_init(void) 257static int __init rfkill_handler_init(void)
258{ 258{
259 unsigned long last_run = jiffies - msecs_to_jiffies(500);
260 rfkill_wlan.last = last_run;
261 rfkill_bt.last = last_run;
262 rfkill_uwb.last = last_run;
263 rfkill_wimax.last = last_run;
259 return input_register_handler(&rfkill_handler); 264 return input_register_handler(&rfkill_handler);
260} 265}
261 266
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 436bf1b4b76c..cb216b2df666 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -228,19 +228,21 @@ static int
228rpcauth_prune_expired(struct list_head *free, int nr_to_scan) 228rpcauth_prune_expired(struct list_head *free, int nr_to_scan)
229{ 229{
230 spinlock_t *cache_lock; 230 spinlock_t *cache_lock;
231 struct rpc_cred *cred; 231 struct rpc_cred *cred, *next;
232 unsigned long expired = jiffies - RPC_AUTH_EXPIRY_MORATORIUM; 232 unsigned long expired = jiffies - RPC_AUTH_EXPIRY_MORATORIUM;
233 233
234 while (!list_empty(&cred_unused)) { 234 list_for_each_entry_safe(cred, next, &cred_unused, cr_lru) {
235 cred = list_entry(cred_unused.next, struct rpc_cred, cr_lru); 235
236 /* Enforce a 60 second garbage collection moratorium */
237 if (time_in_range(cred->cr_expire, expired, jiffies) &&
238 test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0)
239 continue;
240
236 list_del_init(&cred->cr_lru); 241 list_del_init(&cred->cr_lru);
237 number_cred_unused--; 242 number_cred_unused--;
238 if (atomic_read(&cred->cr_count) != 0) 243 if (atomic_read(&cred->cr_count) != 0)
239 continue; 244 continue;
240 /* Enforce a 5 second garbage collection moratorium */ 245
241 if (time_in_range(cred->cr_expire, expired, jiffies) &&
242 test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) != 0)
243 continue;
244 cache_lock = &cred->cr_auth->au_credcache->lock; 246 cache_lock = &cred->cr_auth->au_credcache->lock;
245 spin_lock(cache_lock); 247 spin_lock(cache_lock);
246 if (atomic_read(&cred->cr_count) == 0) { 248 if (atomic_read(&cred->cr_count) == 0) {
@@ -453,7 +455,7 @@ need_lock:
453 } 455 }
454 if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) 456 if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0)
455 rpcauth_unhash_cred(cred); 457 rpcauth_unhash_cred(cred);
456 else if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { 458 if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) {
457 cred->cr_expire = jiffies; 459 cred->cr_expire = jiffies;
458 list_add_tail(&cred->cr_lru, &cred_unused); 460 list_add_tail(&cred->cr_lru, &cred_unused);
459 number_cred_unused++; 461 number_cred_unused++;
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index f9ce3c9949d5..82a9b6286dd3 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -249,6 +249,7 @@ struct sock_xprt {
249 void (*old_data_ready)(struct sock *, int); 249 void (*old_data_ready)(struct sock *, int);
250 void (*old_state_change)(struct sock *); 250 void (*old_state_change)(struct sock *);
251 void (*old_write_space)(struct sock *); 251 void (*old_write_space)(struct sock *);
252 void (*old_error_report)(struct sock *);
252}; 253};
253 254
254/* 255/*
@@ -696,8 +697,9 @@ static int xs_tcp_send_request(struct rpc_task *task)
696 case -EAGAIN: 697 case -EAGAIN:
697 xs_nospace(task); 698 xs_nospace(task);
698 break; 699 break;
699 case -ECONNREFUSED:
700 case -ECONNRESET: 700 case -ECONNRESET:
701 xs_tcp_shutdown(xprt);
702 case -ECONNREFUSED:
701 case -ENOTCONN: 703 case -ENOTCONN:
702 case -EPIPE: 704 case -EPIPE:
703 status = -ENOTCONN; 705 status = -ENOTCONN;
@@ -740,6 +742,22 @@ out_release:
740 xprt_release_xprt(xprt, task); 742 xprt_release_xprt(xprt, task);
741} 743}
742 744
745static void xs_save_old_callbacks(struct sock_xprt *transport, struct sock *sk)
746{
747 transport->old_data_ready = sk->sk_data_ready;
748 transport->old_state_change = sk->sk_state_change;
749 transport->old_write_space = sk->sk_write_space;
750 transport->old_error_report = sk->sk_error_report;
751}
752
753static void xs_restore_old_callbacks(struct sock_xprt *transport, struct sock *sk)
754{
755 sk->sk_data_ready = transport->old_data_ready;
756 sk->sk_state_change = transport->old_state_change;
757 sk->sk_write_space = transport->old_write_space;
758 sk->sk_error_report = transport->old_error_report;
759}
760
743/** 761/**
744 * xs_close - close a socket 762 * xs_close - close a socket
745 * @xprt: transport 763 * @xprt: transport
@@ -763,9 +781,8 @@ static void xs_close(struct rpc_xprt *xprt)
763 transport->sock = NULL; 781 transport->sock = NULL;
764 782
765 sk->sk_user_data = NULL; 783 sk->sk_user_data = NULL;
766 sk->sk_data_ready = transport->old_data_ready; 784
767 sk->sk_state_change = transport->old_state_change; 785 xs_restore_old_callbacks(transport, sk);
768 sk->sk_write_space = transport->old_write_space;
769 write_unlock_bh(&sk->sk_callback_lock); 786 write_unlock_bh(&sk->sk_callback_lock);
770 787
771 sk->sk_no_check = 0; 788 sk->sk_no_check = 0;
@@ -1178,6 +1195,28 @@ static void xs_tcp_state_change(struct sock *sk)
1178} 1195}
1179 1196
1180/** 1197/**
1198 * xs_tcp_error_report - callback mainly for catching RST events
1199 * @sk: socket
1200 */
1201static void xs_tcp_error_report(struct sock *sk)
1202{
1203 struct rpc_xprt *xprt;
1204
1205 read_lock(&sk->sk_callback_lock);
1206 if (sk->sk_err != ECONNRESET || sk->sk_state != TCP_ESTABLISHED)
1207 goto out;
1208 if (!(xprt = xprt_from_sock(sk)))
1209 goto out;
1210 dprintk("RPC: %s client %p...\n"
1211 "RPC: error %d\n",
1212 __func__, xprt, sk->sk_err);
1213
1214 xprt_force_disconnect(xprt);
1215out:
1216 read_unlock(&sk->sk_callback_lock);
1217}
1218
1219/**
1181 * xs_udp_write_space - callback invoked when socket buffer space 1220 * xs_udp_write_space - callback invoked when socket buffer space
1182 * becomes available 1221 * becomes available
1183 * @sk: socket whose state has changed 1222 * @sk: socket whose state has changed
@@ -1452,10 +1491,9 @@ static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
1452 1491
1453 write_lock_bh(&sk->sk_callback_lock); 1492 write_lock_bh(&sk->sk_callback_lock);
1454 1493
1494 xs_save_old_callbacks(transport, sk);
1495
1455 sk->sk_user_data = xprt; 1496 sk->sk_user_data = xprt;
1456 transport->old_data_ready = sk->sk_data_ready;
1457 transport->old_state_change = sk->sk_state_change;
1458 transport->old_write_space = sk->sk_write_space;
1459 sk->sk_data_ready = xs_udp_data_ready; 1497 sk->sk_data_ready = xs_udp_data_ready;
1460 sk->sk_write_space = xs_udp_write_space; 1498 sk->sk_write_space = xs_udp_write_space;
1461 sk->sk_no_check = UDP_CSUM_NORCV; 1499 sk->sk_no_check = UDP_CSUM_NORCV;
@@ -1587,13 +1625,13 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
1587 1625
1588 write_lock_bh(&sk->sk_callback_lock); 1626 write_lock_bh(&sk->sk_callback_lock);
1589 1627
1628 xs_save_old_callbacks(transport, sk);
1629
1590 sk->sk_user_data = xprt; 1630 sk->sk_user_data = xprt;
1591 transport->old_data_ready = sk->sk_data_ready;
1592 transport->old_state_change = sk->sk_state_change;
1593 transport->old_write_space = sk->sk_write_space;
1594 sk->sk_data_ready = xs_tcp_data_ready; 1631 sk->sk_data_ready = xs_tcp_data_ready;
1595 sk->sk_state_change = xs_tcp_state_change; 1632 sk->sk_state_change = xs_tcp_state_change;
1596 sk->sk_write_space = xs_tcp_write_space; 1633 sk->sk_write_space = xs_tcp_write_space;
1634 sk->sk_error_report = xs_tcp_error_report;
1597 sk->sk_allocation = GFP_ATOMIC; 1635 sk->sk_allocation = GFP_ATOMIC;
1598 1636
1599 /* socket options */ 1637 /* socket options */
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 80b13eea30e7..9d88c3df804a 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1251,6 +1251,8 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, struct flowi *fl,
1251 -EINVAL : -EAGAIN); 1251 -EINVAL : -EAGAIN);
1252 xfrm_state_put(x); 1252 xfrm_state_put(x);
1253 } 1253 }
1254 else if (error == -ESRCH)
1255 error = -EAGAIN;
1254 1256
1255 if (!tmpl->optional) 1257 if (!tmpl->optional)
1256 goto fail; 1258 goto fail;