Patch "l2tp: Fix build warning with ipv6 disabled." has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    l2tp: Fix build warning with ipv6 disabled.

to the 3.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     l2tp-fix-build-warning-with-ipv6-disabled.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From ab0191a681ea440154e2919ab57f7ffa881ab22e Mon Sep 17 00:00:00 2001
From: "David S. Miller" <davem@xxxxxxxxxxxxx>
Date: Tue, 8 Oct 2013 15:44:26 -0400
Subject: l2tp: Fix build warning with ipv6 disabled.

From: "David S. Miller" <davem@xxxxxxxxxxxxx>

[ Upstream commit 8d8a51e26a6d415e1470759f2cf5f3ee3ee86196 ]

net/l2tp/l2tp_core.c: In function ‘l2tp_verify_udp_checksum’:
net/l2tp/l2tp_core.c:499:22: warning: unused variable ‘tunnel’ [-Wunused-variable]

Create a helper "l2tp_tunnel()" to facilitate this, and as a side
effect get rid of a bunch of unnecessary void pointer casts.

Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 net/l2tp/l2tp_core.c |   13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -115,6 +115,11 @@ struct l2tp_net {
 static void l2tp_session_set_header_len(struct l2tp_session *session, int version);
 static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel);
 
+static inline struct l2tp_tunnel *l2tp_tunnel(struct sock *sk)
+{
+	return sk->sk_user_data;
+}
+
 static inline struct l2tp_net *l2tp_pernet(struct net *net)
 {
 	BUG_ON(!net);
@@ -499,7 +504,6 @@ out:
 static inline int l2tp_verify_udp_checksum(struct sock *sk,
 					   struct sk_buff *skb)
 {
-	struct l2tp_tunnel *tunnel = (struct l2tp_tunnel *)sk->sk_user_data;
 	struct udphdr *uh = udp_hdr(skb);
 	u16 ulen = ntohs(uh->len);
 	__wsum psum;
@@ -508,7 +512,7 @@ static inline int l2tp_verify_udp_checks
 		return 0;
 
 #if IS_ENABLED(CONFIG_IPV6)
-	if (sk->sk_family == PF_INET6 && !tunnel->v4mapped) {
+	if (sk->sk_family == PF_INET6 && !l2tp_tunnel(sk)->v4mapped) {
 		if (!uh->check) {
 			LIMIT_NETDEBUG(KERN_INFO "L2TP: IPv6: checksum is 0\n");
 			return 1;
@@ -1248,10 +1252,9 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb);
  */
 static void l2tp_tunnel_destruct(struct sock *sk)
 {
-	struct l2tp_tunnel *tunnel;
+	struct l2tp_tunnel *tunnel = l2tp_tunnel(sk);
 	struct l2tp_net *pn;
 
-	tunnel = sk->sk_user_data;
 	if (tunnel == NULL)
 		goto end;
 
@@ -1619,7 +1622,7 @@ int l2tp_tunnel_create(struct net *net,
 	}
 
 	/* Check if this socket has already been prepped */
-	tunnel = (struct l2tp_tunnel *)sk->sk_user_data;
+	tunnel = l2tp_tunnel(sk);
 	if (tunnel != NULL) {
 		/* This socket has already been prepped */
 		err = -EBUSY;


Patches currently in stable-queue which might be from davem@xxxxxxxxxxxxx are

queue-3.10/tcp-tsq-can-use-a-dynamic-limit.patch
queue-3.10/net-dst-provide-accessor-function-to-dst-xfrm.patch
queue-3.10/net-vlan-fix-nlmsg-size-calculation-in-vlan_get_size.patch
queue-3.10/vti-get-rid-of-nf-mark-rule-in-prerouting.patch
queue-3.10/bridge-correctly-clamp-max-forward_delay-when-enabling-stp.patch
queue-3.10/ipv4-fix-ineffective-source-address-selection.patch
queue-3.10/sctp-use-software-crc32-checksum-when-xfrm-transform-will-happen.patch
queue-3.10/can-dev-fix-nlmsg-size-calculation-in-can_get_size.patch
queue-3.10/net-heap-overflow-in-__audit_sockaddr.patch
queue-3.10/ipv6-always-prefer-rt6i_gateway-if-present.patch
queue-3.10/net-unix-inherit-sock_pass-cred-sec-flags-from-socket-to-fix-race.patch
queue-3.10/net-do-not-call-sock_put-on-timewait-sockets.patch
queue-3.10/unix_diag-fix-info-leak.patch
queue-3.10/tcp-must-unclone-packets-before-mangling-them.patch
queue-3.10/l2tp-fix-kernel-panic-when-using-ipv4-mapped-ipv6-addresses.patch
queue-3.10/netfilter-nf_conntrack-fix-rt6i_gateway-checks-for-h.323-helper.patch
queue-3.10/inet-fix-possible-memory-corruption-with-udp_cork-and-ufo.patch
queue-3.10/net-mv643xx_eth-update-statistics-timer-from-timer-context-only.patch
queue-3.10/l2tp-must-disable-bh-before-calling-l2tp_xmit_skb.patch
queue-3.10/ipv6-probe-routes-asynchronous-in-rt6_probe.patch
queue-3.10/net-secure_seq-fix-warning-when-config_ipv6-and-config_inet-are-not-selected.patch
queue-3.10/wanxl-fix-info-leak-in-ioctl.patch
queue-3.10/ipv6-fill-rt6i_gateway-with-nexthop-address.patch
queue-3.10/tcp-fix-incorrect-ca_state-in-tail-loss-probe.patch
queue-3.10/proc-connector-fix-info-leaks.patch
queue-3.10/net-mv643xx_eth-fix-orphaned-statistics-timer-crash.patch
queue-3.10/tcp-do-not-forget-fin-in-tcp_shifted_skb.patch
queue-3.10/virtio-net-refill-only-when-device-is-up-during-setting-queues.patch
queue-3.10/davinci_emac.c-fix-iff_allmulti-setup.patch
queue-3.10/net-fix-cipso-packet-validation-when-netlabel.patch
queue-3.10/be2net-pass-if_id-for-v1-and-v2-versions-of-tx_create-cmd.patch
queue-3.10/bnx2x-record-rx-queue-for-lro-packets.patch
queue-3.10/sctp-perform-software-checksum-if-packet-has-to-be-fragmented.patch
queue-3.10/connector-use-nlmsg_len-to-check-message-length.patch
queue-3.10/virtio-net-don-t-respond-to-cpu-hotplug-notifier-if-we-re-not-ready.patch
queue-3.10/farsync-fix-info-leak-in-ioctl.patch
queue-3.10/l2tp-fix-build-warning-with-ipv6-disabled.patch
queue-3.10/tcp-tso-packets-automatic-sizing.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]