Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Patrick McHardy and committed by
David S. Miller
ec464e5d 5683264c

+23 -21
+5 -4
include/linux/netfilter/nfnetlink.h
··· 29 29 extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); 30 30 31 31 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); 36 37 37 38 extern void nfnl_lock(__u8 subsys_id); 38 39 extern void nfnl_unlock(__u8 subsys_id);
+1 -1
include/net/netfilter/nf_conntrack.h
··· 184 184 extern void nf_ct_delete_from_lists(struct nf_conn *ct); 185 185 extern void nf_ct_dying_timeout(struct nf_conn *ct); 186 186 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); 188 188 189 189 extern bool nf_ct_get_tuplepr(const struct sk_buff *skb, 190 190 unsigned int nhoff, u_int16_t l3num,
+2 -2
include/net/netfilter/nf_conntrack_expect.h
··· 88 88 const struct nf_conntrack_tuple *tuple); 89 89 90 90 void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp, 91 - u32 pid, int report); 91 + u32 portid, int report); 92 92 static inline void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) 93 93 { 94 94 nf_ct_unlink_expect_report(exp, 0, 0); ··· 106 106 u_int8_t, const __be16 *, const __be16 *); 107 107 void nf_ct_expect_put(struct nf_conntrack_expect *exp); 108 108 int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, 109 - u32 pid, int report); 109 + u32 portid, int report); 110 110 static inline int nf_ct_expect_related(struct nf_conntrack_expect *expect) 111 111 { 112 112 return nf_ct_expect_related_report(expect, 0, 0);
+4 -4
net/netfilter/nf_conntrack_core.c
··· 1260 1260 EXPORT_SYMBOL_GPL(nf_ct_iterate_cleanup); 1261 1261 1262 1262 struct __nf_ct_flush_report { 1263 - u32 pid; 1263 + u32 portid; 1264 1264 int report; 1265 1265 }; 1266 1266 ··· 1275 1275 1276 1276 /* If we fail to deliver the event, death_by_timeout() will retry */ 1277 1277 if (nf_conntrack_event_report(IPCT_DESTROY, i, 1278 - fr->pid, fr->report) < 0) 1278 + fr->portid, fr->report) < 0) 1279 1279 return 1; 1280 1280 1281 1281 /* Avoid the delivery of the destroy event in death_by_timeout(). */ ··· 1298 1298 } 1299 1299 EXPORT_SYMBOL_GPL(nf_ct_free_hashtable); 1300 1300 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) 1302 1302 { 1303 1303 struct __nf_ct_flush_report fr = { 1304 - .pid = pid, 1304 + .portid = portid, 1305 1305 .report = report, 1306 1306 }; 1307 1307 nf_ct_iterate_cleanup(net, kill_report, &fr);
+4 -4
net/netfilter/nf_conntrack_expect.c
··· 40 40 41 41 /* nf_conntrack_expect helper functions */ 42 42 void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp, 43 - u32 pid, int report) 43 + u32 portid, int report) 44 44 { 45 45 struct nf_conn_help *master_help = nfct_help(exp->master); 46 46 struct net *net = nf_ct_exp_net(exp); ··· 54 54 hlist_del(&exp->lnode); 55 55 master_help->expecting[exp->class]--; 56 56 57 - nf_ct_expect_event_report(IPEXP_DESTROY, exp, pid, report); 57 + nf_ct_expect_event_report(IPEXP_DESTROY, exp, portid, report); 58 58 nf_ct_expect_put(exp); 59 59 60 60 NF_CT_STAT_INC(net, expect_delete); ··· 412 412 } 413 413 414 414 int nf_ct_expect_related_report(struct nf_conntrack_expect *expect, 415 - u32 pid, int report) 415 + u32 portid, int report) 416 416 { 417 417 int ret; 418 418 ··· 425 425 if (ret < 0) 426 426 goto out; 427 427 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); 429 429 return ret; 430 430 out: 431 431 spin_unlock_bh(&nf_conntrack_lock);
+7 -6
net/netfilter/nfnetlink.c
··· 112 112 } 113 113 EXPORT_SYMBOL_GPL(nfnetlink_has_listeners); 114 114 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, 116 116 unsigned int group, int echo, gfp_t flags) 117 117 { 118 - return nlmsg_notify(net->nfnl, skb, pid, group, echo, flags); 118 + return nlmsg_notify(net->nfnl, skb, portid, group, echo, flags); 119 119 } 120 120 EXPORT_SYMBOL_GPL(nfnetlink_send); 121 121 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) 123 123 { 124 - return netlink_set_err(net->nfnl, pid, group, error); 124 + return netlink_set_err(net->nfnl, portid, group, error); 125 125 } 126 126 EXPORT_SYMBOL_GPL(nfnetlink_set_err); 127 127 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) 129 130 { 130 - return netlink_unicast(net->nfnl, skb, pid, flags); 131 + return netlink_unicast(net->nfnl, skb, portid, flags); 131 132 } 132 133 EXPORT_SYMBOL_GPL(nfnetlink_unicast); 133 134