Diff for /embedaddon/quagga/bgpd/bgp_packet.c between versions 1.1.1.2 and 1.1.1.4

version 1.1.1.2, 2012/05/29 11:53:41 version 1.1.1.4, 2013/07/21 23:54:37
Line 149  bgp_update_packet (struct peer *peer, afi_t afi, safi_ Line 149  bgp_update_packet (struct peer *peer, afi_t afi, safi_
   struct bgp_info *binfo = NULL;    struct bgp_info *binfo = NULL;
   bgp_size_t total_attr_len = 0;    bgp_size_t total_attr_len = 0;
   unsigned long pos;    unsigned long pos;
   char buf[BUFSIZ];  
   
   s = peer->work;    s = peer->work;
   stream_reset (s);    stream_reset (s);
Line 199  bgp_update_packet (struct peer *peer, afi_t afi, safi_ Line 198  bgp_update_packet (struct peer *peer, afi_t afi, safi_
         stream_put_prefix (s, &rn->p);          stream_put_prefix (s, &rn->p);
               
       if (BGP_DEBUG (update, UPDATE_OUT))        if (BGP_DEBUG (update, UPDATE_OUT))
        zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d",        {
              peer->host,          char buf[INET6_BUFSIZ];
              inet_ntop (rn->p.family, &(rn->p.u.prefix), buf, BUFSIZ), 
              rn->p.prefixlen); 
   
             zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d",
                   peer->host,
                   inet_ntop (rn->p.family, &(rn->p.u.prefix), buf, INET6_BUFSIZ),
                   rn->p.prefixlen);
           }
   
       /* Synchnorize attribute.  */        /* Synchnorize attribute.  */
       if (adj->attr)        if (adj->attr)
         bgp_attr_unintern (&adj->attr);          bgp_attr_unintern (&adj->attr);
Line 285  bgp_withdraw_packet (struct peer *peer, afi_t afi, saf Line 288  bgp_withdraw_packet (struct peer *peer, afi_t afi, saf
   unsigned long pos;    unsigned long pos;
   bgp_size_t unfeasible_len;    bgp_size_t unfeasible_len;
   bgp_size_t total_attr_len;    bgp_size_t total_attr_len;
   char buf[BUFSIZ];  
   
   s = peer->work;    s = peer->work;
   stream_reset (s);    stream_reset (s);
Line 324  bgp_withdraw_packet (struct peer *peer, afi_t afi, saf Line 326  bgp_withdraw_packet (struct peer *peer, afi_t afi, saf
         }          }
   
       if (BGP_DEBUG (update, UPDATE_OUT))        if (BGP_DEBUG (update, UPDATE_OUT))
        zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d -- unreachable",        {
              peer->host,          char buf[INET6_BUFSIZ];
              inet_ntop (rn->p.family, &(rn->p.u.prefix), buf, BUFSIZ), 
              rn->p.prefixlen); 
   
             zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d -- unreachable",
                   peer->host,
                   inet_ntop (rn->p.family, &(rn->p.u.prefix), buf, INET6_BUFSIZ),
                   rn->p.prefixlen);
           }
   
       peer->scount[afi][safi]--;        peer->scount[afi][safi]--;
   
       bgp_adj_out_remove (rn, adj, peer, afi, safi);        bgp_adj_out_remove (rn, adj, peer, afi, safi);
Line 366  bgp_default_update_send (struct peer *peer, struct att Line 372  bgp_default_update_send (struct peer *peer, struct att
   struct prefix p;    struct prefix p;
   unsigned long pos;    unsigned long pos;
   bgp_size_t total_attr_len;    bgp_size_t total_attr_len;
   char attrstr[BUFSIZ];  
   char buf[BUFSIZ];  
   
   if (DISABLE_BGP_ANNOUNCE)    if (DISABLE_BGP_ANNOUNCE)
     return;      return;
Line 382  bgp_default_update_send (struct peer *peer, struct att Line 386  bgp_default_update_send (struct peer *peer, struct att
   /* Logging the attribute. */    /* Logging the attribute. */
   if (BGP_DEBUG (update, UPDATE_OUT))    if (BGP_DEBUG (update, UPDATE_OUT))
     {      {
         char attrstr[BUFSIZ];
         char buf[INET6_BUFSIZ];
         attrstr[0] = '\0';
   
       bgp_dump_attr (peer, attr, attrstr, BUFSIZ);        bgp_dump_attr (peer, attr, attrstr, BUFSIZ);
       zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d %s",        zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d %s",
            peer->host, inet_ntop(p.family, &(p.u.prefix), buf, BUFSIZ),            peer->host, inet_ntop(p.family, &(p.u.prefix), buf, INET6_BUFSIZ),
             p.prefixlen, attrstr);              p.prefixlen, attrstr);
     }      }
   
Line 435  bgp_default_withdraw_send (struct peer *peer, afi_t af Line 443  bgp_default_withdraw_send (struct peer *peer, afi_t af
   unsigned long cp;    unsigned long cp;
   bgp_size_t unfeasible_len;    bgp_size_t unfeasible_len;
   bgp_size_t total_attr_len;    bgp_size_t total_attr_len;
   char buf[BUFSIZ];  
   
   if (DISABLE_BGP_ANNOUNCE)    if (DISABLE_BGP_ANNOUNCE)
     return;      return;
Line 451  bgp_default_withdraw_send (struct peer *peer, afi_t af Line 458  bgp_default_withdraw_send (struct peer *peer, afi_t af
   pos = 0;    pos = 0;
   
   if (BGP_DEBUG (update, UPDATE_OUT))    if (BGP_DEBUG (update, UPDATE_OUT))
    zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d -- unreachable",    {
          peer->host, inet_ntop(p.family, &(p.u.prefix), buf, BUFSIZ),      char buf[INET6_BUFSIZ];
          p.prefixlen); 
   
         zlog (peer->log, LOG_DEBUG, "%s send UPDATE %s/%d -- unreachable",
               peer->host, inet_ntop(p.family, &(p.u.prefix), buf, INET6_BUFSIZ),
               p.prefixlen);
       }
   
   s = stream_new (BGP_MAX_PACKET_SIZE);    s = stream_new (BGP_MAX_PACKET_SIZE);
   
   /* Make BGP update packet. */    /* Make BGP update packet. */
Line 666  bgp_write (struct thread *thread) Line 677  bgp_write (struct thread *thread)
   
           /* Flush any existing events */            /* Flush any existing events */
           BGP_EVENT_ADD (peer, BGP_Stop);            BGP_EVENT_ADD (peer, BGP_Stop);
          return 0;          goto done;
 
         case BGP_MSG_KEEPALIVE:          case BGP_MSG_KEEPALIVE:
           peer->keepalive_out++;            peer->keepalive_out++;
           break;            break;
Line 687  bgp_write (struct thread *thread) Line 699  bgp_write (struct thread *thread)
       
   if (bgp_write_proceed (peer))    if (bgp_write_proceed (peer))
     BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);      BGP_WRITE_ON (peer->t_write, bgp_write, peer->fd);
  else
    sockopt_cork (peer->fd, 0); done:
    sockopt_cork (peer->fd, 0);
   return 0;    return 0;
 }  }
   
Line 711  bgp_write_notify (struct peer *peer) Line 723  bgp_write_notify (struct peer *peer)
   val = fcntl (peer->fd, F_GETFL, 0);    val = fcntl (peer->fd, F_GETFL, 0);
   fcntl (peer->fd, F_SETFL, val & ~O_NONBLOCK);    fcntl (peer->fd, F_SETFL, val & ~O_NONBLOCK);
   
  ret = writen (peer->fd, STREAM_DATA (s), stream_get_endp (s));  /* Stop collecting data within the socket */
   sockopt_cork (peer->fd, 0);
 
   ret = write (peer->fd, STREAM_DATA (s), stream_get_endp (s));
   if (ret <= 0)    if (ret <= 0)
     {      {
       BGP_EVENT_ADD (peer, TCP_fatal_error);        BGP_EVENT_ADD (peer, TCP_fatal_error);
       return 0;        return 0;
     }      }
   
     /* Disable Nagle, make NOTIFY packet go out right away */
     val = 1;
     (void) setsockopt (peer->fd, IPPROTO_TCP, TCP_NODELAY,
                               (char *) &val, sizeof (val));
   
   /* Retrieve BGP packet type. */    /* Retrieve BGP packet type. */
   stream_set_getp (s, BGP_MARKER_SIZE + 2);    stream_set_getp (s, BGP_MARKER_SIZE + 2);
   type = stream_getc (s);    type = stream_getc (s);
Line 946  bgp_route_refresh_send (struct peer *peer, afi_t afi,  Line 966  bgp_route_refresh_send (struct peer *peer, afi_t afi, 
   
   /* Adjust safi code. */    /* Adjust safi code. */
   if (safi == SAFI_MPLS_VPN)    if (safi == SAFI_MPLS_VPN)
    safi = BGP_SAFI_VPNV4;    safi = SAFI_MPLS_LABELED_VPN;
       
   s = stream_new (BGP_MAX_PACKET_SIZE);    s = stream_new (BGP_MAX_PACKET_SIZE);
   
Line 1036  bgp_capability_send (struct peer *peer, afi_t afi, saf Line 1056  bgp_capability_send (struct peer *peer, afi_t afi, saf
   
   /* Adjust safi code. */    /* Adjust safi code. */
   if (safi == SAFI_MPLS_VPN)    if (safi == SAFI_MPLS_VPN)
    safi = BGP_SAFI_VPNV4;    safi = SAFI_MPLS_LABELED_VPN;
   
   s = stream_new (BGP_MAX_PACKET_SIZE);    s = stream_new (BGP_MAX_PACKET_SIZE);
   
Line 1152  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1172  bgp_open_receive (struct peer *peer, bgp_size_t size)
   as_t as4 = 0;    as_t as4 = 0;
   struct peer *realpeer;    struct peer *realpeer;
   struct in_addr remote_id;    struct in_addr remote_id;
  int capability;  int mp_capability;
   u_int8_t notify_data_remote_as[2];    u_int8_t notify_data_remote_as[2];
   u_int8_t notify_data_remote_id[4];    u_int8_t notify_data_remote_id[4];
   
Line 1174  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1194  bgp_open_receive (struct peer *peer, bgp_size_t size)
                 inet_ntoa (remote_id));                  inet_ntoa (remote_id));
       
   /* BEGIN to read the capability here, but dont do it yet */    /* BEGIN to read the capability here, but dont do it yet */
  capability = 0;  mp_capability = 0;
   optlen = stream_getc (peer->ibuf);    optlen = stream_getc (peer->ibuf);
       
   if (optlen != 0)    if (optlen != 0)
Line 1381  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1401  bgp_open_receive (struct peer *peer, bgp_size_t size)
   
   /* remote router-id check. */    /* remote router-id check. */
   if (remote_id.s_addr == 0    if (remote_id.s_addr == 0
      || ntohl (remote_id.s_addr) >= 0xe0000000      || IPV4_CLASS_DE (ntohl (remote_id.s_addr))
       || ntohl (peer->local_id.s_addr) == ntohl (remote_id.s_addr))        || ntohl (peer->local_id.s_addr) == ntohl (remote_id.s_addr))
     {      {
       if (BGP_DEBUG (normal, NORMAL))        if (BGP_DEBUG (normal, NORMAL))
Line 1400  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1420  bgp_open_receive (struct peer *peer, bgp_size_t size)
   /* Peer BGP version check. */    /* Peer BGP version check. */
   if (version != BGP_VERSION_4)    if (version != BGP_VERSION_4)
     {      {
      u_int8_t maxver = BGP_VERSION_4;      u_int16_t maxver = htons(BGP_VERSION_4);
       /* XXX this reply may not be correct if version < 4  XXX */
       if (BGP_DEBUG (normal, NORMAL))        if (BGP_DEBUG (normal, NORMAL))
         zlog_debug ("%s bad protocol version, remote requested %d, local request %d",          zlog_debug ("%s bad protocol version, remote requested %d, local request %d",
                    peer->host, version, BGP_VERSION_4);                     peer->host, version, BGP_VERSION_4);
         /* Data must be in network byte order here */
       bgp_notify_send_with_data (peer,         bgp_notify_send_with_data (peer, 
                                  BGP_NOTIFY_OPEN_ERR,                                    BGP_NOTIFY_OPEN_ERR, 
                                  BGP_NOTIFY_OPEN_UNSUP_VERSION,                                   BGP_NOTIFY_OPEN_UNSUP_VERSION,
                                 &maxver, 1);                                 (u_int8_t *) &maxver, 2);
       return -1;        return -1;
     }      }
   
Line 1459  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1481  bgp_open_receive (struct peer *peer, bgp_size_t size)
   /* Open option part parse. */    /* Open option part parse. */
   if (optlen != 0)     if (optlen != 0) 
     {      {
      if ((ret = bgp_open_option_parse (peer, optlen, &capability)) < 0)      if ((ret = bgp_open_option_parse (peer, optlen, &mp_capability)) < 0)
         {          {
           bgp_notify_send (peer,            bgp_notify_send (peer,
                  BGP_NOTIFY_OPEN_ERR,                   BGP_NOTIFY_OPEN_ERR,
Line 1474  bgp_open_receive (struct peer *peer, bgp_size_t size) Line 1496  bgp_open_receive (struct peer *peer, bgp_size_t size)
                    peer->host);                     peer->host);
     }      }
   
  /* Override capability. */  /* 
  if (! capability || CHECK_FLAG (peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))   * Assume that the peer supports the locally configured set of
    * AFI/SAFIs if the peer did not send us any Mulitiprotocol
    * capabilities, or if 'override-capability' is configured.
    */
   if (! mp_capability ||
       CHECK_FLAG (peer->flags, PEER_FLAG_OVERRIDE_CAPABILITY))
     {      {
       peer->afc_nego[AFI_IP][SAFI_UNICAST] = peer->afc[AFI_IP][SAFI_UNICAST];        peer->afc_nego[AFI_IP][SAFI_UNICAST] = peer->afc[AFI_IP][SAFI_UNICAST];
       peer->afc_nego[AFI_IP][SAFI_MULTICAST] = peer->afc[AFI_IP][SAFI_MULTICAST];        peer->afc_nego[AFI_IP][SAFI_MULTICAST] = peer->afc[AFI_IP][SAFI_MULTICAST];
Line 1503  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1530  bgp_update_receive (struct peer *peer, bgp_size_t size
   u_char *end;    u_char *end;
   struct stream *s;    struct stream *s;
   struct attr attr;    struct attr attr;
     struct attr_extra extra;
   bgp_size_t attribute_len;    bgp_size_t attribute_len;
   bgp_size_t update_len;    bgp_size_t update_len;
   bgp_size_t withdraw_len;    bgp_size_t withdraw_len;
Line 1510  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1538  bgp_update_receive (struct peer *peer, bgp_size_t size
   struct bgp_nlri withdraw;    struct bgp_nlri withdraw;
   struct bgp_nlri mp_update;    struct bgp_nlri mp_update;
   struct bgp_nlri mp_withdraw;    struct bgp_nlri mp_withdraw;
   char attrstr[BUFSIZ] = "";  
   
   /* Status must be Established. */    /* Status must be Established. */
   if (peer->status != Established)     if (peer->status != Established) 
Line 1523  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1550  bgp_update_receive (struct peer *peer, bgp_size_t size
   
   /* Set initial values. */    /* Set initial values. */
   memset (&attr, 0, sizeof (struct attr));    memset (&attr, 0, sizeof (struct attr));
     memset (&extra, 0, sizeof (struct attr_extra));
   memset (&update, 0, sizeof (struct bgp_nlri));    memset (&update, 0, sizeof (struct bgp_nlri));
   memset (&withdraw, 0, sizeof (struct bgp_nlri));    memset (&withdraw, 0, sizeof (struct bgp_nlri));
   memset (&mp_update, 0, sizeof (struct bgp_nlri));    memset (&mp_update, 0, sizeof (struct bgp_nlri));
   memset (&mp_withdraw, 0, sizeof (struct bgp_nlri));    memset (&mp_withdraw, 0, sizeof (struct bgp_nlri));
     attr.extra = &extra;
   
   s = peer->ibuf;    s = peer->ibuf;
   end = stream_pnt (s) + size;    end = stream_pnt (s) + size;
Line 1627  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1656  bgp_update_receive (struct peer *peer, bgp_size_t size
   if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW    if (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW
       || BGP_DEBUG (update, UPDATE_IN))        || BGP_DEBUG (update, UPDATE_IN))
     {      {
         char attrstr[BUFSIZ];
         attrstr[0] = '\0';
   
       ret= bgp_dump_attr (peer, &attr, attrstr, BUFSIZ);        ret= bgp_dump_attr (peer, &attr, attrstr, BUFSIZ);
       int lvl = (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW)        int lvl = (attr_parse_ret == BGP_ATTR_PARSE_WITHDRAW)
                  ? LOG_ERR : LOG_DEBUG;                   ? LOG_ERR : LOG_DEBUG;
Line 1651  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1683  bgp_update_receive (struct peer *peer, bgp_size_t size
       if (ret < 0)        if (ret < 0)
         {          {
           bgp_attr_unintern_sub (&attr);            bgp_attr_unintern_sub (&attr);
           if (attr.extra)  
             bgp_attr_extra_free (&attr);  
           return -1;            return -1;
         }          }
   
Line 1679  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1709  bgp_update_receive (struct peer *peer, bgp_size_t size
           if (ret < 0)            if (ret < 0)
             {              {
               bgp_attr_unintern_sub (&attr);                bgp_attr_unintern_sub (&attr);
               if (attr.extra)  
                 bgp_attr_extra_free (&attr);  
               return -1;                return -1;
             }              }
   
Line 1803  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1831  bgp_update_receive (struct peer *peer, bgp_size_t size
     {      {
       if (mp_update.length         if (mp_update.length 
           && mp_update.afi == AFI_IP             && mp_update.afi == AFI_IP 
          && mp_update.safi == BGP_SAFI_VPNV4)          && mp_update.safi == SAFI_MPLS_LABELED_VPN)
         bgp_nlri_parse_vpnv4 (peer, NLRI_ATTR_ARG, &mp_update);          bgp_nlri_parse_vpnv4 (peer, NLRI_ATTR_ARG, &mp_update);
   
       if (mp_withdraw.length         if (mp_withdraw.length 
           && mp_withdraw.afi == AFI_IP             && mp_withdraw.afi == AFI_IP 
          && mp_withdraw.safi == BGP_SAFI_VPNV4)          && mp_withdraw.safi == SAFI_MPLS_LABELED_VPN)
         bgp_nlri_parse_vpnv4 (peer, NULL, &mp_withdraw);          bgp_nlri_parse_vpnv4 (peer, NULL, &mp_withdraw);
   
       if (! withdraw_len        if (! withdraw_len
           && mp_withdraw.afi == AFI_IP            && mp_withdraw.afi == AFI_IP
          && mp_withdraw.safi == BGP_SAFI_VPNV4          && mp_withdraw.safi == SAFI_MPLS_LABELED_VPN
           && mp_withdraw.length == 0)            && mp_withdraw.length == 0)
         {          {
           /* End-of-RIB received */            /* End-of-RIB received */
Line 1827  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1855  bgp_update_receive (struct peer *peer, bgp_size_t size
   /* Everything is done.  We unintern temporary structures which    /* Everything is done.  We unintern temporary structures which
      interned in bgp_attr_parse(). */       interned in bgp_attr_parse(). */
   bgp_attr_unintern_sub (&attr);    bgp_attr_unintern_sub (&attr);
  if (attr.extra)
    bgp_attr_extra_free (&attr); 
   
   /* If peering is stopped due to some reason, do not generate BGP    /* If peering is stopped due to some reason, do not generate BGP
      event.  */       event.  */
   if (peer->status != Established)    if (peer->status != Established)
Line 1839  bgp_update_receive (struct peer *peer, bgp_size_t size Line 1865  bgp_update_receive (struct peer *peer, bgp_size_t size
   peer->update_in++;    peer->update_in++;
   peer->update_time = bgp_clock ();    peer->update_time = bgp_clock ();
   
  /* Generate BGP event. */  /* Rearm holdtime timer */
  BGP_EVENT_ADD (peer, Receive_UPDATE_message);  BGP_TIMER_OFF (peer->t_holdtime);
   bgp_timer_set (peer);
   
   return 0;    return 0;
 }  }
Line 1973  bgp_route_refresh_receive (struct peer *peer, bgp_size Line 2000  bgp_route_refresh_receive (struct peer *peer, bgp_size
   /* Check AFI and SAFI. */    /* Check AFI and SAFI. */
   if ((afi != AFI_IP && afi != AFI_IP6)    if ((afi != AFI_IP && afi != AFI_IP6)
       || (safi != SAFI_UNICAST && safi != SAFI_MULTICAST        || (safi != SAFI_UNICAST && safi != SAFI_MULTICAST
          && safi != BGP_SAFI_VPNV4))          && safi != SAFI_MPLS_LABELED_VPN))
     {      {
       if (BGP_DEBUG (normal, NORMAL))        if (BGP_DEBUG (normal, NORMAL))
         {          {
Line 1984  bgp_route_refresh_receive (struct peer *peer, bgp_size Line 2011  bgp_route_refresh_receive (struct peer *peer, bgp_size
     }      }
   
   /* Adjust safi code. */    /* Adjust safi code. */
  if (safi == BGP_SAFI_VPNV4)  if (safi == SAFI_MPLS_LABELED_VPN)
     safi = SAFI_MPLS_VPN;      safi = SAFI_MPLS_VPN;
   
   if (size != BGP_MSG_ROUTE_REFRESH_MIN_SIZE - BGP_HEADER_SIZE)    if (size != BGP_MSG_ROUTE_REFRESH_MIN_SIZE - BGP_HEADER_SIZE)
Line 2022  bgp_route_refresh_receive (struct peer *peer, bgp_size Line 2049  bgp_route_refresh_receive (struct peer *peer, bgp_size
               u_int32_t seq;                u_int32_t seq;
               int psize;                int psize;
               char name[BUFSIZ];                char name[BUFSIZ];
               char buf[BUFSIZ];  
               int ret;                int ret;
   
               if (BGP_DEBUG (normal, NORMAL))                if (BGP_DEBUG (normal, NORMAL))
Line 2058  bgp_route_refresh_receive (struct peer *peer, bgp_size Line 2084  bgp_route_refresh_receive (struct peer *peer, bgp_size
                       break;                        break;
                     }                      }
                   ok = ((p_end - p_pnt) >= sizeof(u_int32_t)) ;                    ok = ((p_end - p_pnt) >= sizeof(u_int32_t)) ;
                  if (!ok)                  if (ok)
                     {                      {
                       memcpy (&seq, p_pnt, sizeof (u_int32_t));                        memcpy (&seq, p_pnt, sizeof (u_int32_t));
                       p_pnt += sizeof (u_int32_t);                        p_pnt += sizeof (u_int32_t);
Line 2092  bgp_route_refresh_receive (struct peer *peer, bgp_size Line 2118  bgp_route_refresh_receive (struct peer *peer, bgp_size
                   p_pnt += psize;                    p_pnt += psize;
   
                   if (BGP_DEBUG (normal, NORMAL))                    if (BGP_DEBUG (normal, NORMAL))
                    zlog_debug ("%s rcvd %s %s seq %u %s/%d ge %d le %d%s",                    {
                               peer->host,                      char buf[INET6_BUFSIZ];
                               (common & ORF_COMMON_PART_REMOVE ? "Remove" : "Add"), 
                               (common & ORF_COMMON_PART_DENY ? "deny" : "permit"),                      zlog_debug ("%s rcvd %s %s seq %u %s/%d ge %d le %d%s",
                               orfp.seq,                                  peer->host,
                               inet_ntop (orfp.p.family, &orfp.p.u.prefix, buf, BUFSIZ),                                 (common & ORF_COMMON_PART_REMOVE ? "Remove" : "Add"),
                               orfp.p.prefixlen, orfp.ge, orfp.le,                                 (common & ORF_COMMON_PART_DENY ? "deny" : "permit"),
                               ok ? "" : " MALFORMED");                                 orfp.seq,
                                                   inet_ntop (orfp.p.family, &orfp.p.u.prefix, buf, INET6_BUFSIZ),
                                  orfp.p.prefixlen, orfp.ge, orfp.le,
                                  ok ? "" : " MALFORMED");
                     }
 
                   if (ok)                    if (ok)
                     ret = prefix_bgp_orf_set (name, afi, &orfp,                      ret = prefix_bgp_orf_set (name, afi, &orfp,
                                    (common & ORF_COMMON_PART_DENY ? 0 : 1 ),                                     (common & ORF_COMMON_PART_DENY ? 0 : 1 ),
Line 2364  bgp_marker_all_one (struct stream *s, int length) Line 2394  bgp_marker_all_one (struct stream *s, int length)
   return 1;    return 1;
 }  }
   
   /* Recent thread time.
      On same clock base as bgp_clock (MONOTONIC)
      but can be time of last context switch to bgp_read thread. */
   static time_t
   bgp_recent_clock (void)
   {
     return recent_relative_time().tv_sec;
   }
   
 /* Starting point of packet process function. */  /* Starting point of packet process function. */
 int  int
 bgp_read (struct thread *thread)  bgp_read (struct thread *thread)
Line 2492  bgp_read (struct thread *thread) Line 2531  bgp_read (struct thread *thread)
       bgp_open_receive (peer, size); /* XXX return value ignored! */        bgp_open_receive (peer, size); /* XXX return value ignored! */
       break;        break;
     case BGP_MSG_UPDATE:      case BGP_MSG_UPDATE:
      peer->readtime = time(NULL);    /* Last read timer reset */      peer->readtime = bgp_recent_clock ();
       bgp_update_receive (peer, size);        bgp_update_receive (peer, size);
       break;        break;
     case BGP_MSG_NOTIFY:      case BGP_MSG_NOTIFY:
       bgp_notify_receive (peer, size);        bgp_notify_receive (peer, size);
       break;        break;
     case BGP_MSG_KEEPALIVE:      case BGP_MSG_KEEPALIVE:
      peer->readtime = time(NULL);    /* Last read timer reset */      peer->readtime = bgp_recent_clock ();
       bgp_keepalive_receive (peer, size);        bgp_keepalive_receive (peer, size);
       break;        break;
     case BGP_MSG_ROUTE_REFRESH_NEW:      case BGP_MSG_ROUTE_REFRESH_NEW:

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>