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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 25 Apr 2014 19:19:09 +0200
From:	Hannes Frederic Sowa <hannes@...essinduktion.org>
To:	David Miller <davem@...emloft.net>
Cc:	David.Laight@...LAB.COM, lorenzo@...gle.com,
	netdev@...r.kernel.org, yoshfuji@...ux-ipv6.org,
	eric.dumazet@...il.com
Subject: Re: [PATCH net-next v5 1/3] net: ipv6: Unduplicate {raw,udp}v6_sendmsg code

On Fri, Apr 25, 2014 at 12:51:55PM -0400, David Miller wrote:
> From: David Laight <David.Laight@...LAB.COM>
> Date: Fri, 25 Apr 2014 11:24:21 +0000
> 
> > From: Lorenzo Colitti
> >> rawv6_sendmsg and udpv6_sendmsg have ~100 lines of almost
> >> identical code. Move this into a new ipv6_datagram_send_common
> >> helper function.
> >> 
> >> Tested: black-box tested using user-mode Linux.
> >> 
> >> - Basic UDP sends using sendto work.
> >> - Mark routing and oif routing using SO_BINDTODEVICE work.
> > ...
> >> diff --git a/include/net/ipv6.h b/include/net/ipv6.h
> >> index d640925..f1a247a 100644
> >> --- a/include/net/ipv6.h
> >> +++ b/include/net/ipv6.h
> >> @@ -785,6 +785,13 @@ int compat_ipv6_getsockopt(struct sock *sk, int level, int optname,
> >>  int ip6_datagram_connect(struct sock *sk, struct sockaddr *addr, int addr_len);
> >>  int ip6_datagram_connect_v6_only(struct sock *sk, struct sockaddr *addr,
> >>  				 int addr_len);
> >> +int ip6_datagram_send_common(struct sock *sk, struct msghdr *msg,
> >> +			     struct sockaddr_in6 *sin6, int addr_len,
> >> +			     struct flowi6 *fl6, struct dst_entry **dstp,
> >> +			     struct ipv6_txoptions **optp,
> >> +			     struct ipv6_txoptions *opt_space,
> >> +			     int *hlimit, int *tclass, int *dontfrag,
> >> +			     int *connected);
> > 
> > That is a lot of parameters! and udp send is probably an important path.
> 
> The more I read this series the more I dislike it.
> 
> All of these pointers being passed in, were local variables in the
> original code.
> 
> This consolidation makes the code much worse, not better.

Maybe we can put all those hlimit, tclass, dontfrag vars into a struct
and just pass one pointer.

Also it could be possible to just do that by value if return slot optimization
in gcc optimizes that away.

Greetings,

  Hannes

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ