Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (56 commits)
  l2tp: Fix possible oops if transmitting or receiving when tunnel goes down
  tcp: Fix for race due to temporary drop of the socket lock in skb_splice_bits.
  tcp: Increment OUTRSTS in tcp_send_active_reset()
  raw: Raw socket leak.
  lt2p: Fix possible WARN_ON from socket code when UDP socket is closed
  USB ID for Philips CPWUA054/00 Wireless USB Adapter 11g
  ssb: Fix context assertion in ssb_pcicore_dev_irqvecs_enable
  libertas: fix command size for CMD_802_11_SUBSCRIBE_EVENT
  ipw2200: expire and use oldest BSS on adhoc create
  airo warning fix
  b43legacy: Fix controller restart crash
  sctp: Fix ECN markings for IPv6
  sctp: Flush the queue only once during fast retransmit.
  sctp: Start T3-RTX timer when fast retransmitting lowest TSN
  sctp: Correctly implement Fast Recovery cwnd manipulations.
  sctp: Move sctp_v4_dst_saddr out of loop
  sctp: retran_path update bug fix
  tcp: fix skb vs fack_count out-of-sync condition
  sunhme: Cleanup use of deprecated calls to save_and_cli and restore_flags.
  xfrm: xfrm_algo: correct usage of RIPEMD-160
  ...
  • Loading branch information
torvalds committed Jun 5, 2008
2 parents 9489a06 + 24b9568 commit 3e387fc
Show file tree
Hide file tree
Showing 67 changed files with 618 additions and 315 deletions.
2 changes: 1 addition & 1 deletion Documentation/networking/bridge.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
In order to use the Ethernet bridging functionality, you'll need the
userspace tools. These programs and documentation are available
at http://bridge.sourceforge.net. The download page is
at http://www.linux-foundation.org/en/Net:Bridge. The download page is
http://prdownloads.sourceforge.net/bridge.

If you still have questions, don't hesitate to post to the mailing list
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1611,7 +1611,7 @@ ETHERNET BRIDGE
P: Stephen Hemminger
M: [email protected]
L: [email protected]
W: http://bridge.sourceforge.net/
W: http://www.linux-foundation.org/en/Net:Bridge
S: Maintained

ETHERTEAM 16I DRIVER
Expand Down
1 change: 1 addition & 0 deletions drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,7 @@ static void atl1_intr_rx(struct atl1_adapter *adapter)
/* Good Receive */
pci_unmap_page(adapter->pdev, buffer_info->dma,
buffer_info->length, PCI_DMA_FROMDEVICE);
buffer_info->dma = 0;
skb = buffer_info->skb;
length = le16_to_cpu(rrd->xsz.xsum_sz.pkt_size);

Expand Down
10 changes: 7 additions & 3 deletions drivers/net/cs89x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,11 @@ net_open(struct net_device *dev)
#endif
if (!result) {
printk(KERN_ERR "%s: EEPROM is configured for unavailable media\n", dev->name);
release_irq:
release_dma:
#if ALLOW_DMA
free_dma(dev->dma);
#endif
release_irq:
#if ALLOW_DMA
release_dma_buff(lp);
#endif
Expand Down Expand Up @@ -1442,12 +1446,12 @@ net_open(struct net_device *dev)
if ((result = detect_bnc(dev)) != DETECTED_NONE)
break;
printk(KERN_ERR "%s: no media detected\n", dev->name);
goto release_irq;
goto release_dma;
}
switch(result) {
case DETECTED_NONE:
printk(KERN_ERR "%s: no network cable attached to configured media\n", dev->name);
goto release_irq;
goto release_dma;
case DETECTED_RJ45H:
printk(KERN_INFO "%s: using half-duplex 10Base-T (RJ-45)\n", dev->name);
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
#include "myri10ge_mcp.h"
#include "myri10ge_mcp_gen_header.h"

#define MYRI10GE_VERSION_STR "1.3.2-1.287"
#define MYRI10GE_VERSION_STR "1.3.99-1.347"

MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
MODULE_AUTHOR("Maintainer: [email protected]");
Expand Down
111 changes: 88 additions & 23 deletions drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,12 +240,15 @@ static inline struct pppol2tp_session *pppol2tp_sock_to_session(struct sock *sk)
if (sk == NULL)
return NULL;

sock_hold(sk);
session = (struct pppol2tp_session *)(sk->sk_user_data);
if (session == NULL)
return NULL;
if (session == NULL) {
sock_put(sk);
goto out;
}

BUG_ON(session->magic != L2TP_SESSION_MAGIC);

out:
return session;
}

Expand All @@ -256,12 +259,15 @@ static inline struct pppol2tp_tunnel *pppol2tp_sock_to_tunnel(struct sock *sk)
if (sk == NULL)
return NULL;

sock_hold(sk);
tunnel = (struct pppol2tp_tunnel *)(sk->sk_user_data);
if (tunnel == NULL)
return NULL;
if (tunnel == NULL) {
sock_put(sk);
goto out;
}

BUG_ON(tunnel->magic != L2TP_TUNNEL_MAGIC);

out:
return tunnel;
}

Expand Down Expand Up @@ -716,12 +722,14 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
session->stats.rx_errors++;
kfree_skb(skb);
sock_put(session->sock);
sock_put(sock);

return 0;

error:
/* Put UDP header back */
__skb_push(skb, sizeof(struct udphdr));
sock_put(sock);

no_tunnel:
return 1;
Expand All @@ -745,10 +753,13 @@ static int pppol2tp_udp_encap_recv(struct sock *sk, struct sk_buff *skb)
"%s: received %d bytes\n", tunnel->name, skb->len);

if (pppol2tp_recv_core(sk, skb))
goto pass_up;
goto pass_up_put;

sock_put(sk);
return 0;

pass_up_put:
sock_put(sk);
pass_up:
return 1;
}
Expand Down Expand Up @@ -858,7 +869,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh

tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
if (tunnel == NULL)
goto error;
goto error_put_sess;

/* What header length is configured for this session? */
hdr_len = pppol2tp_l2tp_header_len(session);
Expand All @@ -870,7 +881,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
sizeof(ppph) + total_len,
0, GFP_KERNEL);
if (!skb)
goto error;
goto error_put_sess_tun;

/* Reserve space for headers. */
skb_reserve(skb, NET_SKB_PAD);
Expand Down Expand Up @@ -900,7 +911,7 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
error = memcpy_fromiovec(skb->data, m->msg_iov, total_len);
if (error < 0) {
kfree_skb(skb);
goto error;
goto error_put_sess_tun;
}
skb_put(skb, total_len);

Expand Down Expand Up @@ -947,10 +958,33 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh
session->stats.tx_errors++;
}

return error;

error_put_sess_tun:
sock_put(session->tunnel_sock);
error_put_sess:
sock_put(sk);
error:
return error;
}

/* Automatically called when the skb is freed.
*/
static void pppol2tp_sock_wfree(struct sk_buff *skb)
{
sock_put(skb->sk);
}

/* For data skbs that we transmit, we associate with the tunnel socket
* but don't do accounting.
*/
static inline void pppol2tp_skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
{
sock_hold(sk);
skb->sk = sk;
skb->destructor = pppol2tp_sock_wfree;
}

/* Transmit function called by generic PPP driver. Sends PPP frame
* over PPPoL2TP socket.
*
Expand Down Expand Up @@ -993,10 +1027,10 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)

sk_tun = session->tunnel_sock;
if (sk_tun == NULL)
goto abort;
goto abort_put_sess;
tunnel = pppol2tp_sock_to_tunnel(sk_tun);
if (tunnel == NULL)
goto abort;
goto abort_put_sess;

/* What header length is configured for this session? */
hdr_len = pppol2tp_l2tp_header_len(session);
Expand All @@ -1009,7 +1043,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
sizeof(struct udphdr) + hdr_len + sizeof(ppph);
old_headroom = skb_headroom(skb);
if (skb_cow_head(skb, headroom))
goto abort;
goto abort_put_sess_tun;

new_headroom = skb_headroom(skb);
skb_orphan(skb);
Expand Down Expand Up @@ -1069,7 +1103,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
/* Get routing info from the tunnel socket */
dst_release(skb->dst);
skb->dst = dst_clone(__sk_dst_get(sk_tun));
skb->sk = sk_tun;
pppol2tp_skb_set_owner_w(skb, sk_tun);

/* Queue the packet to IP for output */
len = skb->len;
Expand All @@ -1086,8 +1120,14 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
session->stats.tx_errors++;
}

sock_put(sk_tun);
sock_put(sk);
return 1;

abort_put_sess_tun:
sock_put(sk_tun);
abort_put_sess:
sock_put(sk);
abort:
/* Free the original skb */
kfree_skb(skb);
Expand Down Expand Up @@ -1191,7 +1231,7 @@ static void pppol2tp_tunnel_destruct(struct sock *sk)
{
struct pppol2tp_tunnel *tunnel;

tunnel = pppol2tp_sock_to_tunnel(sk);
tunnel = sk->sk_user_data;
if (tunnel == NULL)
goto end;

Expand Down Expand Up @@ -1230,10 +1270,12 @@ static void pppol2tp_session_destruct(struct sock *sk)
if (sk->sk_user_data != NULL) {
struct pppol2tp_tunnel *tunnel;

session = pppol2tp_sock_to_session(sk);
session = sk->sk_user_data;
if (session == NULL)
goto out;

BUG_ON(session->magic != L2TP_SESSION_MAGIC);

/* Don't use pppol2tp_sock_to_tunnel() here to
* get the tunnel context because the tunnel
* socket might have already been closed (its
Expand Down Expand Up @@ -1279,6 +1321,7 @@ static void pppol2tp_session_destruct(struct sock *sk)
static int pppol2tp_release(struct socket *sock)
{
struct sock *sk = sock->sk;
struct pppol2tp_session *session;
int error;

if (!sk)
Expand All @@ -1296,9 +1339,18 @@ static int pppol2tp_release(struct socket *sock)
sock_orphan(sk);
sock->sk = NULL;

session = pppol2tp_sock_to_session(sk);

/* Purge any queued data */
skb_queue_purge(&sk->sk_receive_queue);
skb_queue_purge(&sk->sk_write_queue);
if (session != NULL) {
struct sk_buff *skb;
while ((skb = skb_dequeue(&session->reorder_q))) {
kfree_skb(skb);
sock_put(sk);
}
}

release_sock(sk);

Expand Down Expand Up @@ -1601,7 +1653,7 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,

error = ppp_register_channel(&po->chan);
if (error)
goto end;
goto end_put_tun;

/* This is how we get the session context from the socket. */
sk->sk_user_data = session;
Expand All @@ -1621,6 +1673,8 @@ static int pppol2tp_connect(struct socket *sock, struct sockaddr *uservaddr,
PRINTK(session->debug, PPPOL2TP_MSG_CONTROL, KERN_INFO,
"%s: created\n", session->name);

end_put_tun:
sock_put(tunnel_sock);
end:
release_sock(sk);

Expand Down Expand Up @@ -1668,6 +1722,7 @@ static int pppol2tp_getname(struct socket *sock, struct sockaddr *uaddr,
*usockaddr_len = len;

error = 0;
sock_put(sock->sk);

end:
return error;
Expand Down Expand Up @@ -1906,14 +1961,17 @@ static int pppol2tp_ioctl(struct socket *sock, unsigned int cmd,
err = -EBADF;
tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
if (tunnel == NULL)
goto end;
goto end_put_sess;

err = pppol2tp_tunnel_ioctl(tunnel, cmd, arg);
goto end;
sock_put(session->tunnel_sock);
goto end_put_sess;
}

err = pppol2tp_session_ioctl(session, cmd, arg);

end_put_sess:
sock_put(sk);
end:
return err;
}
Expand Down Expand Up @@ -2059,14 +2117,17 @@ static int pppol2tp_setsockopt(struct socket *sock, int level, int optname,
err = -EBADF;
tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
if (tunnel == NULL)
goto end;
goto end_put_sess;

err = pppol2tp_tunnel_setsockopt(sk, tunnel, optname, val);
sock_put(session->tunnel_sock);
} else
err = pppol2tp_session_setsockopt(sk, session, optname, val);

err = 0;

end_put_sess:
sock_put(sk);
end:
return err;
}
Expand Down Expand Up @@ -2181,20 +2242,24 @@ static int pppol2tp_getsockopt(struct socket *sock, int level,
err = -EBADF;
tunnel = pppol2tp_sock_to_tunnel(session->tunnel_sock);
if (tunnel == NULL)
goto end;
goto end_put_sess;

err = pppol2tp_tunnel_getsockopt(sk, tunnel, optname, &val);
sock_put(session->tunnel_sock);
} else
err = pppol2tp_session_getsockopt(sk, session, optname, &val);

err = -EFAULT;
if (put_user(len, (int __user *) optlen))
goto end;
goto end_put_sess;

if (copy_to_user((void __user *) optval, &val, len))
goto end;
goto end_put_sess;

err = 0;

end_put_sess:
sock_put(sk);
end:
return err;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sc92031.c
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ static int sc92031_start_xmit(struct sk_buff *skb, struct net_device *dev)
skb_copy_and_csum_dev(skb, priv->tx_bufs + entry * TX_BUF_SIZE);

len = skb->len;
if (unlikely(len < ETH_ZLEN)) {
if (len < ETH_ZLEN) {
memset(priv->tx_bufs + entry * TX_BUF_SIZE + len,
0, ETH_ZLEN - len);
len = ETH_ZLEN;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sfc/falcon_xmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ static int falcon_check_xaui_link_up(struct efx_nic *efx)
tries--;
}

EFX_ERR(efx, "Failed to bring XAUI link back up in %d tries!\n",
EFX_LOG(efx, "Failed to bring XAUI link back up in %d tries!\n",
max_tries);
return 0;
}
Expand Down
Loading

0 comments on commit 3e387fc

Please sign in to comment.