Skip to content

Commit ec464e5

Browse files
kaberdavem330
authored andcommitted
netfilter: rename netlink related "pid" variables to "portid"
Get rid of the confusing mix of pid and portid and use portid consistently for all netlink related socket identities. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5683264 commit ec464e5

6 files changed

Lines changed: 23 additions & 21 deletions

File tree

‎include/linux/netfilter/nfnetlink.h‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n);
2929
extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
3030

3131
extern int nfnetlink_has_listeners(struct net *net, unsigned int group);
32-
extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned int group,
33-
int echo, gfp_t flags);
34-
extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error);
35-
extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags);
32+
extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
33+
unsigned int group, int echo, gfp_t flags);
34+
extern int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error);
35+
extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net,
36+
u32 portid, int flags);
3637

3738
extern void nfnl_lock(__u8 subsys_id);
3839
extern void nfnl_unlock(__u8 subsys_id);

‎include/net/netfilter/nf_conntrack.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ extern int nf_conntrack_hash_check_insert(struct nf_conn *ct);
184184
extern void nf_ct_delete_from_lists(struct nf_conn *ct);
185185
extern void nf_ct_dying_timeout(struct nf_conn *ct);
186186

187-
extern void nf_conntrack_flush_report(struct net *net, u32 pid, int report);
187+
extern void nf_conntrack_flush_report(struct net *net, u32 portid, int report);
188188

189189
extern bool nf_ct_get_tuplepr(const struct sk_buff *skb,
190190
unsigned int nhoff, u_int16_t l3num,

‎include/net/netfilter/nf_conntrack_expect.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ nf_ct_find_expectation(struct net *net, u16 zone,
8888
const struct nf_conntrack_tuple *tuple);
8989

9090
void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp,
91-
u32 pid, int report);
91+
u32 portid, int report);
9292
static inline void nf_ct_unlink_expect(struct nf_conntrack_expect *exp)
9393
{
9494
nf_ct_unlink_expect_report(exp, 0, 0);
@@ -106,7 +106,7 @@ void nf_ct_expect_init(struct nf_conntrack_expect *, unsigned int, u_int8_t,
106106
u_int8_t, const __be16 *, const __be16 *);
107107
void nf_ct_expect_put(struct nf_conntrack_expect *exp);
108108
int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
109-
u32 pid, int report);
109+
u32 portid, int report);
110110
static inline int nf_ct_expect_related(struct nf_conntrack_expect *expect)
111111
{
112112
return nf_ct_expect_related_report(expect, 0, 0);

‎net/netfilter/nf_conntrack_core.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,7 +1260,7 @@ void nf_ct_iterate_cleanup(struct net *net,
12601260
EXPORT_SYMBOL_GPL(nf_ct_iterate_cleanup);
12611261

12621262
struct __nf_ct_flush_report {
1263-
u32 pid;
1263+
u32 portid;
12641264
int report;
12651265
};
12661266

@@ -1275,7 +1275,7 @@ static int kill_report(struct nf_conn *i, void *data)
12751275

12761276
/* If we fail to deliver the event, death_by_timeout() will retry */
12771277
if (nf_conntrack_event_report(IPCT_DESTROY, i,
1278-
fr->pid, fr->report) < 0)
1278+
fr->portid, fr->report) < 0)
12791279
return 1;
12801280

12811281
/* Avoid the delivery of the destroy event in death_by_timeout(). */
@@ -1298,10 +1298,10 @@ void nf_ct_free_hashtable(void *hash, unsigned int size)
12981298
}
12991299
EXPORT_SYMBOL_GPL(nf_ct_free_hashtable);
13001300

1301-
void nf_conntrack_flush_report(struct net *net, u32 pid, int report)
1301+
void nf_conntrack_flush_report(struct net *net, u32 portid, int report)
13021302
{
13031303
struct __nf_ct_flush_report fr = {
1304-
.pid = pid,
1304+
.portid = portid,
13051305
.report = report,
13061306
};
13071307
nf_ct_iterate_cleanup(net, kill_report, &fr);

‎net/netfilter/nf_conntrack_expect.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ static struct kmem_cache *nf_ct_expect_cachep __read_mostly;
4040

4141
/* nf_conntrack_expect helper functions */
4242
void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp,
43-
u32 pid, int report)
43+
u32 portid, int report)
4444
{
4545
struct nf_conn_help *master_help = nfct_help(exp->master);
4646
struct net *net = nf_ct_exp_net(exp);
@@ -54,7 +54,7 @@ void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp,
5454
hlist_del(&exp->lnode);
5555
master_help->expecting[exp->class]--;
5656

57-
nf_ct_expect_event_report(IPEXP_DESTROY, exp, pid, report);
57+
nf_ct_expect_event_report(IPEXP_DESTROY, exp, portid, report);
5858
nf_ct_expect_put(exp);
5959

6060
NF_CT_STAT_INC(net, expect_delete);
@@ -412,7 +412,7 @@ static inline int __nf_ct_expect_check(struct nf_conntrack_expect *expect)
412412
}
413413

414414
int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
415-
u32 pid, int report)
415+
u32 portid, int report)
416416
{
417417
int ret;
418418

@@ -425,7 +425,7 @@ int nf_ct_expect_related_report(struct nf_conntrack_expect *expect,
425425
if (ret < 0)
426426
goto out;
427427
spin_unlock_bh(&nf_conntrack_lock);
428-
nf_ct_expect_event_report(IPEXP_NEW, expect, pid, report);
428+
nf_ct_expect_event_report(IPEXP_NEW, expect, portid, report);
429429
return ret;
430430
out:
431431
spin_unlock_bh(&nf_conntrack_lock);

‎net/netfilter/nfnetlink.c‎

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,22 +112,23 @@ int nfnetlink_has_listeners(struct net *net, unsigned int group)
112112
}
113113
EXPORT_SYMBOL_GPL(nfnetlink_has_listeners);
114114

115-
int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid,
115+
int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 portid,
116116
unsigned int group, int echo, gfp_t flags)
117117
{
118-
return nlmsg_notify(net->nfnl, skb, pid, group, echo, flags);
118+
return nlmsg_notify(net->nfnl, skb, portid, group, echo, flags);
119119
}
120120
EXPORT_SYMBOL_GPL(nfnetlink_send);
121121

122-
int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error)
122+
int nfnetlink_set_err(struct net *net, u32 portid, u32 group, int error)
123123
{
124-
return netlink_set_err(net->nfnl, pid, group, error);
124+
return netlink_set_err(net->nfnl, portid, group, error);
125125
}
126126
EXPORT_SYMBOL_GPL(nfnetlink_set_err);
127127

128-
int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags)
128+
int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u32 portid,
129+
int flags)
129130
{
130-
return netlink_unicast(net->nfnl, skb, pid, flags);
131+
return netlink_unicast(net->nfnl, skb, portid, flags);
131132
}
132133
EXPORT_SYMBOL_GPL(nfnetlink_unicast);
133134

0 commit comments

Comments
 (0)