From b8355c826019780b22f359df5cec0e420abea569 Mon Sep 17 00:00:00 2001 From: julian Date: Wed, 19 Mar 2008 22:29:11 +0000 Subject: Replace really convoluted code that simplifies to "a ^= 0x01;" --- sys/net/if_gre.c | 11 ++--------- 1 file 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 -- cgit v1.1