Reset to the original
[linux-2.6.git] / linux-2.6-593-egre.patch
index 9c210db..9d02811 100644 (file)
@@ -1682,7 +1682,7 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
  #include <net/ip6_route.h>
  #endif
  
-+#define GRE_DEBUG 1
++//#define GRE_DEBUG 1
 +
  /*
     Problems & solutions
@@ -1796,7 +1796,7 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
  {
        struct ip_tunnel *tunnel = netdev_priv(dev);
        struct net_device_stats *stats = &tunnel->stat;
-@@ -904,6 +951,231 @@ tx_error:
+@@ -904,6 +951,228 @@ tx_error:
        return 0;
  }
  
@@ -1942,12 +1942,9 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
 +      printk(KERN_ALERT "gre.c:1094 Passed the headroom calculation\n");
 +#endif
 +
-+
-+/*    XXX skb->h.raw = skb->nh.raw; XXX */
-+//    skb->h.raw = skb->mac.raw;
-+      skb->transport_header = skb->mac_header; // Added by valas
-+      
++      skb->transport_header = skb->data;
 +      skb_push(skb, gre_hlen);
++      skb_reset_network_header(skb);
 +      memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt));
 +      dst_release(skb->dst);
 +      skb->dst = &rt->u.dst;
@@ -2089,7 +2086,7 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
        dev->get_stats          = ipgre_tunnel_get_stats;
        dev->do_ioctl           = ipgre_tunnel_ioctl;
        dev->change_mtu         = ipgre_tunnel_change_mtu;
-@@ -1157,6 +1441,36 @@ static void ipgre_tunnel_setup(struct ne
+@@ -1157,6 +1441,35 @@ static void ipgre_tunnel_setup(struct ne
        dev->addr_len           = 4;
  }
  
@@ -2097,6 +2094,8 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
 +static void ipgre_eth_tunnel_setup(struct net_device *dev)
 +{
 +      SET_MODULE_OWNER(dev);
++
++       // Set default values for Ethernet device
 +      ether_setup(dev);
 +
 +      dev->uninit             = ipgre_tunnel_uninit;
@@ -2106,13 +2105,10 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
 +      dev->do_ioctl           = ipgre_tunnel_ioctl;
 +      dev->change_mtu         = ipgre_tunnel_change_mtu;
 +
-+      dev->type               = ARPHRD_ETHER;
-+      dev->hard_header_len    = ETH_HLEN + sizeof(struct iphdr) + 4;
-+      dev->mtu                = ETH_DATA_LEN - sizeof(struct iphdr) - 4;
-+      dev->flags              = 0;
++      dev->hard_header_len    = LL_MAX_HEADER + ETH_HLEN + sizeof(struct iphdr) + 4;
++      dev->mtu                = ETH_DATA_LEN - ETH_HLEN - sizeof(struct iphdr) - 4;
 +      dev->tx_queue_len       = 0;
 +      dev->iflink             = 0;
-+      dev->addr_len           = 6;
 +
 +      random_ether_addr(dev->dev_addr);
 +
@@ -2126,7 +2122,7 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
  static int ipgre_tunnel_init(struct net_device *dev)
  {
        struct net_device *tdev = NULL;
-@@ -1172,8 +1486,10 @@ static int ipgre_tunnel_init(struct net_
+@@ -1172,8 +1486,12 @@ static int ipgre_tunnel_init(struct net_
        tunnel->dev = dev;
        strcpy(tunnel->parms.name, dev->name);
  
@@ -2135,6 +2131,8 @@ diff -Nurp linux-2.6.22-592/net/ipv4/ip_gre.c linux-2.6.22-593/net/ipv4/ip_gre.c
 +      if (tunnel->parms.proto_type != ETH_P_ETH) {
 +              memcpy(dev->dev_addr, &tunnel->parms.iph.saddr, 4);
 +              memcpy(dev->broadcast, &tunnel->parms.iph.daddr, 4);
++      } else {
++              addend += ETH_HLEN;
 +      }
  
        /* Guess output device to choose reasonable mtu and hard_header_len */