netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used
@ 2022-11-17  5:33 Lai Peter Jun Ann
  2022-11-17 16:35 ` Stephen Hemminger
  2022-11-23 17:00 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Lai Peter Jun Ann @ 2022-11-17  5:33 UTC (permalink / raw)
  To: netdev
  Cc: David Ahern, Stephen Hemminger, Vinicius Costa Gomes,
	Jamal Hadi Salim, Cong Wang, Jiri Pirko,
	Muhammad Husaini Zulkifli, Lai Peter Jun Ann

This patch is to fix the issue where there is no error return
when large value of parent ID is being used. The return value by
stroul() is unsigned long int. Hence the datatype for maj and min
should defined as unsigned long to avoid overflow issue.

Signed-off-by: Muhammad Husaini Zulkifli <muhammad.husaini.zulkifli@intel.com>
Signed-off-by: Lai Peter Jun Ann <jun.ann.lai@intel.com>
---
 tc/tc_util.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tc/tc_util.c b/tc/tc_util.c
index 44137ad..334334d 100644
--- a/tc/tc_util.c
+++ b/tc/tc_util.c
@@ -93,7 +93,7 @@ ok:
 
 int get_tc_classid(__u32 *h, const char *str)
 {
-	__u32 maj, min;
+	unsigned long maj, min;
 	char *p;
 
 	maj = TC_H_ROOT;
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-11-23 17:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-17  5:33 [PATCH iproute2-next v1] tc_util: Fix no error return when large parent id used Lai Peter Jun Ann
2022-11-17 16:35 ` Stephen Hemminger
2022-11-21  2:26   ` Lai, Peter Jun Ann
2022-11-23 17:00 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).