Thread (14 messages) flat view 14 messages, 2 authors, 2018-06-30

Re: [net-next PATCH v5 3/7] net: sock: Change tx_queue_mapping in sock_common to unsigned short

From: David Miller <davem@davemloft.net>
Date: 2018-06-29 13:05:15

From: Amritha Nambiar <redacted>
Date: Wed, 27 Jun 2018 15:31:28 -0700
quoted hunk ↗ jump to hunk
@@ -1681,17 +1681,25 @@ static inline int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
 
 static inline void sk_tx_queue_set(struct sock *sk, int tx_queue)
 {
+	/* sk_tx_queue_mapping accept only upto a 16-bit value */
+	if (WARN_ON_ONCE((unsigned short)tx_queue > USHRT_MAX))
+		return;
 	sk->sk_tx_queue_mapping = tx_queue;
 }
 
+#define NO_QUEUE_MAPPING	USHRT_MAX
I think you need to check ">= USHRT_MAX" since USHRT_MAX is how you
indicate no queue.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help