summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
committerRalf Baechle <ralf@linux-mips.org>1998-03-17 22:05:47 +0000
commit27cfca1ec98e91261b1a5355d10a8996464b63af (patch)
tree8e895a53e372fa682b4c0a585b9377d67ed70d0e /net/ipv4/ip_gre.c
parent6a76fb7214c477ccf6582bd79c5b4ccc4f9c41b1 (diff)
Look Ma' what I found on my harddisk ...
o New faster syscalls for 2.1.x, too o Upgrade to 2.1.89. Don't try to run this. It's flaky as hell. But feel free to debug ...
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c61
1 files changed, 14 insertions, 47 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index dbd62e27e..04fde6120 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -452,7 +452,7 @@ void ipgre_err(struct sk_buff *skb, unsigned char *dp, int len)
/* Try to guess incoming interface */
if (ip_route_output(&rt, eiph->saddr, 0, RT_TOS(eiph->tos), 0)) {
- kfree_skb(skb2, FREE_WRITE);
+ kfree_skb(skb2);
return;
}
skb2->dev = rt->u.dst.dev;
@@ -464,14 +464,14 @@ void ipgre_err(struct sk_buff *skb, unsigned char *dp, int len)
if (ip_route_output(&rt, eiph->daddr, eiph->saddr, eiph->tos, 0) ||
rt->u.dst.dev->type != ARPHRD_IPGRE) {
ip_rt_put(rt);
- kfree_skb(skb2, FREE_WRITE);
+ kfree_skb(skb2);
return;
}
} else {
ip_rt_put(rt);
if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos, skb2->dev) ||
skb2->dst->dev->type != ARPHRD_IPGRE) {
- kfree_skb(skb2, FREE_WRITE);
+ kfree_skb(skb2);
return;
}
}
@@ -479,7 +479,7 @@ void ipgre_err(struct sk_buff *skb, unsigned char *dp, int len)
/* change mtu on this route */
if (type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED) {
if (rel_info > skb2->dst->pmtu) {
- kfree_skb(skb2, FREE_WRITE);
+ kfree_skb(skb2);
return;
}
skb2->dst->pmtu = rel_info;
@@ -493,7 +493,7 @@ void ipgre_err(struct sk_buff *skb, unsigned char *dp, int len)
}
icmp_send(skb2, rel_type, rel_code, rel_info);
- kfree_skb(skb2, FREE_WRITE);
+ kfree_skb(skb2);
#endif
}
@@ -554,7 +554,7 @@ int ipgre_rcv(struct sk_buff *skb, unsigned short len)
}
if (tunnel->parms.i_flags&GRE_SEQ) {
if (!(flags&GRE_SEQ) ||
- (tunnel->i_seqno && seqno - tunnel->i_seqno < 0)) {
+ (tunnel->i_seqno && (s32)(seqno - tunnel->i_seqno) < 0)) {
tunnel->stat.rx_fifo_errors++;
tunnel->stat.rx_errors++;
goto drop;
@@ -572,7 +572,7 @@ int ipgre_rcv(struct sk_buff *skb, unsigned short len)
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_PROT_UNREACH, 0);
drop:
- kfree_skb(skb, FREE_READ);
+ kfree_skb(skb);
return(0);
}
@@ -622,12 +622,12 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct device *dev)
else if (skb->protocol == __constant_htons(ETH_P_IPV6)) {
struct in6_addr *addr6;
int addr_type;
- struct nd_neigh *neigh = (struct nd_neigh *) skb->dst->neighbour;
+ struct neighbour *neigh = skb->dst->neighbour;
if (neigh == NULL)
goto tx_error;
- addr6 = &neigh->ndn_addr;
+ addr6 = (struct in6_addr*)&neigh->primary_key;
addr_type = ipv6_addr_type(addr6);
if (addr_type == IPV6_ADDR_ANY) {
@@ -704,12 +704,7 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct device *dev)
if (jiffies - tunnel->err_time < IPTUNNEL_ERR_TIMEO) {
tunnel->err_count--;
- if (skb->protocol == __constant_htons(ETH_P_IP))
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
-#ifdef CONFIG_IPV6
- else if (skb->protocol == __constant_htons(ETH_P_IPV6))
- icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0, dev);
-#endif
+ dst_link_failure(skb);
} else
tunnel->err_count = 0;
}
@@ -723,11 +718,11 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct device *dev)
if (!new_skb) {
ip_rt_put(rt);
stats->tx_dropped++;
- dev_kfree_skb(skb, FREE_WRITE);
+ dev_kfree_skb(skb);
tunnel->recursion--;
return 0;
}
- dev_kfree_skb(skb, FREE_WRITE);
+ dev_kfree_skb(skb);
skb = new_skb;
}
@@ -792,16 +787,11 @@ static int ipgre_tunnel_xmit(struct sk_buff *skb, struct device *dev)
return 0;
tx_error_icmp:
- if (skb->protocol == __constant_htons(ETH_P_IP))
- icmp_send(skb, ICMP_DEST_UNREACH, ICMP_HOST_UNREACH, 0);
-#ifdef CONFIG_IPV6
- else if (skb->protocol == __constant_htons(ETH_P_IPV6))
- icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_ADDR_UNREACH, 0, dev);
-#endif
+ dst_link_failure(skb);
tx_error:
stats->tx_errors++;
- dev_kfree_skb(skb, FREE_WRITE);
+ dev_kfree_skb(skb);
tunnel->recursion--;
return 0;
}
@@ -962,28 +952,6 @@ static int ipgre_header(struct sk_buff *skb, struct device *dev, unsigned short
return -t->hlen;
}
-static int ipgre_rebuild_header(struct sk_buff *skb)
-{
- struct device *dev = skb->dev;
- struct iphdr *iph = (struct iphdr *)skb->data;
- u16 *p = (u16*)(iph + 1);
- struct neighbour *neigh = NULL;
-
- if (skb->dst)
- neigh = skb->dst->neighbour;
-
- if (neigh)
- return neigh->ops->resolve((void*)&iph->daddr, skb);
-
- if (p[1] == __constant_htons(ETH_P_IP))
- return arp_find((void*)&iph->daddr, skb);
-
- if (net_ratelimit())
- printk(KERN_DEBUG "%s: unable to resolve type %X addresses.\n",
- dev->name, (int)p[1]);
- return 0;
-}
-
static int ipgre_open(struct device *dev)
{
struct ip_tunnel *t = (struct ip_tunnel*)dev->priv;
@@ -1076,7 +1044,6 @@ static int ipgre_tunnel_init(struct device *dev)
return -EINVAL;
dev->flags = IFF_BROADCAST;
dev->hard_header = ipgre_header;
- dev->rebuild_header = ipgre_rebuild_header;
dev->open = ipgre_open;
dev->stop = ipgre_close;
}