ipv4: Use standard iovec primitive in raw_probe_proto_opt
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 7 Nov 2014 13:27:08 +0000 (21:27 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:50:45 +0000 (15:50 +0000)
commit9c9c53c5ef6ded65dfc624e3962d5e15f8cfd4c6
treea5c8698c08efc8aad4598a4d2559fe680fcde43d
parent3a70d5ab61400027633a873b9a2d958df39123c8
ipv4: Use standard iovec primitive in raw_probe_proto_opt

commit 32b5913a931fd753faf3d4e1124b2bc2edb364da upstream.

The function raw_probe_proto_opt tries to extract the first two
bytes from the user input in order to seed the IPsec lookup for
ICMP packets.  In doing so it's processing iovec by hand and
overcomplicating things.

This patch replaces the manual iovec processing with a call to
memcpy_fromiovecend.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
net/ipv4/raw.c