|
@@ -1033,7 +1033,6 @@ static int ipgre_tunnel_change_mtu(struct net_device *dev, int new_mtu)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_NET_IPGRE_BROADCAST
|
|
|
|
/* Nice toy. Unfortunately, useless in real life :-)
|
|
/* Nice toy. Unfortunately, useless in real life :-)
|
|
It allows to construct virtual multiprotocol broadcast "LAN"
|
|
It allows to construct virtual multiprotocol broadcast "LAN"
|
|
over the Internet, provided multicast routing is tuned.
|
|
over the Internet, provided multicast routing is tuned.
|
|
@@ -1092,10 +1091,19 @@ static int ipgre_header(struct sk_buff *skb, struct net_device *dev,
|
|
return -t->hlen;
|
|
return -t->hlen;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int ipgre_header_parse(const struct sk_buff *skb, unsigned char *haddr)
|
|
|
|
+{
|
|
|
|
+ struct iphdr *iph = (struct iphdr*) skb_mac_header(skb);
|
|
|
|
+ memcpy(haddr, &iph->saddr, 4);
|
|
|
|
+ return 4;
|
|
|
|
+}
|
|
|
|
+
|
|
static const struct header_ops ipgre_header_ops = {
|
|
static const struct header_ops ipgre_header_ops = {
|
|
.create = ipgre_header,
|
|
.create = ipgre_header,
|
|
|
|
+ .parse = ipgre_header_parse,
|
|
};
|
|
};
|
|
|
|
|
|
|
|
+#ifdef CONFIG_NET_IPGRE_BROADCAST
|
|
static int ipgre_open(struct net_device *dev)
|
|
static int ipgre_open(struct net_device *dev)
|
|
{
|
|
{
|
|
struct ip_tunnel *t = netdev_priv(dev);
|
|
struct ip_tunnel *t = netdev_priv(dev);
|
|
@@ -1197,6 +1205,8 @@ static int ipgre_tunnel_init(struct net_device *dev)
|
|
dev->stop = ipgre_close;
|
|
dev->stop = ipgre_close;
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
+ } else {
|
|
|
|
+ dev->header_ops = &ipgre_header_ops;
|
|
}
|
|
}
|
|
|
|
|
|
if (!tdev && tunnel->parms.link)
|
|
if (!tdev && tunnel->parms.link)
|