summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>2008-03-19 22:29:11 +0000
committerjulian <julian@FreeBSD.org>2008-03-19 22:29:11 +0000
commitb8355c826019780b22f359df5cec0e420abea569 (patch)
treec61c0309dcbb8bc88f933c808033d66e1c5d6267
parent2deefa8109b4934daaf6fcbe89be2c7971724803 (diff)
downloadFreeBSD-src-b8355c826019780b22f359df5cec0e420abea569.zip
FreeBSD-src-b8355c826019780b22f359df5cec0e420abea569.tar.gz
Replace really convoluted code that simplifies to "a ^= 0x01;"
-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 bd208f1..b4b42b9 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
OpenPOWER on IntegriCloud