Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 361783
b: refs/heads/master
c: cf2e394
h: refs/heads/master
i:
  361781: d6c5d1f
  361779: f826ec7
  361775: c90a367
v: v3
  • Loading branch information
Julian Anastasov authored and Simon Horman committed Mar 19, 2013
1 parent 23c13b0 commit 81f4a7d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: a82783c91d5dce680dbd290ebf301a520b0e72a5
refs/heads/master: cf2e39429c245245db889fffdfbdf3f889a6cb22
16 changes: 9 additions & 7 deletions trunk/net/netfilter/ipvs/ip_vs_proto_sctp.c
Original file line number Diff line number Diff line change
Expand Up @@ -906,16 +906,16 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
sctp_chunkhdr_t _sctpch, *sch;
unsigned char chunk_type;
int event, next_state;
int ihl;
int ihl, cofs;

#ifdef CONFIG_IP_VS_IPV6
ihl = cp->af == AF_INET ? ip_hdrlen(skb) : sizeof(struct ipv6hdr);
#else
ihl = ip_hdrlen(skb);
#endif

sch = skb_header_pointer(skb, ihl + sizeof(sctp_sctphdr_t),
sizeof(_sctpch), &_sctpch);
cofs = ihl + sizeof(sctp_sctphdr_t);
sch = skb_header_pointer(skb, cofs, sizeof(_sctpch), &_sctpch);
if (sch == NULL)
return;

Expand All @@ -933,10 +933,12 @@ set_sctp_state(struct ip_vs_proto_data *pd, struct ip_vs_conn *cp,
*/
if ((sch->type == SCTP_CID_COOKIE_ECHO) ||
(sch->type == SCTP_CID_COOKIE_ACK)) {
sch = skb_header_pointer(skb, (ihl + sizeof(sctp_sctphdr_t) +
sch->length), sizeof(_sctpch), &_sctpch);
if (sch) {
if (sch->type == SCTP_CID_ABORT)
int clen = ntohs(sch->length);

if (clen >= sizeof(sctp_chunkhdr_t)) {
sch = skb_header_pointer(skb, cofs + ALIGN(clen, 4),
sizeof(_sctpch), &_sctpch);
if (sch && sch->type == SCTP_CID_ABORT)
chunk_type = sch->type;
}
}
Expand Down

0 comments on commit 81f4a7d

Please sign in to comment.