Module Name: src
Committed By: kefren
Date: Mon Feb 14 11:43:59 UTC 2011
Modified Files:
src/usr.sbin/ldpd: mpls_routes.c
Log Message:
get rid of unused variable/assignments
To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/usr.sbin/ldpd/mpls_routes.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/mpls_routes.c
diff -u src/usr.sbin/ldpd/mpls_routes.c:1.4 src/usr.sbin/ldpd/mpls_routes.c:1.5
--- src/usr.sbin/ldpd/mpls_routes.c:1.4 Wed Feb 9 11:38:57 2011
+++ src/usr.sbin/ldpd/mpls_routes.c Mon Feb 14 11:43:59 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: mpls_routes.c,v 1.4 2011/02/09 11:38:57 kefren Exp $ */
+/* $NetBSD: mpls_routes.c,v 1.5 2011/02/14 11:43:59 kefren Exp $ */
/*-
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -635,25 +635,23 @@
*/
/* First of all check if we already know this one */
- lab = label_get(so_dest, so_pref);
- if (!lab) {
+ if (label_get(so_dest, so_pref) == NULL) {
if (!(rg->m_rtm.rtm_flags & RTF_GATEWAY))
- lab = label_add(so_dest, so_pref, NULL,
+ label_add(so_dest, so_pref, NULL,
MPLS_LABEL_IMPLNULL, NULL, 0);
else {
pm = ldp_test_mapping(&so_dest->sin.sin_addr,
prefixlen, &so_gate->sin.sin_addr);
if (pm) {
- lab = label_add(so_dest, so_pref,
+ label_add(so_dest, so_pref,
so_gate, 0, NULL, 0);
mpls_add_label(pm->peer, rg,
&so_dest->sin.sin_addr, prefixlen,
pm->lm->label, ROUTE_LOOKUP_LOOP);
free(pm);
} else
- lab = label_add(so_dest, so_pref,
- so_gate, MPLS_LABEL_IMPLNULL,
- NULL, 0);
+ label_add(so_dest, so_pref, so_gate,
+ MPLS_LABEL_IMPLNULL, NULL, 0);
}
} else /* We already know about this prefix */
debugp("Binding already there for prefix %s/%d !\n",
@@ -728,7 +726,6 @@
char *buf, *next, *lim;
struct rt_msghdr *rtmes;
union sockunion *so_dst, *so_pref, *so_gate;
- struct label *lab;
mib[0] = CTL_NET;
mib[1] = PF_ROUTE;
@@ -812,7 +809,7 @@
continue;
}
if (so_gate->sa.sa_family == AF_INET)
- lab = label_add(so_dst, so_pref, so_gate,
+ label_add(so_dst, so_pref, so_gate,
MPLS_LABEL_IMPLNULL, NULL, 0);
if (rtmes->rtm_flags & RTF_HOST)