Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ldpd use predefined group consts/macros instead of ...
details: https://anonhg.NetBSD.org/src/rev/aa4d351510ea
branches: trunk
changeset: 784363:aa4d351510ea
user: kefren <kefren%NetBSD.org@localhost>
date: Sat Jan 26 19:44:52 2013 +0000
description:
use predefined group consts/macros instead of ptoning strings
diffstat:
usr.sbin/ldpd/ldp.h | 6 +-----
usr.sbin/ldpd/socketops.c | 11 +++++------
2 files changed, 6 insertions(+), 11 deletions(-)
diffs (66 lines):
diff -r 09e66b806c41 -r aa4d351510ea usr.sbin/ldpd/ldp.h
--- a/usr.sbin/ldpd/ldp.h Sat Jan 26 19:38:17 2013 +0000
+++ b/usr.sbin/ldpd/ldp.h Sat Jan 26 19:44:52 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ldp.h,v 1.5 2013/01/26 17:29:55 kefren Exp $ */
+/* $NetBSD: ldp.h,v 1.6 2013/01/26 19:44:52 kefren Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -36,10 +36,6 @@
#include <netinet/in.h>
/* RFC5036 */
-#define ALL_ROUTERS "224.0.0.2"
-/* draft-ietf-mpls-ldp-ipv6 */
-#define ALL_ROUTERS6 "FF02::2"
-/* RFC5036 */
#define LDP_PORT 646
#define LDP_COMMAND_PORT 2626
diff -r 09e66b806c41 -r aa4d351510ea usr.sbin/ldpd/socketops.c
--- a/usr.sbin/ldpd/socketops.c Sat Jan 26 19:38:17 2013 +0000
+++ b/usr.sbin/ldpd/socketops.c Sat Jan 26 19:44:52 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: socketops.c,v 1.18 2013/01/26 17:46:50 kefren Exp $ */
+/* $NetBSD: socketops.c,v 1.19 2013/01/26 19:44:52 kefren Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -107,7 +107,7 @@
* RFC5036 specifies we should listen to all subnet routers multicast
* group
*/
- assert(inet_pton(AF_INET, ALL_ROUTERS, &mcast_addr.imr_multiaddr) == 1);
+ mcast_addr.imr_multiaddr.s_addr = htonl(INADDR_ALLRTRS_GROUP);
if (socket_reuse_port(s) < 0)
goto chs_error;
@@ -206,8 +206,7 @@
}
lastifindex = UINT_MAX;
- assert(inet_pton(AF_INET6, ALL_ROUTERS6,
- &mcast_addr6.ipv6mr_multiaddr) == 1);
+ mcast_addr6.ipv6mr_multiaddr = in6addr_linklocal_allrouters;
for (ifb = ifa; ifb; ifb = ifb->ifa_next) {
if_sa6 = (struct sockaddr_in6 *) ifb->ifa_addr;
if (if_sa6->sin6_family != AF_INET6 ||
@@ -452,7 +451,7 @@
sadest.sin_len = sizeof(sadest);
sadest.sin_family = AF_INET;
sadest.sin_port = htons(LDP_PORT);
- inet_aton(ALL_ROUTERS, &sadest.sin_addr);
+ sadest.sin_addr.s_addr = htonl(INADDR_ALLRTRS_GROUP);
/* Find our socket */
SLIST_FOREACH(hs, &hello_socket_head, listentry)
@@ -516,7 +515,7 @@
sadest6.sin6_len = sizeof(sadest6);
sadest6.sin6_family = AF_INET6;
sadest6.sin6_port = htons(LDP_PORT);
- assert(inet_pton(AF_INET6, ALL_ROUTERS6, &sadest6.sin6_addr) == 1);
+ sadest6.sin6_addr = in6addr_linklocal_allrouters;
SLIST_FOREACH(hs, &hello_socket_head, listentry)
if (hs->type == AF_INET6) {
Home |
Main Index |
Thread Index |
Old Index