]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Merge commit 'v2.14-95-g6d453c16' into thread-next
authorMaria Matejka <mq@ucw.cz>
Sun, 28 Jan 2024 14:04:45 +0000 (15:04 +0100)
committerMaria Matejka <mq@ucw.cz>
Sun, 28 Jan 2024 14:04:45 +0000 (15:04 +0100)
1  2 
doc/bird.sgml
proto/bgp/bgp.c
proto/bgp/bgp.h
proto/bgp/config.Y
proto/bgp/packets.c

diff --cc doc/bird.sgml
Simple merge
diff --cc proto/bgp/bgp.c
index 9de97181afea788180f334e74cbf40c4c50f167c,9d4671afc4fe7950743a67dfa09a58d6137537a8..49078520b6c9c08d8a729d7deeb5cb62550fd5e8
@@@ -473,11 -375,11 +473,12 @@@ bgp_close_conn(struct bgp_conn *conn
    conn->keepalive_timer = NULL;
    rfree(conn->hold_timer);
    conn->hold_timer = NULL;
+   rfree(conn->send_hold_timer);
+   conn->send_hold_timer = NULL;
    rfree(conn->tx_ev);
    conn->tx_ev = NULL;
 -  rfree(conn->sk);
 +
 +  sk_close(conn->sk);
    conn->sk = NULL;
  
    mb_free(conn->local_open_msg);
@@@ -2829,10 -2650,9 +2859,12 @@@ bgp_show_proto_info(struct proto *P
            tm_remains(p->conn->hold_timer), p->conn->hold_time);
      cli_msg(-1006, "    Keepalive timer:  %t/%u",
            tm_remains(p->conn->keepalive_timer), p->conn->keepalive_time);
-   }
 +    cli_msg(-1006, "    TX pending:       %d bytes%s",
 +          p->conn->sk->tpos - p->conn->sk->ttx,
 +          ev_active(p->conn->tx_ev) ? " (refill scheduled)" : "");
+     cli_msg(-1006, "    Send hold timer:  %t/%u",
+           tm_remains(p->conn->send_hold_timer), p->conn->send_hold_time);
+ }
  
  #if 0
    struct bgp_stats *s = &p->stats;
diff --cc proto/bgp/bgp.h
index 269ce986e260db39580b0314b0b63c35fc6a41b6,7127bc88a38aad31d9bee4e68d57733a4bb8d3d5..a6a79801a0bc49ec7e44b62a66751b2aa1ff0991
@@@ -313,19 -318,9 +316,19 @@@ struct bgp_conn 
    int notify_code, notify_subcode, notify_size;
    byte *notify_data;
  
-   uint hold_time, keepalive_time;     /* Times calculated from my and neighbor's requirements */
+   uint hold_time, keepalive_time, send_hold_time;     /* Times calculated from my and neighbor's requirements */
  };
  
 +struct bgp_listen_request {
 +  node n;                             /* Node in bgp_socket / pending list */
 +  struct bgp_socket *sock;            /* Assigned socket */
 +  ip_addr addr;
 +  struct iface *iface;
 +  struct iface *vrf;
 +  uint port;
 +  uint flags;
 +};
 +
  struct bgp_proto {
    struct proto p;
    const struct bgp_config *cf;                /* Shortcut to BGP configuration */
index 2358c318ccccdfc77a9f76e0bf37e786c68a6420,1173ff060079c2c2ebd338d11634c5a36b5b4719..2ee26919cb54a950952168ff983431f64a3f481d
@@@ -29,9 -30,9 +29,9 @@@ CF_KEYWORDS(BGP, LOCAL, NEIGHBOR, AS, H
        GRACEFUL, RESTART, AWARE, CHECK, LINK, PORT, EXTENDED, MESSAGES, SETKEY,
        STRICT, BIND, CONFEDERATION, MEMBER, MULTICAST, FLOW4, FLOW6, LONG,
        LIVED, STALE, IMPORT, IBGP, EBGP, MANDATORY, INTERNAL, EXTERNAL, SETS,
 -      DYNAMIC, RANGE, NAME, DIGITS, BGP_AIGP, AIGP, ORIGINATE, COST, ENFORCE,
 +      DYNAMIC, RANGE, NAME, DIGITS, AIGP, ORIGINATE, COST, ENFORCE,
        FIRST, FREE, VALIDATE, BASE, ROLE, ROLES, PEER, PROVIDER, CUSTOMER,
-       RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL)
+       RS_SERVER, RS_CLIENT, REQUIRE, BGP_OTC, GLOBAL, SEND)
  
  %type <i> bgp_nh
  %type <i32> bgp_afi
index 35ca2dfb863665c4538342598aae1b6d992b1f5b,e8cc4718730f31211ecad1c272109a7b0c008264..180c0b7302221561e83991bf9272f65025992bc0
@@@ -1044,7 -1047,8 +1049,8 @@@ bgp_rx_open(struct bgp_conn *conn, byt
        conn->hold_time, conn->keepalive_time, p->remote_as, p->remote_id, conn->as4_session);
  
    bgp_schedule_packet(conn, NULL, PKT_KEEPALIVE);
 -  bgp_start_timer(conn->hold_timer, conn->hold_time);
 -  bgp_start_timer(conn->send_hold_timer, conn->send_hold_time);
 +  bgp_start_timer(p, conn->hold_timer, conn->hold_time);
++  bgp_start_timer(p, conn->send_hold_timer, conn->send_hold_time);
    bgp_conn_enter_openconfirm_state(conn);
  }
  
@@@ -3035,7 -3066,11 +3041,11 @@@ bgp_send(struct bgp_conn *conn, uint ty
    put_u16(buf+16, len);
    buf[18] = type;
  
-   return sk_send(sk, len);
+   int success = sk_send(sk, len);
+   if (success && ((conn->state == BS_ESTABLISHED) || (conn->state == BS_OPENCONFIRM)))
 -    bgp_start_timer(conn->send_hold_timer, conn->send_hold_time);
++    bgp_start_timer(conn->bgp, conn->send_hold_timer, conn->send_hold_time);
+   return success;
  }
  
  /**
@@@ -3199,7 -3230,10 +3209,12 @@@ bgp_tx(sock *sk
  {
    struct bgp_conn *conn = sk->data;
  
 -    bgp_start_timer(conn->send_hold_timer, conn->send_hold_time);
 +  ASSERT_DIE(birdloop_inside(conn->bgp->p.loop));
++
+   /* Pending message was passed to kernel */
+   if ((conn->state == BS_ESTABLISHED) || (conn->state == BS_OPENCONFIRM))
++    bgp_start_timer(conn->bgp, conn->send_hold_timer, conn->send_hold_time);
    DBG("BGP: TX hook\n");
    uint max = 1024;
    while (--max && (bgp_fire_tx(conn) > 0))