summaryrefslogtreecommitdiffstats
path: root/sys/netinet/sctp_timer.c
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2010-11-07 18:50:35 +0000
committertuexen <tuexen@FreeBSD.org>2010-11-07 18:50:35 +0000
commit557f7dc61c5f3a7e4afba6cd77a126662c626f71 (patch)
tree77af1ab00266f89fccd57bd3c5fad0987393dd07 /sys/netinet/sctp_timer.c
parentde6ea2ac5cd25dc1ab1079c39e1331345f664d07 (diff)
downloadFreeBSD-src-557f7dc61c5f3a7e4afba6cd77a126662c626f71.zip
FreeBSD-src-557f7dc61c5f3a7e4afba6cd77a126662c626f71.tar.gz
Do not have the MTU table twice in the code. Therefore move the
function from the timer code to util, rename it appropriately and also fix a bug in sctp_get_prev_mtu(), where calling it with a value existing in the MTU table did not return a smaller one. MFC after: 3 days.
Diffstat (limited to 'sys/netinet/sctp_timer.c')
-rw-r--r--sys/netinet/sctp_timer.c42
1 files changed, 1 insertions, 41 deletions
diff --git a/sys/netinet/sctp_timer.c b/sys/netinet/sctp_timer.c
index 104fa9c..7e9dd29 100644
--- a/sys/netinet/sctp_timer.c
+++ b/sys/netinet/sctp_timer.c
@@ -1670,46 +1670,6 @@ sctp_heartbeat_timer(struct sctp_inpcb *inp, struct sctp_tcb *stcb,
return (0);
}
-#define SCTP_NUMBER_OF_MTU_SIZES 18
-static uint32_t mtu_sizes[] = {
- 68,
- 296,
- 508,
- 512,
- 544,
- 576,
- 1006,
- 1492,
- 1500,
- 1536,
- 2002,
- 2048,
- 4352,
- 4464,
- 8166,
- 17914,
- 32000,
- 65535
-};
-
-
-static uint32_t
-sctp_getnext_mtu(struct sctp_inpcb *inp, uint32_t cur_mtu)
-{
- /* select another MTU that is just bigger than this one */
- int i;
-
- for (i = 0; i < SCTP_NUMBER_OF_MTU_SIZES; i++) {
- if (cur_mtu < mtu_sizes[i]) {
- /* no max_mtu is bigger than this one */
- return (mtu_sizes[i]);
- }
- }
- /* here return the highest allowable */
- return (cur_mtu);
-}
-
-
void
sctp_pathmtu_timer(struct sctp_inpcb *inp,
struct sctp_tcb *stcb,
@@ -1717,7 +1677,7 @@ sctp_pathmtu_timer(struct sctp_inpcb *inp,
{
uint32_t next_mtu, mtu;
- next_mtu = sctp_getnext_mtu(inp, net->mtu);
+ next_mtu = sctp_get_next_mtu(inp, net->mtu);
if ((next_mtu > net->mtu) && (net->port == 0)) {
if ((net->src_addr_selected == 0) ||
OpenPOWER on IntegriCloud