aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/dccp.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/dccp.h')
-rw-r--r--include/linux/dccp.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index f3fc4392e93d..55d28cb97596 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -270,10 +270,9 @@ static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
270 return memset(skb_transport_header(skb), 0, headlen); 270 return memset(skb_transport_header(skb), 0, headlen);
271} 271}
272 272
273static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) 273static inline struct dccp_hdr_ext *dccp_hdrx(const struct dccp_hdr *dh)
274{ 274{
275 return (struct dccp_hdr_ext *)(skb_transport_header(skb) + 275 return (struct dccp_hdr_ext *)((unsigned char *)dh + sizeof(*dh));
276 sizeof(struct dccp_hdr));
277} 276}
278 277
279static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) 278static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh)
@@ -287,13 +286,12 @@ static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb)
287 return __dccp_basic_hdr_len(dh); 286 return __dccp_basic_hdr_len(dh);
288} 287}
289 288
290static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) 289static inline __u64 dccp_hdr_seq(const struct dccp_hdr *dh)
291{ 290{
292 const struct dccp_hdr *dh = dccp_hdr(skb);
293 __u64 seq_nr = ntohs(dh->dccph_seq); 291 __u64 seq_nr = ntohs(dh->dccph_seq);
294 292
295 if (dh->dccph_x != 0) 293 if (dh->dccph_x != 0)
296 seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); 294 seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(dh)->dccph_seq_low);
297 else 295 else
298 seq_nr += (u32)dh->dccph_seq2 << 16; 296 seq_nr += (u32)dh->dccph_seq2 << 16;
299 297