Skip to content

Commit 3db05fe

Browse files
herbertxDavid S. Miller
authored andcommitted
[NETFILTER]: Replace sk_buff ** with sk_buff *
With all the users of the double pointers removed, this patch mops up by finally replacing all occurances of sk_buff ** in the netfilter API by sk_buff *. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2ca7b0a commit 3db05fe

115 files changed

Lines changed: 915 additions & 951 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎include/linux/if_bridge.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct __fdb_entry
107107
extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
108108
extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p,
109109
struct sk_buff *skb);
110-
extern int (*br_should_route_hook)(struct sk_buff **pskb);
110+
extern int (*br_should_route_hook)(struct sk_buff *skb);
111111

112112
#endif
113113

‎include/linux/netfilter.h‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct sk_buff;
5151
struct net_device;
5252

5353
typedef unsigned int nf_hookfn(unsigned int hooknum,
54-
struct sk_buff **skb,
54+
struct sk_buff *skb,
5555
const struct net_device *in,
5656
const struct net_device *out,
5757
int (*okfn)(struct sk_buff *));
@@ -183,7 +183,7 @@ void nf_log_packet(int pf,
183183
struct nf_loginfo *li,
184184
const char *fmt, ...);
185185

186-
int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb,
186+
int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb,
187187
struct net_device *indev, struct net_device *outdev,
188188
int (*okfn)(struct sk_buff *), int thresh);
189189

@@ -195,7 +195,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff **pskb,
195195
* value indicates the packet has been consumed by the hook.
196196
*/
197197
static inline int nf_hook_thresh(int pf, unsigned int hook,
198-
struct sk_buff **pskb,
198+
struct sk_buff *skb,
199199
struct net_device *indev,
200200
struct net_device *outdev,
201201
int (*okfn)(struct sk_buff *), int thresh,
@@ -207,14 +207,14 @@ static inline int nf_hook_thresh(int pf, unsigned int hook,
207207
if (list_empty(&nf_hooks[pf][hook]))
208208
return 1;
209209
#endif
210-
return nf_hook_slow(pf, hook, pskb, indev, outdev, okfn, thresh);
210+
return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh);
211211
}
212212

213-
static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
213+
static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
214214
struct net_device *indev, struct net_device *outdev,
215215
int (*okfn)(struct sk_buff *))
216216
{
217-
return nf_hook_thresh(pf, hook, pskb, indev, outdev, okfn, INT_MIN, 1);
217+
return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1);
218218
}
219219

220220
/* Activate hook; either okfn or kfree_skb called, unless a hook
@@ -241,13 +241,13 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
241241

242242
#define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \
243243
({int __ret; \
244-
if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, thresh, 1)) == 1)\
244+
if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\
245245
__ret = (okfn)(skb); \
246246
__ret;})
247247

248248
#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \
249249
({int __ret; \
250-
if ((__ret=nf_hook_thresh(pf, hook, &(skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\
250+
if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\
251251
__ret = (okfn)(skb); \
252252
__ret;})
253253

@@ -317,7 +317,7 @@ struct nf_afinfo {
317317
unsigned int dataoff, u_int8_t protocol);
318318
void (*saveroute)(const struct sk_buff *skb,
319319
struct nf_info *info);
320-
int (*reroute)(struct sk_buff **skb,
320+
int (*reroute)(struct sk_buff *skb,
321321
const struct nf_info *info);
322322
int route_key_size;
323323
};
@@ -371,15 +371,15 @@ extern struct proc_dir_entry *proc_net_netfilter;
371371
#define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb)
372372
#define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb)
373373
static inline int nf_hook_thresh(int pf, unsigned int hook,
374-
struct sk_buff **pskb,
374+
struct sk_buff *skb,
375375
struct net_device *indev,
376376
struct net_device *outdev,
377377
int (*okfn)(struct sk_buff *), int thresh,
378378
int cond)
379379
{
380-
return okfn(*pskb);
380+
return okfn(skb);
381381
}
382-
static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb,
382+
static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb,
383383
struct net_device *indev, struct net_device *outdev,
384384
int (*okfn)(struct sk_buff *))
385385
{

‎include/linux/netfilter/nf_conntrack_amanda.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#define _NF_CONNTRACK_AMANDA_H
33
/* AMANDA tracking. */
44

5-
extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff **pskb,
5+
extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff *skb,
66
enum ip_conntrack_info ctinfo,
77
unsigned int matchoff,
88
unsigned int matchlen,

‎include/linux/netfilter/nf_conntrack_ftp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct nf_conntrack_expect;
3232

3333
/* For NAT to hook in when we find a packet which describes what other
3434
* connection we should expect. */
35-
extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb,
35+
extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff *skb,
3636
enum ip_conntrack_info ctinfo,
3737
enum nf_ct_ftp_type type,
3838
unsigned int matchoff,

‎include/linux/netfilter/nf_conntrack_h323.h‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,52 +36,52 @@ extern void nf_conntrack_h245_expect(struct nf_conn *new,
3636
struct nf_conntrack_expect *this);
3737
extern void nf_conntrack_q931_expect(struct nf_conn *new,
3838
struct nf_conntrack_expect *this);
39-
extern int (*set_h245_addr_hook) (struct sk_buff **pskb,
39+
extern int (*set_h245_addr_hook) (struct sk_buff *skb,
4040
unsigned char **data, int dataoff,
4141
H245_TransportAddress *taddr,
4242
union nf_conntrack_address *addr,
4343
__be16 port);
44-
extern int (*set_h225_addr_hook) (struct sk_buff **pskb,
44+
extern int (*set_h225_addr_hook) (struct sk_buff *skb,
4545
unsigned char **data, int dataoff,
4646
TransportAddress *taddr,
4747
union nf_conntrack_address *addr,
4848
__be16 port);
49-
extern int (*set_sig_addr_hook) (struct sk_buff **pskb,
49+
extern int (*set_sig_addr_hook) (struct sk_buff *skb,
5050
struct nf_conn *ct,
5151
enum ip_conntrack_info ctinfo,
5252
unsigned char **data,
5353
TransportAddress *taddr, int count);
54-
extern int (*set_ras_addr_hook) (struct sk_buff **pskb,
54+
extern int (*set_ras_addr_hook) (struct sk_buff *skb,
5555
struct nf_conn *ct,
5656
enum ip_conntrack_info ctinfo,
5757
unsigned char **data,
5858
TransportAddress *taddr, int count);
59-
extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb,
59+
extern int (*nat_rtp_rtcp_hook) (struct sk_buff *skb,
6060
struct nf_conn *ct,
6161
enum ip_conntrack_info ctinfo,
6262
unsigned char **data, int dataoff,
6363
H245_TransportAddress *taddr,
6464
__be16 port, __be16 rtp_port,
6565
struct nf_conntrack_expect *rtp_exp,
6666
struct nf_conntrack_expect *rtcp_exp);
67-
extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct,
67+
extern int (*nat_t120_hook) (struct sk_buff *skb, struct nf_conn *ct,
6868
enum ip_conntrack_info ctinfo,
6969
unsigned char **data, int dataoff,
7070
H245_TransportAddress *taddr, __be16 port,
7171
struct nf_conntrack_expect *exp);
72-
extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct,
72+
extern int (*nat_h245_hook) (struct sk_buff *skb, struct nf_conn *ct,
7373
enum ip_conntrack_info ctinfo,
7474
unsigned char **data, int dataoff,
7575
TransportAddress *taddr, __be16 port,
7676
struct nf_conntrack_expect *exp);
77-
extern int (*nat_callforwarding_hook) (struct sk_buff **pskb,
77+
extern int (*nat_callforwarding_hook) (struct sk_buff *skb,
7878
struct nf_conn *ct,
7979
enum ip_conntrack_info ctinfo,
8080
unsigned char **data, int dataoff,
8181
TransportAddress *taddr,
8282
__be16 port,
8383
struct nf_conntrack_expect *exp);
84-
extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct,
84+
extern int (*nat_q931_hook) (struct sk_buff *skb, struct nf_conn *ct,
8585
enum ip_conntrack_info ctinfo,
8686
unsigned char **data, TransportAddress *taddr,
8787
int idx, __be16 port,

‎include/linux/netfilter/nf_conntrack_irc.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
#define IRC_PORT 6667
77

8-
extern unsigned int (*nf_nat_irc_hook)(struct sk_buff **pskb,
8+
extern unsigned int (*nf_nat_irc_hook)(struct sk_buff *skb,
99
enum ip_conntrack_info ctinfo,
1010
unsigned int matchoff,
1111
unsigned int matchlen,

‎include/linux/netfilter/nf_conntrack_pptp.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,13 +301,13 @@ struct nf_conn;
301301
struct nf_conntrack_expect;
302302

303303
extern int
304-
(*nf_nat_pptp_hook_outbound)(struct sk_buff **pskb,
304+
(*nf_nat_pptp_hook_outbound)(struct sk_buff *skb,
305305
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
306306
struct PptpControlHeader *ctlh,
307307
union pptp_ctrl_union *pptpReq);
308308

309309
extern int
310-
(*nf_nat_pptp_hook_inbound)(struct sk_buff **pskb,
310+
(*nf_nat_pptp_hook_inbound)(struct sk_buff *skb,
311311
struct nf_conn *ct, enum ip_conntrack_info ctinfo,
312312
struct PptpControlHeader *ctlh,
313313
union pptp_ctrl_union *pptpReq);

‎include/linux/netfilter/nf_conntrack_sip.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ enum sip_header_pos {
2121
POS_SDP_HEADER,
2222
};
2323

24-
extern unsigned int (*nf_nat_sip_hook)(struct sk_buff **pskb,
24+
extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb,
2525
enum ip_conntrack_info ctinfo,
2626
struct nf_conn *ct,
2727
const char **dptr);
28-
extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff **pskb,
28+
extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb,
2929
enum ip_conntrack_info ctinfo,
3030
struct nf_conntrack_expect *exp,
3131
const char *dptr);

‎include/linux/netfilter/nf_conntrack_tftp.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ struct tftphdr {
1313
#define TFTP_OPCODE_ACK 4
1414
#define TFTP_OPCODE_ERROR 5
1515

16-
extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff **pskb,
16+
extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff *skb,
1717
enum ip_conntrack_info ctinfo,
1818
struct nf_conntrack_expect *exp);
1919

‎include/linux/netfilter/x_tables.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ struct xt_target
191191
/* Returns verdict. Argument order changed since 2.6.9, as this
192192
must now handle non-linear skbs, using skb_copy_bits and
193193
skb_ip_make_writable. */
194-
unsigned int (*target)(struct sk_buff **pskb,
194+
unsigned int (*target)(struct sk_buff *skb,
195195
const struct net_device *in,
196196
const struct net_device *out,
197197
unsigned int hooknum,

0 commit comments

Comments
 (0)