]> git.proxmox.com Git - mirror_frr.git/blobdiff - ldpd/labelmapping.c
Merge pull request #3069 from donaldsharp/bgp_nexthop_address
[mirror_frr.git] / ldpd / labelmapping.c
index f53bc8333d7cbd81deb9a9919bff72b38926f4dd..944f93331f002a3fb1ef6c6ae3cfaa4a6b27171f 100644 (file)
@@ -130,6 +130,7 @@ send_labelmessage(struct nbr *nbr, uint16_t type, struct mapping_head *mh)
                }
 
                TAILQ_REMOVE(mh, me, entry);
+               assert(me != TAILQ_FIRST(mh));
                free(me);
        }
 
@@ -319,9 +320,9 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
                                /* do not accept invalid labels */
                                if (label > MPLS_LABEL_MAX ||
                                    (label <= MPLS_LABEL_RESERVED_MAX &&
-                                    label != MPLS_LABEL_IPV4NULL &&
-                                    label != MPLS_LABEL_IPV6NULL &&
-                                    label != MPLS_LABEL_IMPLNULL)) {
+                                    label != MPLS_LABEL_IPV4_EXPLICIT_NULL &&
+                                    label != MPLS_LABEL_IPV6_EXPLICIT_NULL &&
+                                    label != MPLS_LABEL_IMPLICIT_NULL)) {
                                        session_shutdown(nbr, S_BAD_TLV_VAL,
                                            msg.id, msg.type);
                                        goto err;
@@ -395,7 +396,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
                case MAP_TYPE_PREFIX:
                        switch (me->map.fec.prefix.af) {
                        case AF_INET:
-                               if (label == MPLS_LABEL_IPV6NULL) {
+                               if (label == MPLS_LABEL_IPV6_EXPLICIT_NULL) {
                                        session_shutdown(nbr, S_BAD_TLV_VAL,
                                            msg.id, msg.type);
                                        goto err;
@@ -404,7 +405,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
                                        goto next;
                                break;
                        case AF_INET6:
-                               if (label == MPLS_LABEL_IPV4NULL) {
+                               if (label == MPLS_LABEL_IPV4_EXPLICIT_NULL) {
                                        session_shutdown(nbr, S_BAD_TLV_VAL,
                                            msg.id, msg.type);
                                        goto err;
@@ -459,6 +460,7 @@ recv_labelmessage(struct nbr *nbr, char *buf, uint16_t len, uint16_t type)
 
  next:
                TAILQ_REMOVE(&mh, me, entry);
+               assert(me != TAILQ_FIRST(&mh));
                free(me);
        }