提交 5cdae198 编写于 作者: G Gerrit Renker 提交者: David S. Miller

[DCCP]: Make code assumptions explicit

This removes several `XXX' references which indicate a missing support
for non-1-byte feature values: this is unnecessary, as all currently known
(standardised) SP feature values are 1-byte quantities.
Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
Signed-off-by: NIan McDonald <ian.mcdonald@jandi.co.nz>
Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 dd6303df
...@@ -4,6 +4,12 @@ ...@@ -4,6 +4,12 @@
* An implementation of the DCCP protocol * An implementation of the DCCP protocol
* Andrea Bittau <a.bittau@cs.ucl.ac.uk> * Andrea Bittau <a.bittau@cs.ucl.ac.uk>
* *
* ASSUMPTIONS
* -----------
* o All currently known SP features have 1-byte quantities. If in the future
* extensions of RFCs 4340..42 define features with item lengths larger than
* one byte, a feature-specific extension of the code will be required.
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
...@@ -95,7 +101,6 @@ static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr) ...@@ -95,7 +101,6 @@ static int dccp_feat_update_ccid(struct sock *sk, u8 type, u8 new_ccid_nr)
return 0; return 0;
} }
/* XXX taking only u8 vals */
static int dccp_feat_update(struct sock *sk, u8 type, u8 feat, u8 val) static int dccp_feat_update(struct sock *sk, u8 type, u8 feat, u8 val)
{ {
dccp_feat_debug(type, feat, val); dccp_feat_debug(type, feat, val);
...@@ -140,7 +145,6 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt, ...@@ -140,7 +145,6 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt,
/* FIXME sanity check vals */ /* FIXME sanity check vals */
/* Are values in any order? XXX Lame "algorithm" here */ /* Are values in any order? XXX Lame "algorithm" here */
/* XXX assume values are 1 byte */
for (i = 0; i < slen; i++) { for (i = 0; i < slen; i++) {
for (j = 0; j < rlen; j++) { for (j = 0; j < rlen; j++) {
if (spref[i] == rpref[j]) { if (spref[i] == rpref[j]) {
...@@ -175,7 +179,6 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt, ...@@ -175,7 +179,6 @@ static int dccp_feat_reconcile(struct sock *sk, struct dccp_opt_pend *opt,
} }
/* need to put result and our preference list */ /* need to put result and our preference list */
/* XXX assume 1 byte vals */
rlen = 1 + opt->dccpop_len; rlen = 1 + opt->dccpop_len;
rpref = kmalloc(rlen, GFP_ATOMIC); rpref = kmalloc(rlen, GFP_ATOMIC);
if (rpref == NULL) if (rpref == NULL)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册