]> git.baikalelectronics.ru Git - kernel.git/commit
ipv6: add new struct ipcm6_cookie
authorWei Wang <weiwan@google.com>
Tue, 3 May 2016 04:40:07 +0000 (21:40 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 May 2016 20:08:14 +0000 (16:08 -0400)
commit463387d88a8c1cfc5f9e9d2f356f7dc6b75f94ec
tree579b56b3b42598c5db664ef276979ce37b7c6416
parent157ed8c85ab86df77f39cba92007f9a7d2516fbf
ipv6: add new struct ipcm6_cookie

In the sendmsg function of UDP, raw, ICMP and l2tp sockets, we use local
variables like hlimits, tclass, opt and dontfrag and pass them to corresponding
functions like ip6_make_skb, ip6_append_data and xxx_push_pending_frames.
This is not a good practice and makes it hard to add new parameters.
This fix introduces a new struct ipcm6_cookie similar to ipcm_cookie in
ipv4 and include the above mentioned variables. And we only pass the
pointer to this structure to corresponding functions. This makes it easier
to add new parameters in the future and makes the function cleaner.

Signed-off-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/ipv6.h
include/net/transp_v6.h
net/ipv6/datagram.c
net/ipv6/icmp.c
net/ipv6/ip6_flowlabel.c
net/ipv6/ip6_output.c
net/ipv6/ipv6_sockglue.c
net/ipv6/ping.c
net/ipv6/raw.c
net/ipv6/udp.c
net/l2tp/l2tp_ip6.c