From: Benjamin Cama Date: Sun, 7 Aug 2011 22:35:08 +0000 (+0200) Subject: Merge branch 'rfc4760' into fdn-mods X-Git-Tag: debian/2.2.1-1fdn2~5^2 X-Git-Url: http://git.sameswireless.fr/l2tpns.git/commitdiff_plain/ae7d3c9fca4afa0dcc83095c4405ce3461276075?hp=1c898f7017d2f3bfc07dfdadd077d70ccf6066c1 Merge branch 'rfc4760' into fdn-mods --- diff --git a/bgp.c b/bgp.c index 600c950..901ea55 100644 --- a/bgp.c +++ b/bgp.c @@ -1383,7 +1383,11 @@ static int bgp_send_open(struct bgp_peer *peer) data.version = BGP_VERSION; data.as = htons(our_as); data.hold_time = htons(peer->hold); - data.identifier = my_address; + /* use the source IP we use as identifier, if available */ + if (peer->source_addr != INADDR_ANY) + data.identifier = peer->source_addr; + else + data.identifier = my_address; /* if we know peer doesn't support MP (mp_handling == DoesntHandleIPv6Routes) then don't add this parameter */