summaryrefslogtreecommitdiff
path: root/net/ipv6/ip6_output.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv6/ip6_output.c')
-rw-r--r--net/ipv6/ip6_output.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index b1e7e7dc5bcd..dfa4fbbe4880 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -5,7 +5,7 @@
* Authors:
* Pedro Roque <roque@di.fc.ul.pt>
*
- * $Id: ip6_output.c,v 1.27 2000/06/21 17:18:40 davem Exp $
+ * $Id: ip6_output.c,v 1.30 2001/03/03 01:20:10 davem Exp $
*
* Based on linux/net/ipv4/ip_output.c
*
@@ -85,7 +85,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
{
newskb->mac.raw = newskb->data;
- skb_pull(newskb, newskb->nh.raw - newskb->data);
+ __skb_pull(newskb, newskb->nh.raw - newskb->data);
newskb->pkt_type = PACKET_LOOPBACK;
newskb->ip_summed = CHECKSUM_UNNECESSARY;
BUG_TRAP(newskb->dst);
@@ -113,7 +113,7 @@ int ip6_output(struct sk_buff *skb)
is not supported in any case.
*/
if (newskb)
- NF_HOOK(PF_INET, NF_IP6_POST_ROUTING, newskb, NULL,
+ NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, newskb, NULL,
newskb->dev,
ip6_dev_loopback_xmit);
@@ -405,7 +405,7 @@ static int ip6_frag_xmit(struct sock *sk, inet_getfrag_t getfrag,
last_skb = sock_alloc_send_skb(sk, unfrag_len + frag_len +
dst->dev->hard_header_len + 15,
- 0, flags & MSG_DONTWAIT, &err);
+ flags & MSG_DONTWAIT, &err);
if (last_skb == NULL)
return err;
@@ -624,7 +624,7 @@ int ip6_build_xmit(struct sock *sk, inet_getfrag_t getfrag, const void *data,
goto out;
skb = sock_alloc_send_skb(sk, pktlength + 15 +
- dev->hard_header_len, 0,
+ dev->hard_header_len,
flags & MSG_DONTWAIT, &err);
if (skb == NULL) {
@@ -697,14 +697,14 @@ int ip6_call_ra_chain(struct sk_buff *skb, int sel)
if (last) {
struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (skb2)
- rawv6_rcv(last, skb2, skb2->len);
+ rawv6_rcv(last, skb2);
}
last = sk;
}
}
if (last) {
- rawv6_rcv(last, skb, skb->len);
+ rawv6_rcv(last, skb);
read_unlock(&ip6_ra_lock);
return 1;
}
@@ -724,7 +724,9 @@ int ip6_forward(struct sk_buff *skb)
struct inet6_skb_parm *opt =(struct inet6_skb_parm*)skb->cb;
if (ipv6_devconf.forwarding == 0 && opt->srcrt == 0)
- goto drop;
+ goto error;
+
+ skb->ip_summed = CHECKSUM_NONE;
/*
* We DO NOT make any processing on
@@ -785,7 +787,7 @@ int ip6_forward(struct sk_buff *skb)
} else if (ipv6_addr_type(&hdr->saddr)&(IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK
|IPV6_ADDR_LINKLOCAL)) {
/* This check is security critical. */
- goto drop;
+ goto error;
}
if (skb->len > dst->pmtu) {
@@ -797,8 +799,8 @@ int ip6_forward(struct sk_buff *skb)
return -EMSGSIZE;
}
- if ((skb = skb_cow(skb, dst->dev->hard_header_len)) == NULL)
- return 0;
+ if (skb_cow(skb, dst->dev->hard_header_len))
+ goto drop;
hdr = skb->nh.ipv6h;
@@ -809,8 +811,9 @@ int ip6_forward(struct sk_buff *skb)
IP6_INC_STATS_BH(Ip6OutForwDatagrams);
return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
-drop:
+error:
IP6_INC_STATS_BH(Ip6InAddrErrors);
+drop:
kfree_skb(skb);
return -EINVAL;
}