diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2017-08-01 11:50:34 +0200 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2017-08-03 04:21:00 +0200 |
commit | 3c8c639c2a8863260b171c1a99b7a7286030b42c (patch) | |
tree | 2965cca47906a5b32bcd32e1558e4e48c2e455bd /tcpip/rip98r.c | |
parent | 875cc7a37dc6b3fb9d29473d6c70f23160887ee9 (diff) |
rip98d: Replace naive mask2bits and bits2mask implementations.
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'tcpip/rip98r.c')
-rw-r--r-- | tcpip/rip98r.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tcpip/rip98r.c b/tcpip/rip98r.c index 57afe4e..8332944 100644 --- a/tcpip/rip98r.c +++ b/tcpip/rip98r.c @@ -26,8 +26,8 @@ static int cmp_route(struct route_struct *route, struct in_addr addr, int bits, unsigned long int old_mask, new_mask; unsigned long int old_addr, new_addr; - old_mask = ntohl(bits2mask(route->bits)); - new_mask = ntohl(bits2mask(bits)); + old_mask = bits2mask(route->bits); + new_mask = bits2mask(bits); old_addr = route->addr.s_addr; new_addr = addr.s_addr; @@ -234,7 +234,7 @@ void receive_routes(int s) if (route->bits == 32) { rt.rt_flags |= RTF_HOST; } else { - netmask = bits2mask(route->bits); + netmask = htonl(bits2mask(route->bits)); trg.sin_family = AF_INET; memcpy((char *)&trg.sin_addr, (char *)&netmask, sizeof(struct in_addr)); |