Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111487
b: refs/heads/master
c: 0a48226
h: refs/heads/master
i:
  111485: 43f62aa
  111483: 00d2bf6
  111479: 9989b52
  111471: ca35969
  111455: 1b4c33f
  111423: 8a44d00
  111359: c638e74
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent 0407ba5 commit 3f1f27b
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51c7d4fa2675c106a980ddcdbe308b54b5151945
refs/heads/master: 0a4822679d94e2b0117aeead06a19fad59533905
8 changes: 0 additions & 8 deletions trunk/include/linux/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,14 +355,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
return __dccp_hdr_len(dccp_hdr(skb));
}


/* initial values for each feature */
#define DCCPF_INITIAL_SEQUENCE_WINDOW 100
#define DCCPF_INITIAL_ACK_RATIO 2
#define DCCPF_INITIAL_CCID DCCPC_CCID2
/* FIXME: for now we're default to 1 but it should really be 0 */
#define DCCPF_INITIAL_SEND_NDP_COUNT 1

/**
* struct dccp_request_sock - represent DCCP-specific connection request
* @dreq_inet_rsk: structure inherited from
Expand Down
3 changes: 0 additions & 3 deletions trunk/net/dccp/dccp.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,6 @@ extern void dccp_time_wait(struct sock *sk, int state, int timeo);
extern int sysctl_dccp_request_retries;
extern int sysctl_dccp_retries1;
extern int sysctl_dccp_retries2;
extern int sysctl_dccp_feat_sequence_window;
extern int sysctl_dccp_feat_rx_ccid;
extern int sysctl_dccp_feat_tx_ccid;
extern int sysctl_dccp_tx_qlen;
extern int sysctl_dccp_sync_ratelimit;

Expand Down
11 changes: 8 additions & 3 deletions trunk/net/dccp/feat.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
#include "ccid.h"
#include "feat.h"

/* feature-specific sysctls - initialised to the defaults from RFC 4340, 6.4 */
unsigned long sysctl_dccp_sequence_window __read_mostly = 100;
int sysctl_dccp_rx_ccid __read_mostly = 2,
sysctl_dccp_tx_ccid __read_mostly = 2;

/*
* Feature activation handlers.
*
Expand Down Expand Up @@ -1141,7 +1146,7 @@ int dccp_feat_init(struct sock *sk)

/* Non-negotiable (NN) features */
rc = __feat_register_nn(fn, DCCPF_SEQUENCE_WINDOW, 0,
sysctl_dccp_feat_sequence_window);
sysctl_dccp_sequence_window);
if (rc)
return rc;

Expand Down Expand Up @@ -1172,8 +1177,8 @@ int dccp_feat_init(struct sock *sk)
if (ccid_request_modules(tx.val, tx.len))
goto free_ccid_lists;

if (!dccp_feat_prefer(sysctl_dccp_feat_tx_ccid, tx.val, tx.len) ||
!dccp_feat_prefer(sysctl_dccp_feat_rx_ccid, rx.val, rx.len))
if (!dccp_feat_prefer(sysctl_dccp_tx_ccid, tx.val, tx.len) ||
!dccp_feat_prefer(sysctl_dccp_rx_ccid, rx.val, rx.len))
goto free_ccid_lists;

rc = __feat_register_sp(fn, DCCPF_CCID, true, false, tx.val, tx.len);
Expand Down
8 changes: 8 additions & 0 deletions trunk/net/dccp/feat.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ struct ccid_dependency {
u8 val;
};

/*
* Sysctls to seed defaults for feature negotiation
*/
extern unsigned long sysctl_dccp_sequence_window;
extern int sysctl_dccp_rx_ccid;
extern int sysctl_dccp_tx_ccid;

#ifdef CONFIG_IP_DCCP_DEBUG
extern const char *dccp_feat_typename(const u8 type);
extern const char *dccp_feat_name(const u8 feat);
Expand All @@ -113,6 +120,7 @@ static inline void dccp_feat_debug(const u8 type, const u8 feat, const u8 val)
#endif /* CONFIG_IP_DCCP_DEBUG */

extern int dccp_feat_init(struct sock *sk);
extern void dccp_feat_initialise_sysctls(void);
extern int dccp_feat_register_sp(struct sock *sk, u8 feat, u8 is_local,
u8 const *list, u8 len);
extern int dccp_feat_register_nn(struct sock *sk, u8 feat, u64 val);
Expand Down
4 changes: 0 additions & 4 deletions trunk/net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "dccp.h"
#include "feat.h"

int sysctl_dccp_feat_sequence_window = DCCPF_INITIAL_SEQUENCE_WINDOW;
int sysctl_dccp_feat_rx_ccid = DCCPF_INITIAL_CCID;
int sysctl_dccp_feat_tx_ccid = DCCPF_INITIAL_CCID;

u64 dccp_decode_value_var(const u8 *bf, const u8 len)
{
u64 value = 0;
Expand Down
43 changes: 30 additions & 13 deletions trunk/net/dccp/sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,55 +18,72 @@
#error This file should not be compiled without CONFIG_SYSCTL defined
#endif

/* Boundary values */
static int zero = 0,
u8_max = 0xFF;
static unsigned long seqw_min = 32;

static struct ctl_table dccp_default_table[] = {
{
.procname = "seq_window",
.data = &sysctl_dccp_feat_sequence_window,
.maxlen = sizeof(sysctl_dccp_feat_sequence_window),
.data = &sysctl_dccp_sequence_window,
.maxlen = sizeof(sysctl_dccp_sequence_window),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_doulongvec_minmax,
.extra1 = &seqw_min, /* RFC 4340, 7.5.2 */
},
{
.procname = "rx_ccid",
.data = &sysctl_dccp_feat_rx_ccid,
.maxlen = sizeof(sysctl_dccp_feat_rx_ccid),
.data = &sysctl_dccp_rx_ccid,
.maxlen = sizeof(sysctl_dccp_rx_ccid),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &u8_max, /* RFC 4340, 10. */
},
{
.procname = "tx_ccid",
.data = &sysctl_dccp_feat_tx_ccid,
.maxlen = sizeof(sysctl_dccp_feat_tx_ccid),
.data = &sysctl_dccp_tx_ccid,
.maxlen = sizeof(sysctl_dccp_tx_ccid),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &u8_max, /* RFC 4340, 10. */
},
{
.procname = "request_retries",
.data = &sysctl_dccp_request_retries,
.maxlen = sizeof(sysctl_dccp_request_retries),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &u8_max,
},
{
.procname = "retries1",
.data = &sysctl_dccp_retries1,
.maxlen = sizeof(sysctl_dccp_retries1),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &u8_max,
},
{
.procname = "retries2",
.data = &sysctl_dccp_retries2,
.maxlen = sizeof(sysctl_dccp_retries2),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
.extra2 = &u8_max,
},
{
.procname = "tx_qlen",
.data = &sysctl_dccp_tx_qlen,
.maxlen = sizeof(sysctl_dccp_tx_qlen),
.mode = 0644,
.proc_handler = proc_dointvec,
.proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
},
{
.procname = "sync_ratelimit",
Expand Down

0 comments on commit 3f1f27b

Please sign in to comment.