Skip to contentSkip to conversation

: Fix nfnl_queue_msg_get_packetid() return type

LIBNL Applied Patrick McHardy 2 participants 2 messages Jan 24, 2008 – Feb 7, 2008 netfilter

lore
Share & tools
lore
#0 lore raw

This patch is a bugfix on top of my previous libnl patches for nfnetlink_queue support.

commit 06934fe9e4818802d1b3e6099977883416e96677

Author: Patrick McHardy <[email protected]>
Date:   Thu Jan 24 13:27:10 2008 +0100

[LIBNL]: Fix nfnl_queue_msg_get_packetid() return type

The packet-ID is a 32 bit value, but nfnl_queue_msg_get_packetid() returns an uint16_t. Makes queueing fail after 2^16 packets.

include/netlink/netfilter/queue_msg.h +1 -1
index daf7b3c..bb63236 100644
@@ -41,7 +41,7 @@ extern uint8_t			nfnl_queue_msg_get_family(const struct nfnl_queue_msg *);
 
 extern void			nfnl_queue_msg_set_packetid(struct nfnl_queue_msg *, uint32_t);
 extern int			nfnl_queue_msg_test_packetid(const struct nfnl_queue_msg *);
-extern uint16_t			nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *);
+extern uint32_t			nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *);
 
 extern void			nfnl_queue_msg_set_hwproto(struct nfnl_queue_msg *, uint16_t);
 extern int			nfnl_queue_msg_test_hwproto(const struct nfnl_queue_msg *);
lib/netfilter/queue_msg_obj.c +1 -1
index f86d6f6..476d920 100644
@@ -227,7 +227,7 @@ int nfnl_queue_msg_test_packetid(const struct nfnl_queue_msg *msg)
 	return !!(msg->ce_mask & QUEUE_MSG_ATTR_PACKETID);
 }
 
-uint16_t nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *msg)
+uint32_t nfnl_queue_msg_get_packetid(const struct nfnl_queue_msg *msg)
 {
 	return msg->queue_msg_packetid;
 }
Applied
#1 lore raw

* Patrick McHardy <[email protected]> 2008-01-24 13:28

Quoted 6 lines

[LIBNL]: Fix nfnl_queue_msg_get_packetid() return type

The packet-ID is a 32 bit value, but nfnl_queue_msg_get_packetid() returns an uint16_t. Makes queueing fail after 2^16 packets.

Applied, thanks Patrick.