diff options
author | andre <andre@FreeBSD.org> | 2007-05-11 20:52:47 +0000 |
---|---|---|
committer | andre <andre@FreeBSD.org> | 2007-05-11 20:52:47 +0000 |
commit | 14d6d7db44ab4d0393510d32ce6e0df269dd27e6 (patch) | |
tree | 503b36d9340c08dafb82fe89daaf7d1e4cc1fa5f /sys/netinet | |
parent | a968d55db329f3cf22701c6c0cebc11db78c7e96 (diff) | |
download | FreeBSD-src-14d6d7db44ab4d0393510d32ce6e0df269dd27e6.zip FreeBSD-src-14d6d7db44ab4d0393510d32ce6e0df269dd27e6.tar.gz |
Make the TCP timer callout obtain Giant if the network stack is marked
as non-mpsafe.
This change is to be removed when all protocols are mp-safe.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/tcp_subr.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index aa2b86d..90c2aba 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -653,8 +653,12 @@ tcp_newtcpcb(struct inpcb *inp) tcp_mssdflt; /* Set up our timeouts. */ - callout_init_mtx(&tp->t_timers->tt_timer, &inp->inp_mtx, - CALLOUT_RETURNUNLOCKED); + if (NET_CALLOUT_MPSAFE) + callout_init_mtx(&tp->t_timers->tt_timer, &inp->inp_mtx, + CALLOUT_RETURNUNLOCKED); + else + callout_init_mtx(&tp->t_timers->tt_timer, &inp->inp_mtx, + (CALLOUT_RETURNUNLOCKED|CALLOUT_NETGIANT)); if (tcp_do_rfc1323) tp->t_flags = (TF_REQ_SCALE|TF_REQ_TSTMP); |