(forwarded from misc@) Hi, while reading the changes in OpenBSD source code (hopefully to learn more), I've notice the usage of Uninitialized variable. Looks like the latest commit unintentionally removed the assignment line (sorry for the github link):


The following should bring back (the possibly) unwanted change.s Hope it helps unless I missed something

diff --git a/sys/netmpls/mpls_input.c b/sys/netmpls/mpls_input.c
index 34fe7314d..fff3564c8 100644
--- a/sys/netmpls/mpls_input.c
+++ b/sys/netmpls/mpls_input.c
@@ -76,13 +76,15 @@ mpls_input(struct ifnet *ifp, struct mbuf *m)

        shim = mtod(m, struct shim_hdr *);
 #ifdef MPLS_DEBUG
        printf("mpls_input: iface %s label=%d, ttl=%d BoS %d\n",
-           ifp->if_xname, MPLS_LABEL_GET(shim->shim_label), ttls, hasbos);
+           ifp->if_xname, MPLS_LABEL_GET(shim->shim_label),
+           MPLS_LABEL_GET(shim->shim_label),
+           MPLS_BOS_ISSET(shim->shim_label));

        /* check and decrement TTL */
+       ttl = MPLS_LABEL_GET(shim->shim_label);
        if (--ttl == 0) {
                /* TTL exceeded */
m = mpls_do_error(m, ICMP_TIMXCEED, ICMP_TIMXCEED_INTRANS, 0);

Reply via email to