Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265194
b: refs/heads/master
c: 2ae40ee
h: refs/heads/master
v: v3
  • Loading branch information
Mark Kamichoff authored and David S. Miller committed Aug 8, 2011
1 parent 65cd31b commit d1f0a6d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8a4cadc708f04a2a463bc3df0f16859b31d4b051
refs/heads/master: 2ae40ee9872953b4f329a54c82970dfb6854e17e
19 changes: 19 additions & 0 deletions trunk/drivers/net/usb/lg-vl600.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ static int vl600_bind(struct usbnet *dev, struct usb_interface *intf)
* addresses have no meaning, the destination and the source of every
* packet depend only on whether it is on the IN or OUT endpoint. */
dev->net->flags |= IFF_NOARP;
/* IPv6 NDP relies on multicast. Enable it by default. */
dev->net->flags |= IFF_MULTICAST;

return ret;
}
Expand Down Expand Up @@ -200,6 +202,14 @@ static int vl600_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
} else {
memset(ethhdr->h_source, 0, ETH_ALEN);
memcpy(ethhdr->h_dest, dev->net->dev_addr, ETH_ALEN);

/* Inbound IPv6 packets have an IPv4 ethertype (0x800)
* for some reason. Peek at the L3 header to check
* for IPv6 packets, and set the ethertype to IPv6
* (0x86dd) so Linux can understand it.
*/
if ((buf->data[sizeof(*ethhdr)] & 0xf0) == 0x60)
ethhdr->h_proto = __constant_htons(ETH_P_IPV6);
}

if (count) {
Expand Down Expand Up @@ -297,6 +307,15 @@ static struct sk_buff *vl600_tx_fixup(struct usbnet *dev,
if (skb->len < full_len) /* Pad */
skb_put(skb, full_len - skb->len);

/* The VL600 wants IPv6 packets to have an IPv4 ethertype
* Check if this is an IPv6 packet, and set the ethertype
* to 0x800
*/
if ((skb->data[sizeof(struct vl600_pkt_hdr *) + 0x22] & 0xf0) == 0x60) {
skb->data[sizeof(struct vl600_pkt_hdr *) + 0x20] = 0x08;
skb->data[sizeof(struct vl600_pkt_hdr *) + 0x21] = 0;
}

return skb;
}

Expand Down

0 comments on commit d1f0a6d

Please sign in to comment.