Skip to contentSkip to conversation

netlink: Fix portid type in netlink_notify

PATCH Applied Richard Weinberger 3 participants 13 messages Apr 12, 2015 – Apr 13, 2015

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v4 1/5 netlink: Fix portid type in netlink_notify

portid is an unsigned integer. Fix netlink_notify to match all other portid user in the kernel.

---
 include/linux/netlink.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/netlink.h +1 -1
index 02fc86d..6835c12 100644
@@ -134,7 +134,7 @@ struct netlink_callback {
 
 struct netlink_notify {
 	struct net *net;
-	int portid;
+	u32 portid;
 	int protocol;
 };
 
Signature · 1 line
1.8.4.5
#1 lore raw

PATCH v4 2/5 nfc: Fix portid type in urelease_work

portid is an unsigned integer. Fix urelease_work to match all other portid user in the kernel.

---
 net/nfc/netlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/nfc/netlink.c +1 -1
index 14a2d11..3763036 100644
@@ -1584,7 +1584,7 @@ static const struct genl_ops nfc_genl_ops[] = {
 
 struct urelease_work {
 	struct	work_struct w;
-	int	portid;
+	u32	portid;
 };
 
 static void nfc_urelease_event_work(struct work_struct *work)
Signature · 1 line
1.8.4.5
maintainer
#2 lore raw

Re: [PATCH 2/5 v4] nfc: Fix portid type in urelease_work

From: Richard Weinberger <richard-/[email protected]>
Date: Mon, 13 Apr 2015 00:52:36 +0200

Quoted 4 lines

portid is an unsigned integer. Fix urelease_work to match all other portid user in the kernel.

Applied.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

PATCH v4 3/5 netfilter: Fix portid types

In reply to Richard Weinberger

The netlink portid is an unsigned integer, use this type also in netfilter.

---
 net/netfilter/nfnetlink_log.c        | 4 ++--
 net/netfilter/nfnetlink_queue_core.c | 7 +++----
 2 files changed, 5 insertions(+), 6 deletions(-)
net/netfilter/nfnetlink_log.c +2 -2
index 51afea4..5c79735 100644
@@ -63,7 +63,7 @@ struct nfulnl_instance {
 	struct timer_list timer;
 	struct net *net;
 	struct user_namespace *peer_user_ns;	/* User namespace of the peer process */
-	int peer_portid;			/* PORTID of the peer process */
+	u32 peer_portid;		/* PORTID of the peer process */
 
 	/* configurable parameters */
 	unsigned int flushtimeout;	/* timeout until queue flush */
@@ -152,7 +152,7 @@ static void nfulnl_timer(unsigned long data);
 
 static struct nfulnl_instance *
 instance_create(struct net *net, u_int16_t group_num,
-		int portid, struct user_namespace *user_ns)
+		u32 portid, struct user_namespace *user_ns)
 {
 	struct nfulnl_instance *inst;
 	struct nfnl_log_net *log = nfnl_log_pernet(net);
net/netfilter/nfnetlink_queue_core.c +3 -4
index 628afc3..49267f8 100644
@@ -55,7 +55,7 @@ struct nfqnl_instance {
 	struct hlist_node hlist;		/* global list of queues */
 	struct rcu_head rcu;
 
-	int peer_portid;
+	u32 peer_portid;
 	unsigned int queue_maxlen;
 	unsigned int copy_range;
 	unsigned int queue_dropped;
@@ -110,8 +110,7 @@ instance_lookup(struct nfnl_queue_net *q, u_int16_t queue_num)
 }
 
 static struct nfqnl_instance *
-instance_create(struct nfnl_queue_net *q, u_int16_t queue_num,
-		int portid)
+instance_create(struct nfnl_queue_net *q, u_int16_t queue_num, u32 portid)
 {
 	struct nfqnl_instance *inst;
 	unsigned int h;
@@ -870,7 +869,7 @@ static const struct nla_policy nfqa_verdict_batch_policy[NFQA_MAX+1] = {
 };
 
 static struct nfqnl_instance *
-verdict_instance_lookup(struct nfnl_queue_net *q, u16 queue_num, int nlportid)
+verdict_instance_lookup(struct nfnl_queue_net *q, u16 queue_num, u32 nlportid)
 {
 	struct nfqnl_instance *queue;
 
Signature · 1 line
1.8.4.5
#6 lore raw

PATCH v4 4/5 netfilter: Fix format string of nfnetlink_queue proc file

In reply to Richard Weinberger

The printed values are all of type unsigned integer, therefore use %u instead of %d. Otherwise an user can face negative values.

Fixes:

$ cat /proc/net/netfilter/nfnetlink_queue
    0  29508   278 2 65531     0 2004213241 -2129885586  1
    1 -27747     0 2 65531     0     0        0  1
    2 -27748     0 2 65531     0     0        0  1
---
 net/netfilter/nfnetlink_queue_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_queue_core.c +1 -1
index 49267f8..0b98c74 100644
@@ -1251,7 +1251,7 @@ static int seq_show(struct seq_file *s, void *v)
 {
 	const struct nfqnl_instance *inst = v;
 
-	seq_printf(s, "%5d %6d %5d %1d %5d %5d %5d %8d %2d\n",
+	seq_printf(s, "%5u %6u %5u %1u %5u %5u %5u %8u %2d\n",
 		   inst->queue_num,
 		   inst->peer_portid, inst->queue_total,
 		   inst->copy_mode, inst->copy_range,
Signature · 1 line
1.8.4.5
maintainer Acked-by on v4 4/5
#7 lore raw

Re: [PATCH 4/5 v4] netfilter: Fix format string of nfnetlink_queue proc file

Quoted 10 lines · Richard Weinberger

The printed values are all of type unsigned integer, therefore use %u instead of %d. Otherwise an user can face negative values.

Fixes:

$ cat /proc/net/netfilter/nfnetlink_queue
    0  29508   278 2 65531     0 2004213241 -2129885586  1
    1 -27747     0 2 65531     0     0        0  1
    2 -27748     0 2 65531     0     0        0  1
maintainer Applied
#8 lore raw

Re: [PATCH 4/5 v4] netfilter: Fix format string of nfnetlink_queue proc file

In reply to Richard Weinberger

From: Richard Weinberger <[email protected]>
Date: Mon, 13 Apr 2015 00:52:38 +0200

Quoted 10 lines

The printed values are all of type unsigned integer, therefore use %u instead of %d. Otherwise an user can face negative values.

Fixes:

$ cat /proc/net/netfilter/nfnetlink_queue
    0  29508   278 2 65531     0 2004213241 -2129885586  1
    1 -27747     0 2 65531     0     0        0  1
    2 -27748     0 2 65531     0     0        0  1

Applied.

#9 lore raw

PATCH v4 5/5 netfilter: Fix format string of nfnetlink_log proc file

In reply to Richard Weinberger

The printed values are all of type unsigned integer, therefore use %u instead of %d. Otherwise an user can face negative values.

---
 net/netfilter/nfnetlink_log.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nfnetlink_log.c +1 -1
index 5c79735..3ad9126 100644
@@ -1007,7 +1007,7 @@ static int seq_show(struct seq_file *s, void *v)
 {
 	const struct nfulnl_instance *inst = v;
 
-	seq_printf(s, "%5d %6d %5d %1d %5d %6d %2d\n",
+	seq_printf(s, "%5u %6u %5u %1u %5u %6u %2u\n",
 		   inst->group_num,
 		   inst->peer_portid, inst->qlen,
 		   inst->copy_mode, inst->copy_range,
Signature · 1 line
1.8.4.5