Module Name: src
Committed By: christos
Date: Sat Dec 24 23:54:26 UTC 2011
Modified Files:
src/usr.sbin/ldpd: ldp_command.c
Log Message:
avoid reusing inet_addr twice.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/ldpd/ldp_command.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.sbin/ldpd/ldp_command.c
diff -u src/usr.sbin/ldpd/ldp_command.c:1.6 src/usr.sbin/ldpd/ldp_command.c:1.7
--- src/usr.sbin/ldpd/ldp_command.c:1.6 Sat Dec 24 18:51:27 2011
+++ src/usr.sbin/ldpd/ldp_command.c Sat Dec 24 18:54:26 2011
@@ -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 @@ show_labels(int s, char *recvspace)
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);
}
}