Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 65088
b: refs/heads/master
c: 0e3dbc0
h: refs/heads/master
v: v3
  • Loading branch information
Alan Cox authored and Jeff Garzik committed Sep 20, 2007
1 parent 7b347bd commit eb51a60
Show file tree
Hide file tree
Showing 23 changed files with 432 additions and 409 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b8fceee17a310f189188599a8fa5e9beaff57eb0
refs/heads/master: 0e3dbc01d53940fe10e5a5cfec15ede3e929c918
6 changes: 3 additions & 3 deletions trunk/MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2622,8 +2622,8 @@ P: Harald Welte
P: Jozsef Kadlecsik
P: Patrick McHardy
M: kaber@trash.net
L: netfilter-devel@vger.kernel.org
L: netfilter@vger.kernel.org
L: netfilter-devel@lists.netfilter.org
L: netfilter@lists.netfilter.org (subscribers-only)
L: coreteam@netfilter.org
W: http://www.netfilter.org/
W: http://www.iptables.org/
Expand Down Expand Up @@ -2676,7 +2676,7 @@ M: jmorris@namei.org
P: Hideaki YOSHIFUJI
M: yoshfuji@linux-ipv6.org
P: Patrick McHardy
M: kaber@trash.net
M: kaber@coreworks.de
L: netdev@vger.kernel.org
T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git
S: Maintained
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3778,6 +3778,9 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ },
{ "Maxtor 6B200M0", "BANC1BM0", ATA_HORKAGE_NONCQ },
{ "Maxtor 6B200M0", "BANC1B10", ATA_HORKAGE_NONCQ },
{ "Maxtor 7B250S0", "BANC1B70", ATA_HORKAGE_NONCQ, },
{ "Maxtor 7B300S0", "BANC1B70", ATA_HORKAGE_NONCQ },
{ "Maxtor 7V300F0", "VA111630", ATA_HORKAGE_NONCQ },
{ "HITACHI HDS7250SASUN500G 0621KTAWSD", "K2AOAJ0AHITACHI",
ATA_HORKAGE_NONCQ },
/* NCQ hard hangs device under heavier load, needs hard power cycle */
Expand All @@ -3794,6 +3797,7 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ "WDC WD740ADFD-00NLR1", NULL, ATA_HORKAGE_NONCQ, },
{ "FUJITSU MHV2080BH", "00840028", ATA_HORKAGE_NONCQ, },
{ "ST9160821AS", "3.CLF", ATA_HORKAGE_NONCQ, },
{ "ST3160812AS", "3.AD", ATA_HORKAGE_NONCQ, },
{ "SAMSUNG HD401LJ", "ZZ100-15", ATA_HORKAGE_NONCQ, },

/* devices which puke on READ_NATIVE_MAX */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/ieee1394/ieee1394_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ static void __exit ieee1394_cleanup(void)
unregister_chrdev_region(IEEE1394_CORE_DEV, 256);
}

module_init(ieee1394_init);
fs_initcall(ieee1394_init); /* same as ohci1394 */
module_exit(ieee1394_cleanup);

/* Exported symbols */
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/ieee1394/ohci1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -3537,5 +3537,7 @@ static int __init ohci1394_init(void)
return pci_register_driver(&ohci1394_pci_driver);
}

module_init(ohci1394_init);
/* Register before most other device drivers.
* Useful for remote debugging via physical DMA, e.g. using firescope. */
fs_initcall(ohci1394_init);
module_exit(ohci1394_cleanup);
7 changes: 3 additions & 4 deletions trunk/drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@

#define DRV_MODULE_NAME "bnx2"
#define PFX DRV_MODULE_NAME ": "
#define DRV_MODULE_VERSION "1.6.5"
#define DRV_MODULE_RELDATE "September 20, 2007"
#define DRV_MODULE_VERSION "1.6.4"
#define DRV_MODULE_RELDATE "August 3, 2007"

#define RUN_AT(x) (jiffies + (x))

Expand Down Expand Up @@ -6727,8 +6727,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
} else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
CHIP_NUM(bp) == CHIP_NUM_5708)
bp->phy_flags |= PHY_CRC_FIX_FLAG;
else if (CHIP_ID(bp) == CHIP_ID_5709_A0 ||
CHIP_ID(bp) == CHIP_ID_5709_A1)
else if (CHIP_ID(bp) == CHIP_ID_5709_A0)
bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG;

if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/net/myri10ge/myri10ge.c
Original file line number Diff line number Diff line change
Expand Up @@ -3094,12 +3094,9 @@ static void myri10ge_remove(struct pci_dev *pdev)
}

#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E 0x0008
#define PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9 0x0009

static struct pci_device_id myri10ge_pci_tbl[] = {
{PCI_DEVICE(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E)},
{PCI_DEVICE
(PCI_VENDOR_ID_MYRICOM, PCI_DEVICE_ID_MYRICOM_MYRI10GE_Z8E_9)},
{0},
};

Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/phy/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ int phy_mii_ioctl(struct phy_device *phydev,

return 0;
}
EXPORT_SYMBOL(phy_mii_ioctl);

/**
* phy_start_aneg - start auto-negotiation for this PHY device
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,8 @@ static int __pppoe_xmit(struct sock *sk, struct sk_buff *skb)
dev->hard_header(skb, dev, ETH_P_PPP_SES,
po->pppoe_pa.remote, NULL, data_len);

dev_queue_xmit(skb);
if (dev_queue_xmit(skb) < 0)
goto abort;

return 1;

Expand Down
118 changes: 65 additions & 53 deletions trunk/drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,46 +491,44 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
u16 hdrflags;
u16 tunnel_id, session_id;
int length;
int offset;
struct udphdr *uh;

tunnel = pppol2tp_sock_to_tunnel(sock);
if (tunnel == NULL)
goto error;

/* UDP always verifies the packet length. */
__skb_pull(skb, sizeof(struct udphdr));

/* Short packet? */
if (!pskb_may_pull(skb, 12)) {
if (skb->len < sizeof(struct udphdr)) {
PRINTK(tunnel->debug, PPPOL2TP_MSG_DATA, KERN_INFO,
"%s: recv short packet (len=%d)\n", tunnel->name, skb->len);
goto error;
}

/* Point to L2TP header */
ptr = skb->data;
ptr = skb->data + sizeof(struct udphdr);

/* Get L2TP header flags */
hdrflags = ntohs(*(__be16*)ptr);

/* Trace packet contents, if enabled */
if (tunnel->debug & PPPOL2TP_MSG_DATA) {
length = min(16u, skb->len);
if (!pskb_may_pull(skb, length))
goto error;

printk(KERN_DEBUG "%s: recv: ", tunnel->name);

offset = 0;
do {
printk(" %02X", ptr[offset]);
} while (++offset < length);

for (length = 0; length < 16; length++)
printk(" %02X", ptr[length]);
printk("\n");
}

/* Get length of L2TP packet */
length = skb->len;
uh = (struct udphdr *) skb_transport_header(skb);
length = ntohs(uh->len) - sizeof(struct udphdr);

/* Too short? */
if (length < 12) {
PRINTK(tunnel->debug, PPPOL2TP_MSG_DATA, KERN_INFO,
"%s: recv short L2TP packet (len=%d)\n", tunnel->name, length);
goto error;
}

/* If type is control packet, it is handled by userspace. */
if (hdrflags & L2TP_HDRFLAG_T) {
Expand Down Expand Up @@ -608,6 +606,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
"%s: recv data has no seq numbers when required. "
"Discarding\n", session->name);
session->stats.rx_seq_discards++;
session->stats.rx_errors++;
goto discard;
}

Expand All @@ -626,6 +625,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
"%s: recv data has no seq numbers when required. "
"Discarding\n", session->name);
session->stats.rx_seq_discards++;
session->stats.rx_errors++;
goto discard;
}

Expand All @@ -634,14 +634,10 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
}

/* If offset bit set, skip it. */
if (hdrflags & L2TP_HDRFLAG_O) {
offset = ntohs(*(__be16 *)ptr);
skb->transport_header += 2 + offset;
if (!pskb_may_pull(skb, skb_transport_offset(skb) + 2))
goto discard;
}
if (hdrflags & L2TP_HDRFLAG_O)
ptr += 2 + ntohs(*(__be16 *) ptr);

__skb_pull(skb, skb_transport_offset(skb));
skb_pull(skb, ptr - skb->data);

/* Skip PPP header, if present. In testing, Microsoft L2TP clients
* don't send the PPP header (PPP header compression enabled), but
Expand Down Expand Up @@ -677,6 +673,7 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
*/
if (PPPOL2TP_SKB_CB(skb)->ns != session->nr) {
session->stats.rx_seq_discards++;
session->stats.rx_errors++;
PRINTK(session->debug, PPPOL2TP_MSG_SEQ, KERN_DEBUG,
"%s: oos pkt %hu len %d discarded, "
"waiting for %hu, reorder_q_len=%d\n",
Expand All @@ -701,7 +698,6 @@ static int pppol2tp_recv_core(struct sock *sock, struct sk_buff *skb)
return 0;

discard:
session->stats.rx_errors++;
kfree_skb(skb);
sock_put(session->sock);

Expand Down Expand Up @@ -962,6 +958,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
int data_len = skb->len;
struct inet_sock *inet;
__wsum csum = 0;
struct sk_buff *skb2 = NULL;
struct udphdr *uh;
unsigned int len;

Expand Down Expand Up @@ -992,30 +989,41 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
*/
headroom = NET_SKB_PAD + sizeof(struct iphdr) +
sizeof(struct udphdr) + hdr_len + sizeof(ppph);
if (skb_cow_head(skb, headroom))
goto abort;
if (skb_headroom(skb) < headroom) {
skb2 = skb_realloc_headroom(skb, headroom);
if (skb2 == NULL)
goto abort;
} else
skb2 = skb;

/* Check that the socket has room */
if (atomic_read(&sk_tun->sk_wmem_alloc) < sk_tun->sk_sndbuf)
skb_set_owner_w(skb2, sk_tun);
else
goto discard;

/* Setup PPP header */
__skb_push(skb, sizeof(ppph));
skb->data[0] = ppph[0];
skb->data[1] = ppph[1];
skb_push(skb2, sizeof(ppph));
skb2->data[0] = ppph[0];
skb2->data[1] = ppph[1];

/* Setup L2TP header */
pppol2tp_build_l2tp_header(session, __skb_push(skb, hdr_len));
skb_push(skb2, hdr_len);
pppol2tp_build_l2tp_header(session, skb2->data);

/* Setup UDP header */
inet = inet_sk(sk_tun);
__skb_push(skb, sizeof(*uh));
skb_reset_transport_header(skb);
uh = udp_hdr(skb);
skb_push(skb2, sizeof(struct udphdr));
skb_reset_transport_header(skb2);
uh = (struct udphdr *) skb2->data;
uh->source = inet->sport;
uh->dest = inet->dport;
uh->len = htons(sizeof(struct udphdr) + hdr_len + sizeof(ppph) + data_len);
uh->check = 0;

/* *BROKEN* Calculate UDP checksum if configured to do so */
/* Calculate UDP checksum if configured to do so */
if (sk_tun->sk_no_check != UDP_CSUM_NOXMIT)
csum = udp_csum_outgoing(sk_tun, skb);
csum = udp_csum_outgoing(sk_tun, skb2);

/* Debug */
if (session->send_seq)
Expand All @@ -1028,7 +1036,7 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)

if (session->debug & PPPOL2TP_MSG_DATA) {
int i;
unsigned char *datap = skb->data;
unsigned char *datap = skb2->data;

printk(KERN_DEBUG "%s: xmit:", session->name);
for (i = 0; i < data_len; i++) {
Expand All @@ -1041,18 +1049,18 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
printk("\n");
}

memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);
nf_reset(skb);
memset(&(IPCB(skb2)->opt), 0, sizeof(IPCB(skb2)->opt));
IPCB(skb2)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED |
IPSKB_REROUTED);
nf_reset(skb2);

/* Get routing info from the tunnel socket */
dst_release(skb->dst);
skb->dst = sk_dst_get(sk_tun);
dst_release(skb2->dst);
skb2->dst = sk_dst_get(sk_tun);

/* Queue the packet to IP for output */
len = skb->len;
rc = ip_queue_xmit(skb, 1);
len = skb2->len;
rc = ip_queue_xmit(skb2, 1);

/* Update stats */
if (rc >= 0) {
Expand All @@ -1065,12 +1073,17 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb)
session->stats.tx_errors++;
}

return 1;

abort:
/* Free the original skb */
kfree_skb(skb);

return 1;

discard:
/* Free the new skb. Caller will free original skb. */
if (skb2 != skb)
kfree_skb(skb2);
abort:
return 0;
}

/*****************************************************************************
Expand Down Expand Up @@ -1313,14 +1326,12 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id,
goto err;
}

sk = sock->sk;

/* Quick sanity checks */
err = -EPROTONOSUPPORT;
if (sk->sk_protocol != IPPROTO_UDP) {
err = -ESOCKTNOSUPPORT;
if (sock->type != SOCK_DGRAM) {
PRINTK(-1, PPPOL2TP_MSG_CONTROL, KERN_ERR,
"tunl %hu: fd %d wrong protocol, got %d, expected %d\n",
tunnel_id, fd, sk->sk_protocol, IPPROTO_UDP);
"tunl %hu: fd %d wrong type, got %d, expected %d\n",
tunnel_id, fd, sock->type, SOCK_DGRAM);
goto err;
}
err = -EAFNOSUPPORT;
Expand All @@ -1332,6 +1343,7 @@ static struct sock *pppol2tp_prepare_tunnel_socket(int fd, u16 tunnel_id,
}

err = -ENOTCONN;
sk = sock->sk;

/* Check if this socket has already been prepped */
tunnel = (struct pppol2tp_tunnel *)sk->sk_user_data;
Expand Down
Loading

0 comments on commit eb51a60

Please sign in to comment.