]> git.proxmox.com Git - mirror_frr.git/blobdiff - bgpd/bgp_attr.c
Merge pull request #12795 from pguibert6WIND/vpnv6_nexthop_encoding
[mirror_frr.git] / bgpd / bgp_attr.c
index 19c65ce4d28a710f259f47b83b6a559c898da5f6..fcfb1d64e0fd954bfe19200e06773474b56c8be8 100644 (file)
@@ -3976,23 +3976,21 @@ size_t bgp_packet_mpattr_start(struct stream *s, struct peer *peer, afi_t afi,
                        }
                } break;
                case SAFI_MPLS_VPN: {
+                       if (attr->mp_nexthop_len ==
+                           BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL)
+                               stream_putc(s, attr->mp_nexthop_len);
+                       else
+                               stream_putc(s, BGP_ATTR_NHLEN_VPNV6_GLOBAL);
+                       stream_putl(s, 0); /* RD = 0, per RFC */
+                       stream_putl(s, 0);
+                       stream_put(s, &attr->mp_nexthop_global,
+                                  IPV6_MAX_BYTELEN);
                        if (attr->mp_nexthop_len ==
                            BGP_ATTR_NHLEN_VPNV6_GLOBAL_AND_LL) {
-                               stream_putc(s, 48);
-                               stream_putl(s, 0); /* RD = 0, per RFC */
-                               stream_putl(s, 0);
-                               stream_put(s, &attr->mp_nexthop_global,
-                                          IPV6_MAX_BYTELEN);
                                stream_putl(s, 0); /* RD = 0, per RFC */
                                stream_putl(s, 0);
                                stream_put(s, &attr->mp_nexthop_local,
                                           IPV6_MAX_BYTELEN);
-                       } else {
-                               stream_putc(s, 24);
-                               stream_putl(s, 0); /* RD = 0, per RFC */
-                               stream_putl(s, 0);
-                               stream_put(s, &attr->mp_nexthop_global,
-                                          IPV6_MAX_BYTELEN);
                        }
                } break;
                case SAFI_ENCAP: