Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/ldpd avoid reusing inet_addr twice.
details: https://anonhg.NetBSD.org/src/rev/d5f8a0832bc5
branches: trunk
changeset: 772224:d5f8a0832bc5
user: christos <christos%NetBSD.org@localhost>
date: Sat Dec 24 23:54:26 2011 +0000
description:
avoid reusing inet_addr twice.
diffstat:
usr.sbin/ldpd/ldp_command.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diffs (22 lines):
diff -r fed90379e5f9 -r d5f8a0832bc5 usr.sbin/ldpd/ldp_command.c
--- a/usr.sbin/ldpd/ldp_command.c Sat Dec 24 23:51:27 2011 +0000
+++ b/usr.sbin/ldpd/ldp_command.c Sat Dec 24 23:54:26 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ldp_command.c,v 1.6 2011/12/24 23:51:27 christos Exp $ */
+/* $NetBSD: ldp_command.c,v 1.7 2011/12/24 23:54:26 christos Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -486,9 +486,10 @@
if (p->state != LDP_PEER_ESTABLISHED)
continue;
SLIST_FOREACH(lm, &p->label_mapping_head, mappings) {
+ char lma[256];
+ strlcpy(lma, inet_ntoa(lm->address), sizeof(lma));
snprintf(sendspace, MAXSEND, "%s:%d\t%s/%d\n",
- inet_ntoa(p->ldp_id), lm->label,
- inet_ntoa(lm->address), lm->prefix);
+ inet_ntoa(p->ldp_id), lm->label, lma, lm->prefix);
writestr(s, sendspace);
}
}
Home |
Main Index |
Thread Index |
Old Index