🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Frank Dressler Sun, 22 Nov 2026 03:36
[PATCH iproute2-next] ss: build the socket cookie with a single shift
#20335
Author: Frank Dressler
Date: Sun, 22 Nov 2026 03:36
26 lines
8857 bytes
The split shift was necessary only while the code used unsigned long.
2e7e805d0aac ("ss: better 32bit support") changed it to unsigned long long.

Signed-off-by: Frank Dressler <frank@dressler.pro>
---
 misc/ss.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/misc/ss.c b/misc/ss.c
index f4160f59b1ea..5107d42ac229 100644
--- a/misc/ss.c
+++ b/misc/ss.c
@@ -795,7 +795,7 @@ next:
 
 static unsigned long long cookie_sk_get(const uint32_t *cookie)
 {
-	return (((unsigned long long)cookie[1] << 31) << 1) | cookie[0];
+	return ((unsigned long long)cookie[1] << 32) | cookie[0];
 }
 
 /* Names indexed by a value from the kernel, which may be out of range */

base-commit: 9eee7bb80f98a0789639ccdb0d68a667962e16d6
-- 
2.56.1
Re: [PATCH iproute2-next] ss: build the socket cookie with a single shift
#22099
Author: Stephen Hemminger
Date: Tue, 24 Nov 2026 21:40
30 lines
11828 bytes
On Sun, 22 Nov 2026 03:36:57 +0000
Frank Dressler <frank@dressler.pro> wrote:

> The split shift was necessary only while the code used unsigned long.
> 2e7e805d0aac ("ss: better 32bit support") changed it to unsigned long long.
> 
> Signed-off-by: Frank Dressler <frank@dressler.pro>
> ---
>  misc/ss.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/misc/ss.c b/misc/ss.c
> index f4160f59b1ea..5107d42ac229 100644
> --- a/misc/ss.c
> +++ b/misc/ss.c
> @@ -795,7 +795,7 @@ next:
>  
>  static unsigned long long cookie_sk_get(const uint32_t *cookie)
>  {
> -	return (((unsigned long long)cookie[1] << 31) << 1) | cookie[0];
> +	return ((unsigned long long)cookie[1] << 32) | cookie[0];
>  }
>  
>  /* Names indexed by a value from the kernel, which may be out of range */
> 
> base-commit: 9eee7bb80f98a0789639ccdb0d68a667962e16d6


LGTM but I refactored ss into multiple files. So will need fix after rebase
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads