aboutsummaryrefslogtreecommitdiffstats
path: root/net/l2tp
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-02 23:53:45 -0400
commitcd6362befe4cc7bf589a5236d2a780af2d47bcc9 (patch)
tree3bd4e13ec3f92a00dc4f6c3d65e820b54dbfe46e /net/l2tp
parent0f1b1e6d73cb989ce2c071edc57deade3b084dfe (diff)
parentb1586f099ba897542ece36e8a23c1a62907261ef (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller: "Here is my initial pull request for the networking subsystem during this merge window: 1) Support for ESN in AH (RFC 4302) from Fan Du. 2) Add full kernel doc for ethtool command structures, from Ben Hutchings. 3) Add BCM7xxx PHY driver, from Florian Fainelli. 4) Export computed TCP rate information in netlink socket dumps, from Eric Dumazet. 5) Allow IPSEC SA to be dumped partially using a filter, from Nicolas Dichtel. 6) Convert many drivers to pci_enable_msix_range(), from Alexander Gordeev. 7) Record SKB timestamps more efficiently, from Eric Dumazet. 8) Switch to microsecond resolution for TCP round trip times, also from Eric Dumazet. 9) Clean up and fix 6lowpan fragmentation handling by making use of the existing inet_frag api for it's implementation. 10) Add TX grant mapping to xen-netback driver, from Zoltan Kiss. 11) Auto size SKB lengths when composing netlink messages based upon past message sizes used, from Eric Dumazet. 12) qdisc dumps can take a long time, add a cond_resched(), From Eric Dumazet. 13) Sanitize netpoll core and drivers wrt. SKB handling semantics. Get rid of never-used-in-tree netpoll RX handling. From Eric W Biederman. 14) Support inter-address-family and namespace changing in VTI tunnel driver(s). From Steffen Klassert. 15) Add Altera TSE driver, from Vince Bridgers. 16) Optimizing csum_replace2() so that it doesn't adjust the checksum by checksumming the entire header, from Eric Dumazet. 17) Expand BPF internal implementation for faster interpreting, more direct translations into JIT'd code, and much cleaner uses of BPF filtering in non-socket ocntexts. From Daniel Borkmann and Alexei Starovoitov" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1976 commits) netpoll: Use skb_irq_freeable to make zap_completion_queue safe. net: Add a test to see if a skb is freeable in irq context qlcnic: Fix build failure due to undefined reference to `vxlan_get_rx_port' net: ptp: move PTP classifier in its own file net: sxgbe: make "core_ops" static net: sxgbe: fix logical vs bitwise operation net: sxgbe: sxgbe_mdio_register() frees the bus Call efx_set_channels() before efx->type->dimension_resources() xen-netback: disable rogue vif in kthread context net/mlx4: Set proper build dependancy with vxlan be2net: fix build dependency on VxLAN mac802154: make csma/cca parameters per-wpan mac802154: allow only one WPAN to be up at any given time net: filter: minor: fix kdoc in __sk_run_filter netlink: don't compare the nul-termination in nla_strcmp can: c_can: Avoid led toggling for every packet. can: c_can: Simplify TX interrupt cleanup can: c_can: Store dlc private can: c_can: Reduce register access can: c_can: Make the code readable ...
Diffstat (limited to 'net/l2tp')
-rw-r--r--net/l2tp/l2tp_core.c24
-rw-r--r--net/l2tp/l2tp_ppp.c3
2 files changed, 1 insertions, 26 deletions
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c
index c83827e7c324..47f7a5490555 100644
--- a/net/l2tp/l2tp_core.c
+++ b/net/l2tp/l2tp_core.c
@@ -1130,7 +1130,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
1130 /* Queue the packet to IP for output */ 1130 /* Queue the packet to IP for output */
1131 skb->local_df = 1; 1131 skb->local_df = 1;
1132#if IS_ENABLED(CONFIG_IPV6) 1132#if IS_ENABLED(CONFIG_IPV6)
1133 if (skb->sk->sk_family == PF_INET6 && !tunnel->v4mapped) 1133 if (tunnel->sock->sk_family == PF_INET6 && !tunnel->v4mapped)
1134 error = inet6_csk_xmit(skb, NULL); 1134 error = inet6_csk_xmit(skb, NULL);
1135 else 1135 else
1136#endif 1136#endif
@@ -1150,23 +1150,6 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb,
1150 return 0; 1150 return 0;
1151} 1151}
1152 1152
1153/* Automatically called when the skb is freed.
1154 */
1155static void l2tp_sock_wfree(struct sk_buff *skb)
1156{
1157 sock_put(skb->sk);
1158}
1159
1160/* For data skbs that we transmit, we associate with the tunnel socket
1161 * but don't do accounting.
1162 */
1163static inline void l2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
1164{
1165 sock_hold(sk);
1166 skb->sk = sk;
1167 skb->destructor = l2tp_sock_wfree;
1168}
1169
1170#if IS_ENABLED(CONFIG_IPV6) 1153#if IS_ENABLED(CONFIG_IPV6)
1171static void l2tp_xmit_ipv6_csum(struct sock *sk, struct sk_buff *skb, 1154static void l2tp_xmit_ipv6_csum(struct sock *sk, struct sk_buff *skb,
1172 int udp_len) 1155 int udp_len)
@@ -1220,7 +1203,6 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len
1220 return NET_XMIT_DROP; 1203 return NET_XMIT_DROP;
1221 } 1204 }
1222 1205
1223 skb_orphan(skb);
1224 /* Setup L2TP header */ 1206 /* Setup L2TP header */
1225 session->build_header(session, __skb_push(skb, hdr_len)); 1207 session->build_header(session, __skb_push(skb, hdr_len));
1226 1208
@@ -1286,8 +1268,6 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len
1286 break; 1268 break;
1287 } 1269 }
1288 1270
1289 l2tp_skb_set_owner_w(skb, sk);
1290
1291 l2tp_xmit_core(session, skb, fl, data_len); 1271 l2tp_xmit_core(session, skb, fl, data_len);
1292out_unlock: 1272out_unlock:
1293 bh_unlock_sock(sk); 1273 bh_unlock_sock(sk);
@@ -1808,8 +1788,6 @@ void l2tp_session_free(struct l2tp_session *session)
1808 } 1788 }
1809 1789
1810 kfree(session); 1790 kfree(session);
1811
1812 return;
1813} 1791}
1814EXPORT_SYMBOL_GPL(l2tp_session_free); 1792EXPORT_SYMBOL_GPL(l2tp_session_free);
1815 1793
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c
index 5990919356a5..d276e2d4a589 100644
--- a/net/l2tp/l2tp_ppp.c
+++ b/net/l2tp/l2tp_ppp.c
@@ -456,13 +456,11 @@ static void pppol2tp_session_close(struct l2tp_session *session)
456 456
457 BUG_ON(session->magic != L2TP_SESSION_MAGIC); 457 BUG_ON(session->magic != L2TP_SESSION_MAGIC);
458 458
459
460 if (sock) { 459 if (sock) {
461 inet_shutdown(sock, 2); 460 inet_shutdown(sock, 2);
462 /* Don't let the session go away before our socket does */ 461 /* Don't let the session go away before our socket does */
463 l2tp_session_inc_refcount(session); 462 l2tp_session_inc_refcount(session);
464 } 463 }
465 return;
466} 464}
467 465
468/* Really kill the session socket. (Called from sock_put() if 466/* Really kill the session socket. (Called from sock_put() if
@@ -476,7 +474,6 @@ static void pppol2tp_session_destruct(struct sock *sk)
476 BUG_ON(session->magic != L2TP_SESSION_MAGIC); 474 BUG_ON(session->magic != L2TP_SESSION_MAGIC);
477 l2tp_session_dec_refcount(session); 475 l2tp_session_dec_refcount(session);
478 } 476 }
479 return;
480} 477}
481 478
482/* Called when the PPPoX socket (session) is closed. 479/* Called when the PPPoX socket (session) is closed.