Keep blocks corresponding to the delivery path together.  This helps
when looking for differences with IPv6 and will make it easier to merge
multicast checks.

ok?

Index: netinet/ip_input.c
===================================================================
RCS file: /cvs/src/sys/netinet/ip_input.c,v
retrieving revision 1.285
diff -u -p -r1.285 ip_input.c
--- netinet/ip_input.c  14 Nov 2016 04:27:03 -0000      1.285
+++ netinet/ip_input.c  22 Nov 2016 13:55:48 -0000
@@ -357,6 +357,12 @@ ipv4_input(struct mbuf *m)
                goto out;
        }
 
+       if (ip->ip_dst.s_addr == INADDR_BROADCAST ||
+           ip->ip_dst.s_addr == INADDR_ANY) {
+               ip_ours(m);
+               goto out;
+       }
+
        if (in_ouraddr(m, ifp, &rt)) {
                ip_ours(m);
                goto out;
@@ -421,12 +427,6 @@ ipv4_input(struct mbuf *m)
                                ipstat_inc(ips_cantforward);
                        goto bad;
                }
-               ip_ours(m);
-               goto out;
-       }
-
-       if (ip->ip_dst.s_addr == INADDR_BROADCAST ||
-           ip->ip_dst.s_addr == INADDR_ANY) {
                ip_ours(m);
                goto out;
        }

Reply via email to