aboutsummaryrefslogtreecommitdiff
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2008-03-19 22:29:11 +0000
committerJulian Elischer <julian@FreeBSD.org>2008-03-19 22:29:11 +0000
commit29481f88465a042fa50479f6efcca2386c86b599 (patch)
treec61c0309dcbb8bc88f933c808033d66e1c5d6267 /sys/net/if_gre.c
parentef027c528caa653d24fa42d5378385c57efa02d4 (diff)
downloadsrc-29481f88465a042fa50479f6efcca2386c86b599.tar.gz
src-29481f88465a042fa50479f6efcca2386c86b599.zip
Replace really convoluted code that simplifies to "a ^= 0x01;"
Notes
Notes: svn path=/head/; revision=177416
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index bd208f1a97cd..b4b42b99cd3b 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -742,7 +742,6 @@ static int
gre_compute_route(struct gre_softc *sc)
{
struct route *ro;
- u_int32_t a, b, c;
ro = &sc->route;
@@ -755,16 +754,10 @@ gre_compute_route(struct gre_softc *sc)
* toggle last bit, so our interface is not found, but a less
* specific route. I'd rather like to specify a shorter mask,
* but this is not possible. Should work though. XXX
- * there is a simpler way ...
*/
if ((GRE2IFP(sc)->if_flags & IFF_LINK1) == 0) {
- a = ntohl(sc->g_dst.s_addr);
- b = a & 0x01;
- c = a & 0xfffffffe;
- b = b ^ 0x01;
- a = b | c;
- ((struct sockaddr_in *)&ro->ro_dst)->sin_addr.s_addr
- = htonl(a);
+ ((struct sockaddr_in *)&ro->ro_dst)->sin_addr.s_addr ^=
+ htonl(0x01);
}
#ifdef DIAGNOSTIC