summaryrefslogtreecommitdiffstats
path: root/src/extra
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2019-12-22 14:36:01 +1100
committerPablo Neira Ayuso <pablo@netfilter.org>2019-12-30 12:37:08 +0100
commit5121a7d19a2a85b8ece66ea0b29e9e3ea63e358f (patch)
tree7d1baca2ea3ceec510ef892427b0c55e2f426ccb /src/extra
parent535a79f002c95b9d37ebded4f34c3b225c4c738d (diff)
src: pktb_mangle has signed offset arg so can mangle MAC header with -ve one
- Update prototype - Update doxygen documentation - Update declaration Signed-off-by: Duncan Roe <duncan_roe@optusnet.com.au> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/extra')
-rw-r--r--src/extra/pktbuff.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/extra/pktbuff.c b/src/extra/pktbuff.c
index c4f3da3..6250fbf 100644
--- a/src/extra/pktbuff.c
+++ b/src/extra/pktbuff.c
@@ -299,8 +299,10 @@ static int enlarge_pkt(struct pkt_buff *pkt, unsigned int extra)
/**
* pktb_mangle - adjust contents of a packet
* \param pktb Pointer to userspace packet buffer
- * \param dataoff Offset to layer 4 header. Specify zero to access layer 3 (IP)
- * header (layer 2 for family \b AF_BRIDGE)
+ * \param dataoff Supplementary offset, usually offset from layer 3 (IP) header
+ * to the layer 4 (TCP or UDP) header. Specify zero to access the layer 3
+ * header. If \b pktb was created in family \b AF_BRIDGE, specify
+ * \b -ETH_HLEN (a negative offset) to access the layer 2 (MAC) header.
* \param match_offset Further offset to content that you want to mangle
* \param match_len Length of the existing content you want to mangle
* \param rep_buffer Pointer to data you want to use to replace current content
@@ -316,7 +318,7 @@ static int enlarge_pkt(struct pkt_buff *pkt, unsigned int extra)
*/
EXPORT_SYMBOL
int pktb_mangle(struct pkt_buff *pktb,
- unsigned int dataoff,
+ int dataoff,
unsigned int match_offset,
unsigned int match_len,
const char *rep_buffer,