Skip to contentSkip to conversation

IPv4: Remove check for ipv4_is_lbcast() that will always return false

PATCH In review Andy Walls 2 participants 3 messages Oct 10, 2010 – Oct 18, 2010

Subsystems (3)
lore
Share & tools
lore

Andy Walls

author
#0 lore raw

PATCH 1/1 IPv4: Remove check for ipv4_is_lbcast() that will always return false

In making an IPv4 routing decision, packets with an all 1's broadcast destination are accepted as input packets, before being checked for being a martian. Remove the martian check for the all 1's broadcast destination address. Make the initial check for the all 1's broadcast destination address easier to read.

net/ipv4/route.c +2 -3
index ac6559c..2b8c071 100644
@@ -2124,7 +2124,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32
            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;
@@ -2133,8 +2133,7 @@ static int ip_route_input_slow(struct sk_buff *skb, __be32
        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;
 
        /*
maintainer
#1 lore raw

From: Andy Walls <[email protected]>
Date: Sun, 10 Oct 2010 12:10:21 -0400

Quoted 7 lines

In making an IPv4 routing decision, packets with an all 1's broadcast destination are accepted as input packets, before being checked for being a martian. Remove the martian check for the all 1's broadcast destination address. Make the initial check for the all 1's broadcast destination address easier to read.

Your email client corrupted this patch, by turning tab characters into spaces, amongst other things.

Please give Documentation/email-clients.txt a read and resubmit this patch after you have these issues sorted out.

Thank you.

author
#2 lore raw
Quoted 9 lines · David Miller

From: Andy Walls <[email protected]>
Date: Sun, 10 Oct 2010 12:10:21 -0400

Quoted 6 lines

In making an IPv4 routing decision, packets with an all 1's broadcast destination are accepted as input packets, before being checked for being a martian. Remove the martian check for the all 1's broadcast destination address. Make the initial check for the all 1's broadcast destination address easier to read.

Quoted 4 lines
Quoted 1 line

Your email client corrupted this patch, by turning tab characters into spaces, amongst other things.

No, that was me in a rush, thoughtlessly cutting and pasting into the e-mail client window.

I will resubmit shortly. Sorry for the wasting your time on the malformed submission.

Regards,
Andy

Quoted 4 lines

Please give Documentation/email-clients.txt a read and resubmit this patch after you have these issues sorted out.

Thank you.