Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3916
b: refs/heads/master
c: 2c2910a
h: refs/heads/master
v: v3
  • Loading branch information
Dietmar Eggemann authored and David S. Miller committed Jun 28, 2005
1 parent d121a2d commit e625068
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 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: ae9cda5d65f3d8a495241cbdcc2d56f721c83cc3
refs/heads/master: 2c2910a401f1ce2ac9136171e7522e731e1a2a8c
6 changes: 5 additions & 1 deletion trunk/net/ipv4/ip_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,18 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
{
struct net_device *dev = skb->dev;
struct iphdr *iph = skb->nh.iph;
int err;

/*
* Initialise the virtual path cache for the packet. It describes
* how the packet travels inside Linux networking.
*/
if (skb->dst == NULL) {
if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))
if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
if (err == -EHOSTUNREACH)
IP_INC_STATS_BH(IPSTATS_MIB_INADDRERRORS);
goto drop;
}
}

#ifdef CONFIG_NET_CLS_ROUTE
Expand Down
9 changes: 7 additions & 2 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
*/
if ((err = fib_lookup(&fl, &res)) != 0) {
if (!IN_DEV_FORWARD(in_dev))
goto e_inval;
goto e_hostunreach;
goto no_route;
}
free_res = 1;
Expand All @@ -1933,7 +1933,7 @@ static int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
}

if (!IN_DEV_FORWARD(in_dev))
goto e_inval;
goto e_hostunreach;
if (res.type != RTN_UNICAST)
goto martian_destination;

Expand Down Expand Up @@ -2025,6 +2025,11 @@ out: return err;
"%u.%u.%u.%u, dev %s\n",
NIPQUAD(daddr), NIPQUAD(saddr), dev->name);
#endif

e_hostunreach:
err = -EHOSTUNREACH;
goto done;

e_inval:
err = -EINVAL;
goto done;
Expand Down

0 comments on commit e625068

Please sign in to comment.