git://git.onelab.eu
/
linux-2.6.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8e4dbe0
)
- merge revision 1.7
author
Mark Huang
<mlhuang@cs.princeton.edu>
Thu, 27 Jan 2005 20:39:19 +0000
(20:39 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Thu, 27 Jan 2005 20:39:19 +0000
(20:39 +0000)
date: 2005/01/10 19:31:58; author: mlhuang; state: Exp; lines: +14 -0
- backport 2.6.9 addition of skb_header_pointer() macro to support
pptp-conntrack-nat patch
include/linux/skbuff.h
patch
|
blob
|
history
diff --git
a/include/linux/skbuff.h
b/include/linux/skbuff.h
index
111bb73
..
5156e43
100644
(file)
--- a/
include/linux/skbuff.h
+++ b/
include/linux/skbuff.h
@@
-1106,6
+1106,20
@@
extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
extern void skb_split(struct sk_buff *skb,
struct sk_buff *skb1, const u32 len);
+static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
+ int len, void *buffer)
+{
+ int hlen = skb_headlen(skb);
+
+ if (offset + len <= hlen)
+ return skb->data + offset;
+
+ if (skb_copy_bits(skb, offset, buffer, len) < 0)
+ return NULL;
+
+ return buffer;
+}
+
extern void skb_init(void);
extern void skb_add_mtu(int mtu);