Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 289879
b: refs/heads/master
c: 576f3cc
h: refs/heads/master
i:
  289877: b93f172
  289875: a71ebc9
  289871: 0a3922c
v: v3
  • Loading branch information
sjur.brandeland@stericsson.com authored and David S. Miller committed Feb 4, 2012
1 parent e7fbd1c commit 84be483
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4a695823b580124c3ab750d8d528f7c6522628c3
refs/heads/master: 576f3cc7fb94a22df2ced8dcba7d48ff42f8e745
12 changes: 6 additions & 6 deletions trunk/net/caif/chnl_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
struct sk_buff *skb;
struct chnl_net *priv = container_of(layr, struct chnl_net, chnl);
int pktlen;
int err = 0;
const u8 *ip_version;
u8 buf;

Expand All @@ -95,8 +94,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)

/* check the version of IP */
ip_version = skb_header_pointer(skb, 0, 1, &buf);
if (!ip_version)
return -EINVAL;

switch (*ip_version >> 4) {
case 4:
skb->protocol = htons(ETH_P_IP);
Expand All @@ -105,6 +103,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
skb->protocol = htons(ETH_P_IPV6);
break;
default:
priv->netdev->stats.rx_errors++;
return -EINVAL;
}

Expand All @@ -123,7 +122,7 @@ static int chnl_recv_cb(struct cflayer *layr, struct cfpkt *pkt)
priv->netdev->stats.rx_packets++;
priv->netdev->stats.rx_bytes += pktlen;

return err;
return 0;
}

static int delete_device(struct chnl_net *dev)
Expand Down Expand Up @@ -221,11 +220,13 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)

if (skb->len > priv->netdev->mtu) {
pr_warn("Size of skb exceeded MTU\n");
dev->stats.tx_errors++;
return -ENOSPC;
}

if (!priv->flowenabled) {
pr_debug("dropping packets flow off\n");
dev->stats.tx_dropped++;
return NETDEV_TX_BUSY;
}

Expand All @@ -240,8 +241,7 @@ static int chnl_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Send the packet down the stack. */
result = priv->chnl.dn->transmit(priv->chnl.dn, pkt);
if (result) {
if (result == -EAGAIN)
result = NETDEV_TX_BUSY;
dev->stats.tx_dropped++;
return result;
}

Expand Down

0 comments on commit 84be483

Please sign in to comment.