From: Benjamin Cama Date: Fri, 29 Jul 2011 11:04:31 +0000 (+0200) Subject: Merge branch 'rfc4760' into fdn-mods X-Git-Tag: debian/2.2.1-1fdn1~1^2 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/1c898f7017d2f3bfc07dfdadd077d70ccf6066c1?ds=inline Merge branch 'rfc4760' into fdn-mods --- 1c898f7017d2f3bfc07dfdadd077d70ccf6066c1 diff --cc bgp.c index 8e722de,4a4bea0..600c950 --- a/bgp.c +++ b/bgp.c @@@ -237,6 -226,18 +227,25 @@@ int bgp_start(struct bgp_peer *peer, ch ADD_ATTRIBUTE(); + /* 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; - ip = my_address; /* we're it */ ++ 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 l2tpns.c index 39b09b5,6a4656e..61b2184 --- a/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 index e6357b6,55de73f..4f7fad9 --- a/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;