summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2006-01-12 15:00:49 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2006-01-12 15:00:49 +0000
commit9d8e9330a35dbb4f9da9024018086d07a642d0fe (patch)
treeeef0111471ddfe25cf2287adfe10a4166e3c02cc /usr.sbin/ospfd
parent7e4ace8969d52489b0b314ee9ce5d7fc751b411a (diff)
Change inet_addr("127.0.0.1") into htonl(INADDR_LOOPBACK) and similar.
OK norby@
Diffstat (limited to 'usr.sbin/ospfd')
-rw-r--r--usr.sbin/ospfd/kroute.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/ospfd/kroute.c b/usr.sbin/ospfd/kroute.c
index 1b1b9e29aee..ee85583ae32 100644
--- a/usr.sbin/ospfd/kroute.c
+++ b/usr.sbin/ospfd/kroute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kroute.c,v 1.22 2006/01/05 15:53:36 claudio Exp $ */
+/* $OpenBSD: kroute.c,v 1.23 2006/01/12 15:00:48 claudio Exp $ */
/*
* Copyright (c) 2004 Esben Norby <norby@openbsd.org>
@@ -172,8 +172,8 @@ kr_change(struct kroute *kroute)
}
/* nexthop within 127/8 -> ignore silently */
- if ((kroute->nexthop.s_addr & htonl(0xff000000)) ==
- inet_addr("127.0.0.0"))
+ if ((kroute->nexthop.s_addr & htonl(IN_CLASSA_NET)) ==
+ htonl(INADDR_LOOPBACK & IN_CLASSA_NET))
return (0);
if (send_rtmsg(kr_state.fd, action, kroute) == -1)
@@ -210,8 +210,8 @@ kr_delete(struct kroute *kroute)
return (0);
/* nexthop within 127/8 -> ignore silently */
- if ((kroute->nexthop.s_addr & htonl(0xff000000)) ==
- inet_addr("127.0.0.0"))
+ if ((kroute->nexthop.s_addr & htonl(IN_CLASSA_NET)) ==
+ htonl(INADDR_LOOPBACK & IN_CLASSA_NET))
return (0);
if (send_rtmsg(kr_state.fd, RTM_DELETE, kroute) == -1)
@@ -539,7 +539,7 @@ protect_lo(void)
log_warn("protect_lo");
return (-1);
}
- kr->r.prefix.s_addr = inet_addr("127.0.0.1");
+ kr->r.prefix.s_addr = htonl(INADDR_LOOPBACK);
kr->r.prefixlen = 8;
kr->r.flags = F_KERNEL|F_CONNECTED;