Skip to content

Commit

Permalink
BGP : Fix for nexthop as IPv4 mapped IPv6 address
Browse files Browse the repository at this point in the history
1. Indentation issue resolved.

Signed-off-by: Kaushik <kaushik@niralnetworks.com>
  • Loading branch information
KaushikNiral committed Jul 29, 2020
1 parent fb598ae commit c3c1906
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bgpd/bgp_updgrp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ struct stream *bpacket_reformat_for_peer(struct bpacket *pkt,
if (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg)) {
if (peer->nexthop.v4.s_addr) {
ipv4_to_ipv4_mapped_ipv6(mod_v6nhg,
peer->nexthop.v4);
peer->nexthop.v4);
}
}

Expand Down
12 changes: 6 additions & 6 deletions lib/ipaddr.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,12 @@ static inline char *ipaddr2str(const struct ipaddr *ip, char *buf, int size)
return buf;
}

#define IS_MAPPED_IPV6(A) \
((A)->s6_addr32[0] == 0x00000000 \
? ((A)->s6_addr32[1] == 0x00000000 \
? (ntohl((A)->s6_addr32[2]) == 0xFFFF ? 1 : 0) \
: 0) \
: 0)
#define IS_MAPPED_IPV6(A) \
((A)->s6_addr32[0] == 0x00000000 \
? ((A)->s6_addr32[1] == 0x00000000 \
? (ntohl((A)->s6_addr32[2]) == 0xFFFF ? 1 : 0) \
: 0) \
: 0)

/*
* Convert IPv4 address to IPv4-mapped IPv6 address which is of the
Expand Down

0 comments on commit c3c1906

Please sign in to comment.