return (addr & htonl(0xffffff00)) == htonl(0xe0000000);
}
-static inline bool ipv4_is_badclass(__be32 addr)
+static inline bool ipv4_is_lbcast(__be32 addr)
{
- return (addr & htonl(0xf0000000)) == htonl(0xf0000000);
+ /* limited broadcast */
+ return addr == INADDR_BROADCAST;
}
static inline bool ipv4_is_zeronet(__be32 addr)
ipv4_is_private_172(addr) || ipv4_is_test_192(addr) ||
ipv4_is_anycast_6to4(addr) || ipv4_is_private_192(addr) ||
ipv4_is_test_198(addr) || ipv4_is_multicast(addr) ||
- ipv4_is_badclass(addr)) ? 0x00 : 0x02;
+ ipv4_is_lbcast(addr)) ? 0x00 : 0x02;
eui[1] = 0;
eui[2] = 0x5E;
eui[3] = 0xFE;
unsigned ret = RTN_BROADCAST;
struct fib_table *local_table;
- if (ipv4_is_zeronet(addr) || ipv4_is_badclass(addr))
+ if (ipv4_is_zeronet(addr) || ipv4_is_lbcast(addr))
return RTN_BROADCAST;
if (ipv4_is_multicast(addr))
return RTN_MULTICAST;
return;
if (new_gw == old_gw || !IN_DEV_RX_REDIRECTS(in_dev)
- || ipv4_is_multicast(new_gw) || ipv4_is_badclass(new_gw)
+ || ipv4_is_multicast(new_gw) || ipv4_is_lbcast(new_gw)
|| ipv4_is_zeronet(new_gw))
goto reject_redirect;
if (in_dev == NULL)
return -EINVAL;
- if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+ if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
ipv4_is_loopback(saddr) || skb->protocol != htons(ETH_P_IP))
goto e_inval;
by fib_lookup.
*/
- if (ipv4_is_multicast(saddr) || ipv4_is_badclass(saddr) ||
+ if (ipv4_is_multicast(saddr) || ipv4_is_lbcast(saddr) ||
ipv4_is_loopback(saddr))
goto martian_source;
if (ipv4_is_zeronet(saddr))
goto martian_source;
- if (ipv4_is_badclass(daddr) || ipv4_is_zeronet(daddr) ||
+ if (ipv4_is_lbcast(daddr) || ipv4_is_zeronet(daddr) ||
ipv4_is_loopback(daddr))
goto martian_destination;
res->type = RTN_BROADCAST;
else if (ipv4_is_multicast(fl->fl4_dst))
res->type = RTN_MULTICAST;
- else if (ipv4_is_badclass(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
+ else if (ipv4_is_lbcast(fl->fl4_dst) || ipv4_is_zeronet(fl->fl4_dst))
return -EINVAL;
if (dev_out->flags & IFF_LOOPBACK)
if (oldflp->fl4_src) {
err = -EINVAL;
if (ipv4_is_multicast(oldflp->fl4_src) ||
- ipv4_is_badclass(oldflp->fl4_src) ||
+ ipv4_is_lbcast(oldflp->fl4_src) ||
ipv4_is_zeronet(oldflp->fl4_src))
goto out;