From: Chen Gang <gang.chen@asianux.com>
To: horms@verge.net.au
Cc: David Miller <davem@davemloft.net>, netdev <netdev@vger.kernel.org>
Subject: [Regression net-next] include/linux/skbuff.h: "1a37e41 net: Use 16bits for *_headers fields of struct skbuff"
Date: Thu, 30 May 2013 19:21:17 +0800 [thread overview]
Message-ID: <51A7362D.4070501@asianux.com> (raw)
Hello Maintainers:
When not define NET_SKBUFF_DATA_USES_OFFSET, 'sk_buff_data_t' will be a
pointer, then the last parameter of memmove() in mangle_contents() will
be a pointer in "net/netfilter/nf_nat_helper.c".
The reason is from the patch "1a37e41 net: Use 16bits for *_headers
fields of struct skbuff", it changed the type of 'skb->network_header'
for saving size, it needs additional improvement.
The related warning (make EXTRA_CFLAGS=-W ARCH=m68k allmodconfig):
arch/m68k/include/asm/string.h:61:14: note: expected ‘__kernel_size_t’ but argument is of type ‘sk_buff_data_t’
in "net/netfilter/nf_nat_helper.c"
91 /* Frobs data inside this packet, which is linear. */
92 static void mangle_contents(struct sk_buff *skb,
93 unsigned int dataoff,
94 unsigned int match_offset,
95 unsigned int match_len,
96 const char *rep_buffer,
97 unsigned int rep_len)
98 {
99 unsigned char *data;
100
101 BUG_ON(skb_is_nonlinear(skb));
102 data = skb_network_header(skb) + dataoff;
103
104 /* move post-replacement */
105 memmove(data + match_offset + rep_len,
106 data + match_offset + match_len,
107 skb->tail - (skb->network_header + dataoff +
108 match_offset + match_len));
109
in "include/linux/skbuff.h":
409 struct sk_buff {
410 /* These two members must be first. */
411 struct sk_buff *next;
412 struct sk_buff *prev;
413
414 ktime_t tstamp;
415
416 struct sock *sk;
417 struct net_device *dev;
418
...
515 __be16 inner_protocol;
516 __u16 inner_transport_header;
517 __u16 inner_network_header;
518 __u16 inner_mac_header;
519 __u16 transport_header;
520 __u16 network_header;
521 __u16 mac_header;
522 /* These elements must be at the end, see alloc_skb() for details. */
523 sk_buff_data_t tail;
524 sk_buff_data_t end;
525 unsigned char *head,
526 *data;
527 unsigned int truesize;
528 atomic_t users;
529 };
530
next reply other threads:[~2013-05-30 11:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-30 11:21 Chen Gang [this message]
2013-05-30 23:48 ` [Regression net-next] include/linux/skbuff.h: "1a37e41 net: Use 16bits for *_headers fields of struct skbuff" Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51A7362D.4070501@asianux.com \
--to=gang.chen@asianux.com \
--cc=davem@davemloft.net \
--cc=horms@verge.net.au \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.