(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):

https://github.com/openbsd/src/commit/5c53b9324545b7febab2dcf52402199d72b231d3?diff=split#diff-3efc580dfa272b2173162f5950c92484R86


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));
 #endif

        /* 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