aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/options.c
diff options
context:
space:
mode:
authorGerrit Renker <gerrit@erg.abdn.ac.uk>2006-11-20 15:39:23 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-03 00:24:38 -0500
commit59348b19efebfd6a8d0791ff81d207b16594c94b (patch)
treea9212a7bf62bd594cf02d23b9e33eb45a46d414d /net/dccp/options.c
parentb1308dc015eb09cf094ca169296738a13ae049ad (diff)
[DCCP]: Simplified conditions due to use of enum:8 states
This reaps the benefit of the earlier patch, which changed the type of CCID 3 states to use enums, in that many conditions are now simplified and the number of possible (unexpected) values is greatly reduced. In a few instances, this also allowed to simplify pre-conditions; where care has been taken to retain logical equivalence. [DCCP]: Introduce a consistent BUG/WARN message scheme This refines the existing set of DCCP messages so that * BUG(), BUG_ON(), WARN_ON() have meaningful DCCP-specific counterparts * DCCP_CRIT (for severe warnings) is not rate-limited * DCCP_WARN() is introduced as rate-limited wrapper Using these allows a faster and cleaner transition to their original counterparts once the code has matured into a full DCCP implementation. Signed-off-by: Gerrit Renker <gerrit@erg.abdn.ac.uk> Signed-off-by: Arnaldo Carvalho de Melo <acme@mandriva.com>
Diffstat (limited to 'net/dccp/options.c')
-rw-r--r--net/dccp/options.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/dccp/options.c b/net/dccp/options.c
index 7e50678e2471..ee709ae0a97f 100644
--- a/net/dccp/options.c
+++ b/net/dccp/options.c
@@ -238,9 +238,8 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
238 } 238 }
239 break; 239 break;
240 default: 240 default:
241 pr_info("DCCP(%p): option %d(len=%d) not " 241 DCCP_CRIT("DCCP(%p): option %d(len=%d) not "
242 "implemented, ignoring\n", 242 "implemented, ignoring", sk, opt, len);
243 sk, opt, len);
244 break; 243 break;
245 } 244 }
246 245
@@ -257,7 +256,7 @@ int dccp_parse_options(struct sock *sk, struct sk_buff *skb)
257out_invalid_option: 256out_invalid_option:
258 DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT); 257 DCCP_INC_STATS_BH(DCCP_MIB_INVALIDOPT);
259 DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR; 258 DCCP_SKB_CB(skb)->dccpd_reset_code = DCCP_RESET_CODE_OPTION_ERROR;
260 pr_info("DCCP(%p): invalid option %d, len=%d\n", sk, opt, len); 259 DCCP_WARN("DCCP(%p): invalid option %d, len=%d", sk, opt, len);
261 return -1; 260 return -1;
262} 261}
263 262
@@ -447,8 +446,7 @@ static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat,
447 u8 *to; 446 u8 *to;
448 447
449 if (DCCP_SKB_CB(skb)->dccpd_opt_len + len + 3 > DCCP_MAX_OPT_LEN) { 448 if (DCCP_SKB_CB(skb)->dccpd_opt_len + len + 3 > DCCP_MAX_OPT_LEN) {
450 LIMIT_NETDEBUG(KERN_INFO "DCCP: packet too small" 449 DCCP_WARN("packet too small for feature %d option!\n", feat);
451 " to insert feature %d option!\n", feat);
452 return -1; 450 return -1;
453 } 451 }
454 452