diff options
| author | Daniel Walton <dwalton@cumulusnetworks.com> | 2018-02-26 22:13:22 +0000 | 
|---|---|---|
| committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2018-02-26 22:13:22 +0000 | 
| commit | 194a4f2c5c7f1fd1ea93e97d71bb841ac08947a4 (patch) | |
| tree | 77d17f24a9f18687b82fce88f471ccad5f61ea1a /bgpd/bgp_dump.c | |
| parent | 8d056acc82e16b83a56d82960e1d3f3dfbabfef9 (diff) | |
bgpd: use peer->ifp->ifindex instead of peer->ifindex
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
peer->ifindex was only used in two places but it was never populated so
neither of them worked as they should.  'struct peer' also has a 'struct
interface' pointer which we can use to get the ifindex.
Diffstat (limited to 'bgpd/bgp_dump.c')
| -rw-r--r-- | bgpd/bgp_dump.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/bgpd/bgp_dump.c b/bgpd/bgp_dump.c index 0831369062..4e998b1fd9 100644 --- a/bgpd/bgp_dump.c +++ b/bgpd/bgp_dump.c @@ -465,7 +465,7 @@ static void bgp_dump_common(struct stream *obuf, struct peer *peer,  	}  	if (peer->su.sa.sa_family == AF_INET) { -		stream_putw(obuf, peer->ifindex); +		stream_putw(obuf, peer->ifp ? peer->ifp->ifindex : 0);  		stream_putw(obuf, AFI_IP);  		stream_put(obuf, &peer->su.sin.sin_addr, IPV4_MAX_BYTELEN); @@ -477,7 +477,7 @@ static void bgp_dump_common(struct stream *obuf, struct peer *peer,  			stream_put(obuf, empty, IPV4_MAX_BYTELEN);  	} else if (peer->su.sa.sa_family == AF_INET6) {  		/* Interface Index and Address family. */ -		stream_putw(obuf, peer->ifindex); +		stream_putw(obuf, peer->ifp ? peer->ifp->ifindex : 0);  		stream_putw(obuf, AFI_IP6);  		/* Source IP Address and Destination IP Address. */  | 
