aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/route.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-09-29 16:27:47 -0700
committerDavid S. Miller <davem@davemloft.net>2015-09-29 16:27:47 -0700
commit4c7e622ddf07388d72e15b97a88d260a5a168e37 (patch)
treed2b02fd6fdeb54f8a8cd2a0493b07a27ff698b0b /net/ipv4/route.c
parentRESEND: [PATCH v3 net-next] sky2: use random address if EEPROM is bad (diff)
parentnet: Remove martian_source_keep_err goto label (diff)
downloadlinux-dev-4c7e622ddf07388d72e15b97a88d260a5a168e37.tar.xz
linux-dev-4c7e622ddf07388d72e15b97a88d260a5a168e37.zip
Merge branch 'ipv4-routing-cleanups'
Alexander Duyck says: ==================== Minor IPv4 routing cleanups These patches just contain some minor cleanups to address a few minor issues. The first and the third mostly just improve readability. The second patch should improve the performance for multicast destination addresses that do not have a localhost source IP address by avoiding some unnecessary dereferences. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/route.c')
-rw-r--r--net/ipv4/route.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 6bab84503cd9..8c84a6664b30 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -1487,9 +1487,8 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr,
skb->protocol != htons(ETH_P_IP))
goto e_inval;
- if (likely(!IN_DEV_ROUTE_LOCALNET(in_dev)))
- if (ipv4_is_loopback(saddr))
- goto e_inval;
+ if (ipv4_is_loopback(saddr) && !IN_DEV_ROUTE_LOCALNET(in_dev))
+ goto e_inval;
if (ipv4_is_zeronet(saddr)) {
if (!ipv4_is_local_multicast(daddr))
@@ -1760,7 +1759,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
err = fib_validate_source(skb, saddr, daddr, tos,
0, dev, in_dev, &itag);
if (err < 0)
- goto martian_source_keep_err;
+ goto martian_source;
goto local_input;
}
@@ -1782,7 +1781,7 @@ brd_input:
err = fib_validate_source(skb, saddr, 0, tos, 0, dev,
in_dev, &itag);
if (err < 0)
- goto martian_source_keep_err;
+ goto martian_source;
}
flags |= RTCF_BROADCAST;
res.type = RTN_BROADCAST;
@@ -1858,8 +1857,6 @@ e_nobufs:
goto out;
martian_source:
- err = -EINVAL;
-martian_source_keep_err:
ip_handle_martian_source(dev, in_dev, skb, daddr, saddr);
goto out;
}