lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:	Mon, 2 Feb 2009 14:37:38 +0900
From:	Maoke Chen <fibrib@...il.com>
To:	linux-kernel@...r.kernel.org
Subject: protocol lookup tables


hi,

i'm a new comer in the Linux kernel programming. now we are doing  
something with socket system calls and related data structures. i'm a  
little confused with the concept "protocol lookup tables", because in  
the sock.h, there are several protocol lookup tables involved with the  
sock_common structure:

struct sock_common {
	unsigned short		skc_family;
	volatile unsigned char	skc_state;
	unsigned char		skc_reuse;
	int			skc_bound_dev_if;
	struct hlist_node	skc_node;
	struct hlist_node	skc_bind_node;
	atomic_t		skc_refcnt;
	unsigned int		skc_hash;
	struct proto		*skc_prot;
#ifdef CONFIG_NET_NS
	struct net		*skc_net;
#endif
};

the comment lines stated that the @skc_node stands for "main hash  
linkage for various protocol tables", while the @skc_bind_node for the  
"bind hash linkage for various protocol lookup tables", and so my  
question is: what is the difference between the "main hash" and the  
"bind hash"?

another related question is: what is the relationship between the sock  
data structure and the the bind bucket (tb)? how are they playing the  
role in the interactions between socket library and the protocol stack?

thanks and regards,
maoke

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ