Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111469
b: refs/heads/master
c: d0440ee
h: refs/heads/master
i:
  111467: f545aa3
v: v3
  • Loading branch information
Gerrit Renker committed Sep 4, 2008
1 parent 7f4d194 commit 8ecf9aa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9aaac1c538a9c86e8ef3be2579a13ff55580908
refs/heads/master: d0440ee6f6903fcde6ed4efb88c910de1dfa18e5
2 changes: 2 additions & 0 deletions trunk/net/dccp/feat.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,4 +138,6 @@ extern int dccp_feat_init(struct sock *sk);

extern void dccp_encode_value_var(const u64 value, u8 *to, const u8 len);
extern u64 dccp_decode_value_var(const u8 *bf, const u8 len);

extern int dccp_insert_option_mandatory(struct sk_buff *skb);
#endif /* _DCCP_FEAT_H */
15 changes: 15 additions & 0 deletions trunk/net/dccp/options.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,21 @@ static int dccp_insert_option_timestamp_echo(struct dccp_sock *dp,
return 0;
}

/**
* dccp_insert_option_mandatory - Mandatory option (5.8.2)
* Note that since we are using skb_push, this function needs to be called
* _after_ inserting the option it is supposed to influence (stack order).
*/
int dccp_insert_option_mandatory(struct sk_buff *skb)
{
if (DCCP_SKB_CB(skb)->dccpd_opt_len >= DCCP_MAX_OPT_LEN)
return -1;

DCCP_SKB_CB(skb)->dccpd_opt_len++;
*skb_push(skb, 1) = DCCPO_MANDATORY;
return 0;
}

static int dccp_insert_feat_opt(struct sk_buff *skb, u8 type, u8 feat,
u8 *val, u8 len)
{
Expand Down

0 comments on commit 8ecf9aa

Please sign in to comment.