From 37cc0ecb1b58d259a1bae17d7325ea405969be4e Mon Sep 17 00:00:00 2001 From: Navdeep Parhar Date: Fri, 25 Jan 2013 20:23:33 +0000 Subject: [PATCH] Heed SO_NO_OFFLOAD. MFC after: 1 week --- sys/netinet/tcp_usrreq.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 85597d96ac4f..b46c46a47ac5 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -370,7 +370,8 @@ tcp_usr_listen(struct socket *so, int backlog, struct thread *td) tp->t_state = TCPS_LISTEN; solisten_proto(so, backlog); #ifdef TCP_OFFLOAD - tcp_offload_listen_start(tp); + if ((so->so_options & SO_NO_OFFLOAD) == 0) + tcp_offload_listen_start(tp); #endif } SOCK_UNLOCK(so); @@ -414,7 +415,8 @@ tcp6_usr_listen(struct socket *so, int backlog, struct thread *td) tp->t_state = TCPS_LISTEN; solisten_proto(so, backlog); #ifdef TCP_OFFLOAD - tcp_offload_listen_start(tp); + if ((so->so_options & SO_NO_OFFLOAD) == 0) + tcp_offload_listen_start(tp); #endif } SOCK_UNLOCK(so); @@ -468,6 +470,7 @@ tcp_usr_connect(struct socket *so, struct sockaddr *nam, struct thread *td) goto out; #ifdef TCP_OFFLOAD if (registered_toedevs > 0 && + (so->so_options & SO_NO_OFFLOAD) == 0 && (error = tcp_offload_connect(so, nam)) == 0) goto out; #endif