diff -Nru mahimahi-0.98/debian/changelog mahimahi-0.98/debian/changelog
--- mahimahi-0.98/debian/changelog	2020-03-09 01:06:44.000000000 +0800
+++ mahimahi-0.98/debian/changelog	2024-06-04 16:30:41.000000000 +0800
@@ -1,3 +1,10 @@
+mahimahi (0.98-1.2) UNRELEASED; urgency=medium
+
+  * Fix ftbfs with gcc-11.
+  * Include missing lib. 
+
+ -- Gui-Yue <yuemeng.gui@gmail.com>  Tue, 04 Jun 2024 16:30:41 +0800
+
 mahimahi (0.98-1.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -Nru mahimahi-0.98/debian/patches/fix_gcc_failed.patch mahimahi-0.98/debian/patches/fix_gcc_failed.patch
--- mahimahi-0.98/debian/patches/fix_gcc_failed.patch	1970-01-01 08:00:00.000000000 +0800
+++ mahimahi-0.98/debian/patches/fix_gcc_failed.patch	2024-06-04 16:30:41.000000000 +0800
@@ -0,0 +1,159 @@
+--- a/src/packet/queued_packet.hh
++++ b/src/packet/queued_packet.hh
+@@ -4,6 +4,7 @@
+ #define QUEUED_PACKET_HH
+ 
+ #include <string>
++#include <cstdint>
+ 
+ struct QueuedPacket
+ {
+--- a/src/packet/codel_packet_queue.cc
++++ b/src/packet/codel_packet_queue.cc
+@@ -62,7 +62,7 @@
+ QueuedPacket CODELPacketQueue::dequeue( void )
+ {   
+   const uint64_t now = timestamp();
+-  dodequeue_result r = std::move( dodequeue ( now ) );
++  dodequeue_result r = dodequeue(now);
+   uint32_t delta;
+     
+   if ( dropping_ ) {
+@@ -71,7 +71,7 @@
+     }
+ 
+     while ( now >= drop_next_ && dropping_ ) {
+-      dodequeue_result r = std::move( dodequeue ( now ) );
++      dodequeue_result r = dodequeue(now);;
+       count_++;
+       if ( ! r.ok_to_drop ) {
+ 	dropping_ = false;
+@@ -81,7 +81,7 @@
+     }
+   }
+   else if ( r.ok_to_drop ) {
+-    dodequeue_result r = std::move( dodequeue ( now ) );
++    dodequeue_result r = dodequeue(now);;
+     dropping_ = true;
+     delta = count_ - lastcount_;
+     count_ = ( ( delta > 1 ) && ( now - drop_next_ < 16 * interval_ ))? 
+--- a/src/packet/pie_packet_queue.cc
++++ b/src/packet/pie_packet_queue.cc
+@@ -78,7 +78,7 @@
+ 
+ QueuedPacket PIEPacketQueue::dequeue( void )
+ {
+-  QueuedPacket ret = std::move( DroppingPacketQueue::dequeue () );
++  QueuedPacket ret = DroppingPacketQueue::dequeue();
+   uint32_t now = timestamp();
+ 
+   if ( size_bytes() >= dq_threshold_ && dq_count_ == DQ_COUNT_INVALID ) {
+--- a/src/graphing/graph.hh
++++ b/src/graphing/graph.hh
+@@ -4,6 +4,7 @@
+ #include <deque>
+ #include <vector>
+ #include <mutex>
++#include <array>
+ 
+ #include "display.hh"
+ #include "cairo_objects.hh"
+--- a/src/http/chunked_parser.hh
++++ b/src/http/chunked_parser.hh
+@@ -3,6 +3,8 @@
+ #ifndef CHUNKED_BODY_PARSER_HH
+ #define CHUNKED_BODY_PARSER_HH
+ 
++#include <cstdint>
++
+ #include "body_parser.hh"
+ #include "exception.hh"
+ 
+--- a/src/http/http_message.cc
++++ b/src/http/http_message.cc
+@@ -195,7 +195,7 @@
+       body_( proto.body() ),
+       state_( COMPLETE )
+ {
+-    for ( const auto header : proto.header() ) {
++    for ( const auto& header : proto.header() ) {
+         headers_.emplace_back( header );
+     }
+ }
+--- a/src/httpserver/secure_socket.cc
++++ b/src/httpserver/secure_socket.cc
+@@ -84,6 +84,17 @@
+     return ret;
+ }
+ 
++// Helper function to load a private key from ASN.1 format
++EVP_PKEY* load_private_key_from_ASN1(const unsigned char* private_key, int length) {
++    const unsigned char* p = private_key;
++    EVP_PKEY* pkey = d2i_PrivateKey(EVP_PKEY_RSA, nullptr, &p, length);
++    if (!pkey) {
++        throw std::runtime_error("Failed to load private key from ASN.1 format");
++    }
++    return pkey;
++}
++
++
+ SSLContext::SSLContext( const SSL_MODE type )
+     : ctx_( initialize_new_context( type ) )
+ {
+@@ -92,10 +103,19 @@
+             throw ssl_error( "SSL_CTX_use_certificate_ASN1" );
+         }
+ 
+-        if ( not SSL_CTX_use_RSAPrivateKey_ASN1( ctx_.get(), private_key, 1191 ) ) {
+-            throw ssl_error( "SSL_CTX_use_RSAPrivateKey_ASN1" );
++        EVP_PKEY* pkey = load_private_key_from_ASN1(private_key, 1191);
++        if (!pkey) {
++            throw ssl_error( "Failed to load private key" );
+         }
+ 
++        if ( not SSL_CTX_use_PrivateKey( ctx_.get(), pkey ) ) {
++            EVP_PKEY_free(pkey); // Free the EVP_PKEY object
++            throw ssl_error( "SSL_CTX_use_PrivateKey" );
++        }
++
++        // Free the EVP_PKEY object after using it
++        EVP_PKEY_free(pkey);
++
+         /* check consistency of private key with loaded certificate */
+         if ( not SSL_CTX_check_private_key( ctx_.get() ) ) {
+             throw ssl_error( "SSL_CTX_check_private_key" );
+--- a/src/frontend/replayshell.cc
++++ b/src/frontend/replayshell.cc
+@@ -95,7 +95,7 @@
+ 
+             const vector< string > files = list_directory_contents( directory  );
+ 
+-            for ( const auto filename : files ) {
++            for ( const auto& filename : files ) {
+                 FileDescriptor fd( SystemCall( "open", open( filename.c_str(), O_RDONLY ) ) );
+ 
+                 MahimahiProtobufs::RequestResponse protobuf;
+@@ -115,20 +115,20 @@
+ 
+         /* set up dummy interfaces */
+         unsigned int interface_counter = 0;
+-        for ( const auto ip : unique_ip ) {
++        for ( const auto& ip : unique_ip ) {
+             add_dummy_interface( "sharded" + to_string( interface_counter ), ip );
+             interface_counter++;
+         }
+ 
+         /* set up web servers */
+         vector< WebServer > servers;
+-        for ( const auto ip_port : unique_ip_and_port ) {
++        for ( const auto& ip_port : unique_ip_and_port ) {
+             servers.emplace_back( ip_port, working_directory, directory );
+         }
+ 
+         /* set up DNS server */
+         TempFile dnsmasq_hosts( "/tmp/replayshell_hosts" );
+-        for ( const auto mapping : hostname_to_ip ) {
++        for ( const auto& mapping : hostname_to_ip ) {
+             dnsmasq_hosts.write( mapping.second.ip() + " " + mapping.first + "\n" );
+         }
+ 
diff -Nru mahimahi-0.98/debian/patches/series mahimahi-0.98/debian/patches/series
--- mahimahi-0.98/debian/patches/series	2020-03-09 01:06:44.000000000 +0800
+++ mahimahi-0.98/debian/patches/series	2024-06-04 16:30:41.000000000 +0800
@@ -1 +1,2 @@
 fix_gcc9.patch
+fix_gcc_failed.patch
