Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215217
b: refs/heads/master
c: 27a954b
h: refs/heads/master
i:
  215215: d1cf7a7
v: v3
  • Loading branch information
Andy Walls authored and David S. Miller committed Oct 18, 2010
1 parent ca6298f commit d5f85ef
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 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: a47d60561e111f5009ad0964069cfff77f76dbaa
refs/heads/master: 27a954bd560f3e385bbed38fde3051fe718b8d75
13 changes: 6 additions & 7 deletions trunk/net/ipv4/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -2124,7 +2124,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
ipv4_is_loopback(saddr))
goto martian_source;

if (daddr == htonl(0xFFFFFFFF) || (saddr == 0 && daddr == 0))
if (ipv4_is_lbcast(daddr) || (saddr == 0 && daddr == 0))
goto brd_input;

/* Accept zero addresses only to limited broadcast;
Expand All @@ -2133,8 +2133,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32 daddr, __be32 saddr,
if (ipv4_is_zeronet(saddr))
goto martian_source;

if (ipv4_is_lbcast(daddr) || ipv4_is_zeronet(daddr) ||
ipv4_is_loopback(daddr))
if (ipv4_is_zeronet(daddr) || ipv4_is_loopback(daddr))
goto martian_destination;

/*
Expand Down Expand Up @@ -2367,11 +2366,11 @@ static int __mkroute_output(struct rtable **result,
if (ipv4_is_loopback(fl->fl4_src) && !(dev_out->flags & IFF_LOOPBACK))
return -EINVAL;

if (fl->fl4_dst == htonl(0xFFFFFFFF))
if (ipv4_is_lbcast(fl->fl4_dst))
res->type = RTN_BROADCAST;
else if (ipv4_is_multicast(fl->fl4_dst))
res->type = RTN_MULTICAST;
else if (ipv4_is_lbcast(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
else if (ipv4_is_zeronet(fl->fl4_dst))
return -EINVAL;

if (dev_out->flags & IFF_LOOPBACK)
Expand Down Expand Up @@ -2530,7 +2529,7 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,

if (oldflp->oif == 0 &&
(ipv4_is_multicast(oldflp->fl4_dst) ||
oldflp->fl4_dst == htonl(0xFFFFFFFF))) {
ipv4_is_lbcast(oldflp->fl4_dst))) {
/* It is equivalent to inet_addr_type(saddr) == RTN_LOCAL */
dev_out = __ip_dev_find(net, oldflp->fl4_src, false);
if (dev_out == NULL)
Expand Down Expand Up @@ -2574,7 +2573,7 @@ static int ip_route_output_slow(struct net *net, struct rtable **rp,
goto out; /* Wrong error code */

if (ipv4_is_local_multicast(oldflp->fl4_dst) ||
oldflp->fl4_dst == htonl(0xFFFFFFFF)) {
ipv4_is_lbcast(oldflp->fl4_dst)) {
if (!fl.fl4_src)
fl.fl4_src = inet_select_addr(dev_out, 0,
RT_SCOPE_LINK);
Expand Down

0 comments on commit d5f85ef

Please sign in to comment.