Re: [PATCHv2 2.6.17] net/ipv6/udp.c: remove duplicate udp_get_port code
From: [EMAIL PROTECTED] Date: Thu, 17 Aug 2006 13:25:46 +0100 [NET]: UDPv4 and UDPv6 use an almost identical version of the get_port function, which is unnecessary since the (long) code differs in only one if-statement. This patch creates one common function which is called by udp_v4_get_port() and udp_v6_get_port(). As a result, * duplicated code is removed * udp_port_rover and local port lookup can now be removed from udp.h * further savings follow since the same function will be used by UDP-Litev4 and UDP-Litev6 In contrast to the patch sent in response to Yoshifujis comments (fixed by this variant), the code below also removes the EXPORT_SYMBOL(udp_port_rover), since udp_port_rover can now remain local to net/ipv4/udp.c. Signed-off-by: Gerrit Renker [EMAIL PROTECTED] Applied, and I marked udp_port_rover static for good measure. Thanks. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 2.6.17] net/ipv6/udp.c: remove duplicate udp_get_port code
Hi, In article [EMAIL PROTECTED] (at Thu, 17 Aug 2006 10:56:40 -0400 (EDT)), James Morris [EMAIL PROTECTED] says: On Thu, 17 Aug 2006, [EMAIL PROTECTED] wrote: - if (inet2-num == snum - sk2 != sk - !ipv6_only_sock(sk2) - (!sk2-sk_bound_dev_if || -!sk-sk_bound_dev_if || -sk2-sk_bound_dev_if == sk-sk_bound_dev_if) + sk_for_each(sk2, node, head) + if (inet_sk(sk2)-num == snum + sk2 != sk + (!sk2-sk_reuse|| !sk-sk_reuse) + (!sk2-sk_bound_dev_if || !sk-sk_bound_dev_if +|| sk2-sk_bound_dev_if == sk-sk_bound_dev_if) Doesn't this change the behavior for IPV6_V6ONLY sockets ? It is tested in ipv4_rcv_saddr_equal() (called vi saddr_cmp), isn't it? --yoshfuji - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCHv2 2.6.17] net/ipv6/udp.c: remove duplicate udp_get_port code
On Thu, 17 Aug 2006, [EMAIL PROTECTED] wrote: - if (inet2-num == snum - sk2 != sk - !ipv6_only_sock(sk2) - (!sk2-sk_bound_dev_if || - !sk-sk_bound_dev_if || - sk2-sk_bound_dev_if == sk-sk_bound_dev_if) + sk_for_each(sk2, node, head) + if (inet_sk(sk2)-num == snum + sk2 != sk + (!sk2-sk_reuse|| !sk-sk_reuse) + (!sk2-sk_bound_dev_if || !sk-sk_bound_dev_if + || sk2-sk_bound_dev_if == sk-sk_bound_dev_if) Doesn't this change the behavior for IPV6_V6ONLY sockets ? - James -- James Morris [EMAIL PROTECTED] - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html