diff options
author | Paul Jakma <paul.jakma@sun.com> | 2006-05-04 07:52:12 +0000 |
---|---|---|
committer | Paul Jakma <paul.jakma@sun.com> | 2006-05-04 07:52:12 +0000 |
commit | a3b6ea56a0add7d0972a66d96e1fbcf5461eecdb (patch) | |
tree | a7bb8a005ab41ce30c43dd0fc2fab487c0e5f613 /bgpd/bgp_packet.c | |
parent | 5f03f141eced8bad4971fcc6ec7d7a538c227d8c (diff) |
[bgpd] bug #210: Enable crucial VPNv4 code which was disabled
2006-05-04 Paul Jakma <paul.jakma@sun.com>
* (general) VPNv4 fixes. Certain VPNv4 code was not enabled.
See bug #210.
* bgp_attr.{c,h}: (bgp_packet_{withdraw,attribute}) Tag should be
u_char really.
* bgp_packet.c: (bgp_{update,withdraw}_packet) Enable some
VPNv4 code which inexplicably was ifdef'd out. comments from
a tester on IRC suggest this fixes bug #210.
Diffstat (limited to 'bgpd/bgp_packet.c')
-rw-r--r-- | bgpd/bgp_packet.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/bgpd/bgp_packet.c b/bgpd/bgp_packet.c index 07c3cbb1..8b024a1c 100644 --- a/bgpd/bgp_packet.c +++ b/bgpd/bgp_packet.c @@ -150,8 +150,6 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi) bgp_size_t total_attr_len = 0; unsigned long pos; char buf[BUFSIZ]; - struct prefix_rd *prd = NULL; - char *tag = NULL; s = peer->work; stream_reset (s); @@ -165,12 +163,6 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi) adj = adv->adj; if (adv->binfo) binfo = adv->binfo; -#ifdef MPLS_VPN - if (rn) - prd = (struct prefix_rd *) &rn->prn->p; - if (binfo) - tag = binfo->tag; -#endif /* MPLS_VPN */ /* When remaining space can't include NLRI and it's length. */ if (rn && STREAM_REMAIN (s) <= BGP_NLRI_LENGTH + PSIZE (rn->p.prefixlen)) @@ -179,6 +171,14 @@ bgp_update_packet (struct peer *peer, afi_t afi, safi_t safi) /* If packet is empty, set attribute. */ if (stream_empty (s)) { + struct prefix_rd *prd = NULL; + u_char *tag = NULL; + + if (rn->prn) + prd = (struct prefix_rd *) &rn->prn->p; + if (binfo) + tag = binfo->tag; + bgp_packet_set_marker (s, BGP_MSG_UPDATE); stream_putw (s, 0); pos = stream_get_endp (s); @@ -282,7 +282,6 @@ bgp_withdraw_packet (struct peer *peer, afi_t afi, safi_t safi) bgp_size_t unfeasible_len; bgp_size_t total_attr_len; char buf[BUFSIZ]; - struct prefix_rd *prd = NULL; s = peer->work; stream_reset (s); @@ -291,9 +290,6 @@ bgp_withdraw_packet (struct peer *peer, afi_t afi, safi_t safi) { adj = adv->adj; rn = adv->rn; -#ifdef MPLS_VPN - prd = (struct prefix_rd *) &rn->prn->p; -#endif /* MPLS_VPN */ if (STREAM_REMAIN (s) < (BGP_NLRI_LENGTH + BGP_TOTAL_ATTR_LEN + PSIZE (rn->p.prefixlen))) @@ -309,6 +305,10 @@ bgp_withdraw_packet (struct peer *peer, afi_t afi, safi_t safi) stream_put_prefix (s, &rn->p); else { + struct prefix_rd *prd = NULL; + + if (rn->prn) + prd = (struct prefix_rd *) &rn->prn->p; pos = stream_get_endp (s); stream_putw (s, 0); total_attr_len |