summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authornp <np@FreeBSD.org>2012-08-21 18:09:33 +0000
committernp <np@FreeBSD.org>2012-08-21 18:09:33 +0000
commit7a7bbaad5a88b5ee15bae1e36c3ff798c6c4b3f2 (patch)
tree9f814090f3bce843d8595af3bdf1348e87592883 /sys/netinet
parenta41fb634e4ef4b2df2c1bbec2f5f30d75a14084f (diff)
downloadFreeBSD-src-7a7bbaad5a88b5ee15bae1e36c3ff798c6c4b3f2.zip
FreeBSD-src-7a7bbaad5a88b5ee15bae1e36c3ff798c6c4b3f2.tar.gz
Correctly handle the case where an inp has already been dropped by the time
the TOE driver reports that an active open failed. toe_connect_failed is supposed to handle this but it should be provided the inpcb instead of the tcpcb which may no longer be around.
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/toecore.c10
-rw-r--r--sys/netinet/toecore.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/netinet/toecore.c b/sys/netinet/toecore.c
index 4b4efb7..7e498dd 100644
--- a/sys/netinet/toecore.c
+++ b/sys/netinet/toecore.c
@@ -478,15 +478,17 @@ toe_l2_resolve(struct toedev *tod, struct ifnet *ifp, struct sockaddr *sa,
}
void
-toe_connect_failed(struct toedev *tod, struct tcpcb *tp, int err)
+toe_connect_failed(struct toedev *tod, struct inpcb *inp, int err)
{
- struct inpcb *inp = tp->t_inpcb;
INP_WLOCK_ASSERT(inp);
- KASSERT(tp->t_flags & TF_TOE,
- ("%s: tp %p not offloaded.", __func__, tp));
if (!(inp->inp_flags & INP_DROPPED)) {
+ struct tcpcb *tp = intotcpcb(inp);
+
+ KASSERT(tp->t_flags & TF_TOE,
+ ("%s: tp %p not offloaded.", __func__, tp));
+
if (err == EAGAIN) {
/*
diff --git a/sys/netinet/toecore.h b/sys/netinet/toecore.h
index a381825..6ea9851 100644
--- a/sys/netinet/toecore.h
+++ b/sys/netinet/toecore.h
@@ -119,7 +119,7 @@ int unregister_toedev(struct toedev *);
int toe_l2_resolve(struct toedev *, struct ifnet *, struct sockaddr *,
uint8_t *, uint16_t *);
-void toe_connect_failed(struct toedev *, struct tcpcb *, int);
+void toe_connect_failed(struct toedev *, struct inpcb *, int);
void toe_syncache_add(struct in_conninfo *, struct tcpopt *, struct tcphdr *,
struct inpcb *, void *, void *);
OpenPOWER on IntegriCloud