Merge branch 'rfc4760' into fdn-mods
authorBenjamin Cama <benoar@dolka.fr>
Fri, 29 Jul 2011 11:04:31 +0000 (13:04 +0200)
committerBenjamin Cama <benoar@dolka.fr>
Fri, 29 Jul 2011 11:04:31 +0000 (13:04 +0200)
1  2 
bgp.c
bgp.h
etc/startup-config.default
l2tpns.c
l2tpns.h

diff --cc bgp.c
--- 1/bgp.c
--- 2/bgp.c
+++ b/bgp.c
@@@ -237,6 -226,18 +227,25 @@@ int bgp_start(struct bgp_peer *peer, ch
  
      ADD_ATTRIBUTE();
  
 -    ip = my_address; /* we're it */
+     /* remember the len before adding NEXT_HOP */
+     peer->path_attr_len_without_nexthop = peer->path_attr_len;
+     /* NEXT_HOP */
+     a.flags = BGP_PATH_ATTR_FLAG_TRANS;
+     a.code = BGP_PATH_ATTR_CODE_NEXT_HOP;
++    if (config->nexthop_address)
++    {
++      ip = config->nexthop_address;
++    }
++    else
++    {
++      ip = my_address; /* we're it */
++    }
+     a.data.s.len = sizeof(ip);
+     memcpy(a.data.s.value, &ip, sizeof(ip));
+     ADD_ATTRIBUTE();
      if (!(peer->path_attrs = malloc(peer->path_attr_len)))
      {
        LOG(0, 0, 0, "Can't allocate path_attrs for %s (%s)\n",
diff --cc bgp.h
Simple merge
Simple merge
diff --cc l2tpns.c
+++ b/l2tpns.c
@@@ -157,9 -157,7 +157,10 @@@ config_descriptt config_values[] = 
        CONFIG("cluster_hb_timeout", cluster_hb_timeout, INT),
        CONFIG("cluster_master_min_adv", cluster_master_min_adv, INT),
        CONFIG("ipv6_prefix", ipv6_prefix, IPv6),
 +      CONFIG("cli_bind_address", cli_bind_address, IPv4),
 +      CONFIG("hostname", hostname, STRING),
 +      CONFIG("nexthop_address", nexthop_address, IPv4),
+       CONFIG("nexthop6_address", nexthop6_address, IPv6),
        { NULL, 0, 0, 0 },
  };
  
diff --cc l2tpns.h
+++ b/l2tpns.h
@@@ -726,9 -723,8 +726,10 @@@ typedef struc
                uint16_t as;
                int keepalive;
                int hold;
 +              struct in_addr update_source;
        } neighbour[BGP_NUM_PEERS];
 +      in_addr_t       nexthop_address;
+       struct in6_addr nexthop6_address;
  #endif
  } configt;