diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-26 15:14:17 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2011-04-26 15:14:17 +0200 |
commit | c4172cf85db0eceb0b3dd74a59076d1a52857ff5 (patch) | |
tree | 3d2014f3b8b4b6bee9dc4426badac1b19f10ac7c /quicktun.c | |
parent | 6a9ee3470814517e13e2b838dee4fcddae8d33e7 (diff) | |
download | modquicktun-c4172cf85db0eceb0b3dd74a59076d1a52857ff5.tar modquicktun-c4172cf85db0eceb0b3dd74a59076d1a52857ff5.zip |
Make modquicktun work on all kernels 2.6.{32..39}
Diffstat (limited to 'quicktun.c')
-rw-r--r-- | quicktun.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -74,14 +74,14 @@ static netdev_tx_t quicktun_net_xmit(struct sk_buff *skb, struct net_device *dev goto error; } - if (rt->dst.dev == dev) { + if (RTABLE_DST(rt)->dev == dev) { tun->dev->stats.collisions++; goto error; } - if (skb_headroom(skb) < (LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + sizeof(struct udphdr)) + if (skb_headroom(skb) < (LL_RESERVED_SPACE(RTABLE_DST(rt)->dev) + sizeof(struct iphdr) + sizeof(struct udphdr)) || skb_shared(skb) || (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { - struct sk_buff *new_skb = skb_realloc_headroom(skb, LL_RESERVED_SPACE(rt->dst.dev) + sizeof(struct iphdr) + sizeof(struct udphdr)); + struct sk_buff *new_skb = skb_realloc_headroom(skb, LL_RESERVED_SPACE(RTABLE_DST(rt)->dev) + sizeof(struct iphdr) + sizeof(struct udphdr)); if (!new_skb) { tun->dev->stats.tx_dropped++; goto error; @@ -97,7 +97,7 @@ static netdev_tx_t quicktun_net_xmit(struct sk_buff *skb, struct net_device *dev skb_reset_network_header(skb); skb_dst_drop(skb); - skb_dst_set(skb, &rt->dst); + skb_dst_set(skb, RTABLE_DST(rt)); iph = (struct iphdr *)skb->data; iph->version = 4; @@ -117,7 +117,7 @@ static netdev_tx_t quicktun_net_xmit(struct sk_buff *skb, struct net_device *dev udph->len = htons(len + sizeof(struct udphdr)); udph->check = 0; - ip_select_ident(ip_hdr(skb), &rt->dst, NULL); + ip_select_ident(ip_hdr(skb), RTABLE_DST(rt), NULL); csum = csum_partial(udph, ntohs(udph->len), 0); udph->check = csum_tcpudp_magic(iph->saddr, iph->daddr, ntohs(udph->len), IPPROTO_UDP, csum); @@ -230,6 +230,8 @@ static void quicktun_udp_data_ready(struct sock *sk, int bytes) len = skb->len; + __skb_tunnel_rx(skb, tun->dev); + switch (tun->flags & QUICKTUN_MODE_MASK) { case QUICKTUN_MODE_ETHERNET: if (len < ETH_HLEN) @@ -241,7 +243,6 @@ static void quicktun_udp_data_ready(struct sock *sk, int bytes) if (len < sizeof(struct iphdr)) goto drop; - __skb_tunnel_rx(skb, tun->dev); skb_reset_network_header(skb); switch (skb->data[0] & 0xf0) { |