Commit 433760c6 authored by Herbert Xu's avatar Herbert Xu Committed by David S. Miller

[NET]: Give skb_checksum_help() an skb_buff * again

Since skb_checksum_help has been using pskb_expand_head for a while
now without any ill effects, I thought it would be a good idea to
remove the double pointers from it and its callers.

This is what the following patch does.  The only 'rider' bit is the
removal of an unnecessary BUG_ON in ip6_pkt_discard_out.  The preceding
assignment was only added because the following function oopsed so
there is no point in doing BUG_ON.
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3feaf8a0
...@@ -937,7 +937,7 @@ extern int weight_p; ...@@ -937,7 +937,7 @@ extern int weight_p;
extern unsigned long netdev_fc_xoff; extern unsigned long netdev_fc_xoff;
extern atomic_t netdev_dropping; extern atomic_t netdev_dropping;
extern int netdev_set_master(struct net_device *dev, struct net_device *master); extern int netdev_set_master(struct net_device *dev, struct net_device *master);
extern int skb_checksum_help(struct sk_buff **pskb, int inward); extern int skb_checksum_help(struct sk_buff *skb, int inward);
#ifdef CONFIG_SYSCTL #ifdef CONFIG_SYSCTL
extern char *net_sysctl_strdup(const char *s); extern char *net_sysctl_strdup(const char *s);
......
...@@ -67,7 +67,7 @@ struct dst_entry ...@@ -67,7 +67,7 @@ struct dst_entry
struct xfrm_state *xfrm; struct xfrm_state *xfrm;
int (*input)(struct sk_buff*); int (*input)(struct sk_buff*);
int (*output)(struct sk_buff**); int (*output)(struct sk_buff*);
#ifdef CONFIG_NET_CLS_ROUTE #ifdef CONFIG_NET_CLS_ROUTE
__u32 tclassid; __u32 tclassid;
...@@ -222,7 +222,7 @@ static inline int dst_output(struct sk_buff *skb) ...@@ -222,7 +222,7 @@ static inline int dst_output(struct sk_buff *skb)
int err; int err;
for (;;) { for (;;) {
err = skb->dst->output(&skb); err = skb->dst->output(skb);
if (likely(err == 0)) if (likely(err == 0))
return err; return err;
......
...@@ -89,8 +89,8 @@ extern int ip_rcv(struct sk_buff *skb, struct net_device *dev, ...@@ -89,8 +89,8 @@ extern int ip_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt); struct packet_type *pt);
extern int ip_local_deliver(struct sk_buff *skb); extern int ip_local_deliver(struct sk_buff *skb);
extern int ip_mr_input(struct sk_buff *skb); extern int ip_mr_input(struct sk_buff *skb);
extern int ip_output(struct sk_buff **pskb); extern int ip_output(struct sk_buff *skb);
extern int ip_mc_output(struct sk_buff **pskb); extern int ip_mc_output(struct sk_buff *skb);
extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*)); extern int ip_fragment(struct sk_buff *skb, int (*out)(struct sk_buff*));
extern int ip_do_nat(struct sk_buff *skb); extern int ip_do_nat(struct sk_buff *skb);
extern void ip_send_check(struct iphdr *ip); extern void ip_send_check(struct iphdr *ip);
......
...@@ -70,7 +70,7 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr, ...@@ -70,7 +70,7 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
struct neighbour *neigh, struct neighbour *neigh,
struct in6_addr *addr, struct in6_addr *addr,
int (*output)(struct sk_buff **)); int (*output)(struct sk_buff *));
extern int ndisc_dst_gc(int *more); extern int ndisc_dst_gc(int *more);
extern void fib6_force_start_gc(void); extern void fib6_force_start_gc(void);
......
...@@ -355,7 +355,7 @@ extern int ip6_dst_lookup(struct sock *sk, ...@@ -355,7 +355,7 @@ extern int ip6_dst_lookup(struct sock *sk,
* skb processing functions * skb processing functions
*/ */
extern int ip6_output(struct sk_buff **pskb); extern int ip6_output(struct sk_buff *skb);
extern int ip6_forward(struct sk_buff *skb); extern int ip6_forward(struct sk_buff *skb);
extern int ip6_input(struct sk_buff *skb); extern int ip6_input(struct sk_buff *skb);
extern int ip6_mc_input(struct sk_buff *skb); extern int ip6_mc_input(struct sk_buff *skb);
......
...@@ -815,7 +815,7 @@ extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq); ...@@ -815,7 +815,7 @@ extern void xfrm_replay_advance(struct xfrm_state *x, u32 seq);
extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl); extern int xfrm_check_selectors(struct xfrm_state **x, int n, struct flowi *fl);
extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb); extern int xfrm_state_check(struct xfrm_state *x, struct sk_buff *skb);
extern int xfrm4_rcv(struct sk_buff *skb); extern int xfrm4_rcv(struct sk_buff *skb);
extern int xfrm4_output(struct sk_buff **pskb); extern int xfrm4_output(struct sk_buff *skb);
extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_register(struct xfrm_tunnel *handler);
extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler); extern int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler);
extern int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi); extern int xfrm6_rcv_spi(struct sk_buff **pskb, unsigned int *nhoffp, u32 spi);
...@@ -825,7 +825,7 @@ extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler); ...@@ -825,7 +825,7 @@ extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler);
extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr); extern u32 xfrm6_tunnel_alloc_spi(xfrm_address_t *saddr);
extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr); extern void xfrm6_tunnel_free_spi(xfrm_address_t *saddr);
extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr); extern u32 xfrm6_tunnel_spi_lookup(xfrm_address_t *saddr);
extern int xfrm6_output(struct sk_buff **pskb); extern int xfrm6_output(struct sk_buff *skb);
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type); extern int xfrm4_rcv_encap(struct sk_buff *skb, __u16 encap_type);
......
...@@ -197,7 +197,7 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb) ...@@ -197,7 +197,7 @@ static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
skb_pull(skb, VLAN_HLEN); skb_pull(skb, VLAN_HLEN);
skb->nh.raw += VLAN_HLEN; skb->nh.raw += VLAN_HLEN;
} }
skb->dst->output(&skb); skb->dst->output(skb);
return 0; return 0;
} }
......
...@@ -1106,34 +1106,34 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) ...@@ -1106,34 +1106,34 @@ void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
* Invalidate hardware checksum when packet is to be mangled, and * Invalidate hardware checksum when packet is to be mangled, and
* complete checksum manually on outgoing path. * complete checksum manually on outgoing path.
*/ */
int skb_checksum_help(struct sk_buff **pskb, int inward) int skb_checksum_help(struct sk_buff *skb, int inward)
{ {
unsigned int csum; unsigned int csum;
int ret = 0, offset = (*pskb)->h.raw - (*pskb)->data; int ret = 0, offset = skb->h.raw - skb->data;
if (inward) { if (inward) {
(*pskb)->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
goto out; goto out;
} }
if (skb_cloned(*pskb)) { if (skb_cloned(skb)) {
ret = pskb_expand_head(*pskb, 0, 0, GFP_ATOMIC); ret = pskb_expand_head(skb, 0, 0, GFP_ATOMIC);
if (ret) if (ret)
goto out; goto out;
} }
if (offset > (int)(*pskb)->len) if (offset > (int)skb->len)
BUG(); BUG();
csum = skb_checksum(*pskb, offset, (*pskb)->len-offset, 0); csum = skb_checksum(skb, offset, skb->len-offset, 0);
offset = (*pskb)->tail - (*pskb)->h.raw; offset = skb->tail - skb->h.raw;
if (offset <= 0) if (offset <= 0)
BUG(); BUG();
if ((*pskb)->csum + 2 > offset) if (skb->csum + 2 > offset)
BUG(); BUG();
*(u16*)((*pskb)->h.raw + (*pskb)->csum) = csum_fold(csum); *(u16*)(skb->h.raw + skb->csum) = csum_fold(csum);
(*pskb)->ip_summed = CHECKSUM_NONE; skb->ip_summed = CHECKSUM_NONE;
out: out:
return ret; return ret;
} }
...@@ -1282,7 +1282,7 @@ int dev_queue_xmit(struct sk_buff *skb) ...@@ -1282,7 +1282,7 @@ int dev_queue_xmit(struct sk_buff *skb)
(!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) && (!(dev->features & (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)) &&
(!(dev->features & NETIF_F_IP_CSUM) || (!(dev->features & NETIF_F_IP_CSUM) ||
skb->protocol != htons(ETH_P_IP)))) skb->protocol != htons(ETH_P_IP))))
if (skb_checksum_help(&skb, 0)) if (skb_checksum_help(skb, 0))
goto out_kfree_skb; goto out_kfree_skb;
......
...@@ -106,9 +106,9 @@ static int dst_discard_in(struct sk_buff *skb) ...@@ -106,9 +106,9 @@ static int dst_discard_in(struct sk_buff *skb)
return 0; return 0;
} }
static int dst_discard_out(struct sk_buff **pskb) static int dst_discard_out(struct sk_buff *skb)
{ {
kfree_skb(*pskb); kfree_skb(skb);
return 0; return 0;
} }
......
...@@ -683,9 +683,8 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type ...@@ -683,9 +683,8 @@ int dn_route_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type
return NET_RX_DROP; return NET_RX_DROP;
} }
static int dn_output(struct sk_buff **pskb) static int dn_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct dn_route *rt = (struct dn_route *)dst; struct dn_route *rt = (struct dn_route *)dst;
struct net_device *dev = dst->dev; struct net_device *dev = dst->dev;
...@@ -796,11 +795,6 @@ static int dn_rt_bug(struct sk_buff *skb) ...@@ -796,11 +795,6 @@ static int dn_rt_bug(struct sk_buff *skb)
return NET_RX_BAD; return NET_RX_BAD;
} }
static int dn_rt_bug_out(struct sk_buff **pskb)
{
return dn_rt_bug(*pskb);
}
static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res) static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
{ {
struct dn_fib_info *fi = res->fi; struct dn_fib_info *fi = res->fi;
...@@ -1392,7 +1386,7 @@ static int dn_route_input_slow(struct sk_buff *skb) ...@@ -1392,7 +1386,7 @@ static int dn_route_input_slow(struct sk_buff *skb)
rt->u.dst.neighbour = neigh; rt->u.dst.neighbour = neigh;
rt->u.dst.dev = out_dev; rt->u.dst.dev = out_dev;
rt->u.dst.lastuse = jiffies; rt->u.dst.lastuse = jiffies;
rt->u.dst.output = dn_rt_bug_out; rt->u.dst.output = dn_rt_bug;
switch(res.type) { switch(res.type) {
case RTN_UNICAST: case RTN_UNICAST:
rt->u.dst.input = dn_forward; rt->u.dst.input = dn_forward;
......
...@@ -224,9 +224,8 @@ int ip_finish_output(struct sk_buff *skb) ...@@ -224,9 +224,8 @@ int ip_finish_output(struct sk_buff *skb)
ip_finish_output2); ip_finish_output2);
} }
int ip_mc_output(struct sk_buff **pskb) int ip_mc_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
struct rtable *rt = (struct rtable*)skb->dst; struct rtable *rt = (struct rtable*)skb->dst;
struct net_device *dev = rt->u.dst.dev; struct net_device *dev = rt->u.dst.dev;
...@@ -285,10 +284,8 @@ int ip_mc_output(struct sk_buff **pskb) ...@@ -285,10 +284,8 @@ int ip_mc_output(struct sk_buff **pskb)
return ip_finish_output(skb); return ip_finish_output(skb);
} }
int ip_output(struct sk_buff **pskb) int ip_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS); IP_INC_STATS(IPSTATS_MIB_OUTREQUESTS);
if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) && if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list) &&
......
...@@ -69,7 +69,7 @@ fw_in(unsigned int hooknum, ...@@ -69,7 +69,7 @@ fw_in(unsigned int hooknum,
/* Assume worse case: any hook could change packet */ /* Assume worse case: any hook could change packet */
(*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED; (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED;
if ((*pskb)->ip_summed == CHECKSUM_HW) if ((*pskb)->ip_summed == CHECKSUM_HW)
if (skb_checksum_help(pskb, (out == NULL))) if (skb_checksum_help(*pskb, (out == NULL)))
return NF_DROP; return NF_DROP;
switch (hooknum) { switch (hooknum) {
......
...@@ -86,7 +86,7 @@ ip_nat_fn(unsigned int hooknum, ...@@ -86,7 +86,7 @@ ip_nat_fn(unsigned int hooknum,
/* If we had a hardware checksum before, it's now invalid */ /* If we had a hardware checksum before, it's now invalid */
if ((*pskb)->ip_summed == CHECKSUM_HW) if ((*pskb)->ip_summed == CHECKSUM_HW)
if (skb_checksum_help(pskb, (out == NULL))) if (skb_checksum_help(*pskb, (out == NULL)))
return NF_DROP; return NF_DROP;
ct = ip_conntrack_get(*pskb, &ctinfo); ct = ip_conntrack_get(*pskb, &ctinfo);
......
...@@ -86,7 +86,7 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward) ...@@ -86,7 +86,7 @@ set_ect_tcp(struct sk_buff **pskb, const struct ipt_ECN_info *einfo, int inward)
memcpy((*pskb)->data + (*pskb)->nh.iph->ihl*4, memcpy((*pskb)->data + (*pskb)->nh.iph->ihl*4,
&_tcph, sizeof(_tcph)); &_tcph, sizeof(_tcph));
if ((*pskb)->ip_summed == CHECKSUM_HW) if ((*pskb)->ip_summed == CHECKSUM_HW)
if (skb_checksum_help(pskb, inward)) if (skb_checksum_help(*pskb, inward))
return 0; return 0;
(*pskb)->nfcache |= NFC_ALTERED; (*pskb)->nfcache |= NFC_ALTERED;
} }
......
...@@ -1367,10 +1367,8 @@ static void ipv4_link_failure(struct sk_buff *skb) ...@@ -1367,10 +1367,8 @@ static void ipv4_link_failure(struct sk_buff *skb)
dst_set_expires(&rt->u.dst, 0); dst_set_expires(&rt->u.dst, 0);
} }
static int ip_rt_bug(struct sk_buff **pskb) static int ip_rt_bug(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
printk(KERN_DEBUG "ip_rt_bug: %u.%u.%u.%u -> %u.%u.%u.%u, %s\n", printk(KERN_DEBUG "ip_rt_bug: %u.%u.%u.%u -> %u.%u.%u.%u, %s\n",
NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr), NIPQUAD(skb->nh.iph->saddr), NIPQUAD(skb->nh.iph->daddr),
skb->dev ? skb->dev->name : "?"); skb->dev ? skb->dev->name : "?");
......
...@@ -91,16 +91,14 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb) ...@@ -91,16 +91,14 @@ static int xfrm4_tunnel_check_size(struct sk_buff *skb)
return ret; return ret;
} }
int xfrm4_output(struct sk_buff **pskb) int xfrm4_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct xfrm_state *x = dst->xfrm; struct xfrm_state *x = dst->xfrm;
int err; int err;
if (skb->ip_summed == CHECKSUM_HW) { if (skb->ip_summed == CHECKSUM_HW) {
err = skb_checksum_help(pskb, 0); err = skb_checksum_help(skb, 0);
skb = *pskb;
if (err) if (err)
goto error_nolock; goto error_nolock;
} }
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
#include <net/xfrm.h> #include <net/xfrm.h>
#include <net/checksum.h> #include <net/checksum.h>
static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)); static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *));
static __inline__ void ipv6_select_ident(struct sk_buff *skb, struct frag_hdr *fhdr) static __inline__ void ipv6_select_ident(struct sk_buff *skb, struct frag_hdr *fhdr)
{ {
...@@ -108,9 +108,8 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb) ...@@ -108,9 +108,8 @@ static int ip6_dev_loopback_xmit(struct sk_buff *newskb)
} }
static int ip6_output2(struct sk_buff **pskb) static int ip6_output2(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct net_device *dev = dst->dev; struct net_device *dev = dst->dev;
...@@ -146,14 +145,12 @@ static int ip6_output2(struct sk_buff **pskb) ...@@ -146,14 +145,12 @@ static int ip6_output2(struct sk_buff **pskb)
return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish); return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
} }
int ip6_output(struct sk_buff **pskb) int ip6_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list)) if ((skb->len > dst_pmtu(skb->dst) || skb_shinfo(skb)->frag_list))
return ip6_fragment(pskb, ip6_output2); return ip6_fragment(skb, ip6_output2);
else else
return ip6_output2(pskb); return ip6_output2(skb);
} }
#ifdef CONFIG_NETFILTER #ifdef CONFIG_NETFILTER
...@@ -518,10 +515,10 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr) ...@@ -518,10 +515,10 @@ int ip6_find_1stfragopt(struct sk_buff *skb, u8 **nexthdr)
return offset; return offset;
} }
static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)) static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff *))
{ {
struct net_device *dev; struct net_device *dev;
struct sk_buff *frag, *skb = *pskb; struct sk_buff *frag;
struct rt6_info *rt = (struct rt6_info*)skb->dst; struct rt6_info *rt = (struct rt6_info*)skb->dst;
struct ipv6hdr *tmp_hdr; struct ipv6hdr *tmp_hdr;
struct frag_hdr *fh; struct frag_hdr *fh;
...@@ -610,7 +607,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)) ...@@ -610,7 +607,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
ip6_copy_metadata(frag, skb); ip6_copy_metadata(frag, skb);
} }
err = output(&skb); err = output(skb);
if (err || !frag) if (err || !frag)
break; break;
...@@ -726,7 +723,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**)) ...@@ -726,7 +723,7 @@ static int ip6_fragment(struct sk_buff **pskb, int (*output)(struct sk_buff**))
IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES); IP6_INC_STATS(IPSTATS_MIB_FRAGCREATES);
err = output(&frag); err = output(frag);
if (err) if (err)
goto fail; goto fail;
} }
......
...@@ -88,7 +88,7 @@ static void ip6_dst_ifdown(struct dst_entry *, int how); ...@@ -88,7 +88,7 @@ static void ip6_dst_ifdown(struct dst_entry *, int how);
static int ip6_dst_gc(void); static int ip6_dst_gc(void);
static int ip6_pkt_discard(struct sk_buff *skb); static int ip6_pkt_discard(struct sk_buff *skb);
static int ip6_pkt_discard_out(struct sk_buff **pskb); static int ip6_pkt_discard_out(struct sk_buff *skb);
static void ip6_link_failure(struct sk_buff *skb); static void ip6_link_failure(struct sk_buff *skb);
static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu); static void ip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu);
...@@ -638,7 +638,7 @@ static inline unsigned int ipv6_advmss(unsigned int mtu) ...@@ -638,7 +638,7 @@ static inline unsigned int ipv6_advmss(unsigned int mtu)
struct dst_entry *ndisc_dst_alloc(struct net_device *dev, struct dst_entry *ndisc_dst_alloc(struct net_device *dev,
struct neighbour *neigh, struct neighbour *neigh,
struct in6_addr *addr, struct in6_addr *addr,
int (*output)(struct sk_buff **)) int (*output)(struct sk_buff *))
{ {
struct rt6_info *rt; struct rt6_info *rt;
struct inet6_dev *idev = in6_dev_get(dev); struct inet6_dev *idev = in6_dev_get(dev);
...@@ -1362,11 +1362,10 @@ int ip6_pkt_discard(struct sk_buff *skb) ...@@ -1362,11 +1362,10 @@ int ip6_pkt_discard(struct sk_buff *skb)
return 0; return 0;
} }
int ip6_pkt_discard_out(struct sk_buff **pskb) int ip6_pkt_discard_out(struct sk_buff *skb)
{ {
(*pskb)->dev = (*pskb)->dst->dev; skb->dev = skb->dst->dev;
BUG_ON(!(*pskb)->dev); return ip6_pkt_discard(skb);
return ip6_pkt_discard(*pskb);
} }
/* /*
......
...@@ -91,16 +91,14 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb) ...@@ -91,16 +91,14 @@ static int xfrm6_tunnel_check_size(struct sk_buff *skb)
return ret; return ret;
} }
int xfrm6_output(struct sk_buff **pskb) int xfrm6_output(struct sk_buff *skb)
{ {
struct sk_buff *skb = *pskb;
struct dst_entry *dst = skb->dst; struct dst_entry *dst = skb->dst;
struct xfrm_state *x = dst->xfrm; struct xfrm_state *x = dst->xfrm;
int err; int err;
if (skb->ip_summed == CHECKSUM_HW) { if (skb->ip_summed == CHECKSUM_HW) {
err = skb_checksum_help(pskb, 0); err = skb_checksum_help(skb, 0);
skb = *pskb;
if (err) if (err)
goto error_nolock; goto error_nolock;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment