diff options
author | Renato Westphal <renatowestphal@gmail.com> | 2016-08-24 17:11:00 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetwroks.com> | 2016-08-24 17:17:55 +0200 |
commit | f43e655ed8d2fae1bf76aa32485cadf4de23be42 (patch) | |
tree | c00f264ea0ccdf16b42fe8cce5bae18f917160d3 | |
parent | Merge remote-tracking branch 'origin/cmaster' into cmaster-next (diff) | |
download | frr-f43e655ed8d2fae1bf76aa32485cadf4de23be42.tar.xz frr-f43e655ed8d2fae1bf76aa32485cadf4de23be42.zip |
bgpd: fix build on Solaris
* Solaris doesn't have u_int64_t, so use uint64_t instead. C99-style
fixed-width integers should always be preferred to improve portability;
* 's_addr' is a macro on Solaris, so we can't use it as a variable name.
Rename the 's_addr' variable to 'addr' in the
bgp_peer_conf_if_to_su_update_v4() function.
Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
-rw-r--r-- | bgpd/bgp_table.h | 8 | ||||
-rw-r--r-- | bgpd/bgp_updgrp.c | 4 | ||||
-rw-r--r-- | bgpd/bgp_updgrp.h | 20 | ||||
-rw-r--r-- | bgpd/bgp_updgrp_adv.c | 6 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 24 | ||||
-rw-r--r-- | bgpd/bgpd.c | 20 | ||||
-rw-r--r-- | bgpd/bgpd.h | 6 |
7 files changed, 44 insertions, 44 deletions
diff --git a/bgpd/bgp_table.h b/bgpd/bgp_table.h index 1114c3701..2f839c4af 100644 --- a/bgpd/bgp_table.h +++ b/bgpd/bgp_table.h @@ -35,7 +35,7 @@ struct bgp_table struct peer *owner; struct route_table *route_table; - u_int64_t version; + uint64_t version; }; struct bgp_node @@ -56,7 +56,7 @@ struct bgp_node struct bgp_node *prn; - u_int64_t version; + uint64_t version; u_char flags; #define BGP_NODE_PROCESS_SCHEDULED (1 << 0) #define BGP_NODE_USER_CLEAR (1 << 1) @@ -311,13 +311,13 @@ bgp_table_iter_started (bgp_table_iter_t * iter) /* This would benefit from a real atomic operation... * until then. */ -static inline u_int64_t +static inline uint64_t bgp_table_next_version (struct bgp_table *table) { return ++table->version; } -static inline u_int64_t +static inline uint64_t bgp_table_version (struct bgp_table *table) { return table->version; diff --git a/bgpd/bgp_updgrp.c b/bgpd/bgp_updgrp.c index cd7710b50..29e6243a1 100644 --- a/bgpd/bgp_updgrp.c +++ b/bgpd/bgp_updgrp.c @@ -668,7 +668,7 @@ updgrp_show_packet_queue_walkcb (struct update_group *updgrp, void *arg) */ void update_group_show_packet_queue (struct bgp *bgp, afi_t afi, safi_t safi, - struct vty *vty, u_int64_t id) + struct vty *vty, uint64_t id) { struct updwalk_context ctx; @@ -1587,7 +1587,7 @@ update_bgp_group_free (struct bgp *bgp) void update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, - u_int64_t subgrp_id) + uint64_t subgrp_id) { struct updwalk_context ctx; memset (&ctx, 0, sizeof (ctx)); diff --git a/bgpd/bgp_updgrp.h b/bgpd/bgp_updgrp.h index aab2458b3..6ab384369 100644 --- a/bgpd/bgp_updgrp.h +++ b/bgpd/bgp_updgrp.h @@ -133,7 +133,7 @@ struct update_group safi_t safi; int afid; - u_int64_t id; + uint64_t id; time_t uptime; u_int32_t join_events; @@ -231,8 +231,8 @@ struct update_subgroup */ struct { - u_int64_t update_group_id; - u_int64_t subgroup_id; + uint64_t update_group_id; + uint64_t subgroup_id; } split_from; u_int32_t join_events; @@ -248,7 +248,7 @@ struct update_subgroup u_int32_t split_events; u_int32_t merge_checks_triggered; - u_int64_t id; + uint64_t id; struct zlog *log; u_int16_t sflags; @@ -297,8 +297,8 @@ struct updwalk_context struct vty *vty; struct bgp_node *rn; struct bgp_info *ri; - u_int64_t updgrp_id; - u_int64_t subgrp_id; + uint64_t updgrp_id; + uint64_t subgrp_id; bgp_policy_type_e policy_type; const char *policy_name; int policy_event_start_flag; @@ -367,7 +367,7 @@ extern void update_bgp_group_init (struct bgp *); extern void udpate_bgp_group_free (struct bgp *); extern void -update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, u_int64_t subgrp_id); +update_group_show (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, uint64_t subgrp_id); extern void update_group_show_stats (struct bgp *bgp, struct vty *vty); extern void update_group_adjust_peer (struct peer_af *paf); extern int update_group_adjust_soloness (struct peer *peer, int set); @@ -439,13 +439,13 @@ extern struct bgp_advertise *bgp_advertise_clean_subgroup (struct *adj); extern void update_group_show_adj_queue (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, - u_int64_t id); + uint64_t id); extern void update_group_show_advertised (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, - u_int64_t id); + uint64_t id); extern void update_group_show_packet_queue (struct bgp *bgp, afi_t afi, safi_t safi, struct vty *vty, - u_int64_t id); + uint64_t id); extern void subgroup_announce_route (struct update_subgroup *subgrp); extern void subgroup_announce_all (struct update_subgroup *subgrp); diff --git a/bgpd/bgp_updgrp_adv.c b/bgpd/bgp_updgrp_adv.c index 96bcd011c..c485e61e5 100644 --- a/bgpd/bgp_updgrp_adv.c +++ b/bgpd/bgp_updgrp_adv.c @@ -277,7 +277,7 @@ updgrp_show_adj_walkcb (struct update_group *updgrp, void *arg) static void updgrp_show_adj (struct bgp *bgp, afi_t afi, safi_t safi, - struct vty *vty, u_int64_t id, u_int8_t flags) + struct vty *vty, uint64_t id, u_int8_t flags) { struct updwalk_context ctx; memset (&ctx, 0, sizeof (ctx)); @@ -850,14 +850,14 @@ group_announce_route (struct bgp *bgp, afi_t afi, safi_t safi, void update_group_show_adj_queue (struct bgp *bgp, afi_t afi, safi_t safi, - struct vty *vty, u_int64_t id) + struct vty *vty, uint64_t id) { updgrp_show_adj (bgp, afi, safi, vty, id, UPDWALK_FLAGS_ADVQUEUE); } void update_group_show_advertised (struct bgp *bgp, afi_t afi, safi_t safi, - struct vty *vty, u_int64_t id) + struct vty *vty, uint64_t id) { updgrp_show_adj (bgp, afi, safi, vty, id, UPDWALK_FLAGS_ADVERTISED); } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index bb074dc02..66f329072 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -13013,7 +13013,7 @@ DEFUN (show_ip_bgp_attr_info, static int bgp_show_update_groups(struct vty *vty, const char *name, int afi, int safi, - u_int64_t subgrp_id) + uint64_t subgrp_id) { struct bgp *bgp; @@ -13140,7 +13140,7 @@ DEFUN (show_ip_bgp_updgrps_s, "Detailed info about dynamic update groups\n" "Specific subgroup to display detailed info for\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); return (bgp_show_update_groups(vty, NULL, AFI_IP, SAFI_UNICAST, subgrp_id)); @@ -13156,7 +13156,7 @@ DEFUN (show_ip_bgp_instance_updgrps_s, "Detailed info about dynamic update groups\n" "Specific subgroup to display detailed info for\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); return (bgp_show_update_groups(vty, argv[1], AFI_IP, SAFI_UNICAST, subgrp_id)); @@ -13170,7 +13170,7 @@ DEFUN (show_bgp_ipv6_updgrps_s, "Detailed info about v6 dynamic update groups\n" "Specific subgroup to display detailed info for\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); return(bgp_show_update_groups(vty, NULL, AFI_IP6, SAFI_UNICAST, subgrp_id)); @@ -13184,7 +13184,7 @@ DEFUN (show_bgp_instance_ipv6_updgrps_s, "Detailed info about v6 dynamic update groups\n" "Specific subgroup to display detailed info for\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); return(bgp_show_update_groups(vty, argv[1], AFI_IP6, SAFI_UNICAST, subgrp_id)); @@ -13204,7 +13204,7 @@ DEFUN (show_bgp_updgrps_s, { afi_t afi; safi_t safi; - u_int64_t subgrp_id; + uint64_t subgrp_id; afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6; safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; @@ -13251,7 +13251,7 @@ DEFUN (show_bgp_instance_updgrps_stats, static void show_bgp_updgrps_adj_info_aux (struct vty *vty, const char *name, afi_t afi, safi_t safi, - const char *what, u_int64_t subgrp_id) + const char *what, uint64_t subgrp_id) { struct bgp *bgp; @@ -13370,7 +13370,7 @@ DEFUN (show_ip_bgp_updgrps_adj_s, "Packet queue\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); @@ -13392,7 +13392,7 @@ DEFUN (show_ip_bgp_instance_updgrps_adj_s, "Packet queue\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); @@ -13418,7 +13418,7 @@ DEFUN (show_bgp_updgrps_afi_adj_s, { afi_t afi; safi_t safi; - u_int64_t subgrp_id; + uint64_t subgrp_id; afi = (strcmp(argv[0], "ipv4") == 0) ? AFI_IP : AFI_IP6; safi = (strncmp (argv[1], "m", 1) == 0) ? SAFI_MULTICAST : SAFI_UNICAST; @@ -13439,7 +13439,7 @@ DEFUN (show_bgp_updgrps_adj_s, "Announced routes\n" "Packet queue\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[0]); @@ -13459,7 +13459,7 @@ DEFUN (show_bgp_instance_updgrps_adj_s, "Announced routes\n" "Packet queue\n") { - u_int64_t subgrp_id; + uint64_t subgrp_id; VTY_GET_ULL("subgroup-id", subgrp_id, argv[2]); diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 71ccf7c90..b18572c07 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1295,7 +1295,7 @@ bgp_peer_conf_if_to_su_update_v4 (struct peer *peer, struct interface *ifp) { struct connected *ifc; struct prefix p; - u_int32_t s_addr; + u_int32_t addr; struct listnode *node; /* If our IPv4 address on the interface is /30 or /31, we can derive the @@ -1309,11 +1309,11 @@ bgp_peer_conf_if_to_su_update_v4 (struct peer *peer, struct interface *ifp) if (p.prefixlen == 30) { peer->su.sa.sa_family = AF_INET; - s_addr = ntohl(p.u.prefix4.s_addr); - if (s_addr % 4 == 1) - peer->su.sin.sin_addr.s_addr = htonl(s_addr+1); - else if (s_addr % 4 == 2) - peer->su.sin.sin_addr.s_addr = htonl(s_addr-1); + addr = ntohl(p.u.prefix4.s_addr); + if (addr % 4 == 1) + peer->su.sin.sin_addr.s_addr = htonl(addr+1); + else if (addr % 4 == 2) + peer->su.sin.sin_addr.s_addr = htonl(addr-1); #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN peer->su.sin.sin_len = sizeof(struct sockaddr_in); #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ @@ -1322,11 +1322,11 @@ bgp_peer_conf_if_to_su_update_v4 (struct peer *peer, struct interface *ifp) else if (p.prefixlen == 31) { peer->su.sa.sa_family = AF_INET; - s_addr = ntohl(p.u.prefix4.s_addr); - if (s_addr % 2 == 0) - peer->su.sin.sin_addr.s_addr = htonl(s_addr+1); + addr = ntohl(p.u.prefix4.s_addr); + if (addr % 2 == 0) + peer->su.sin.sin_addr.s_addr = htonl(addr+1); else - peer->su.sin.sin_addr.s_addr = htonl(s_addr-1); + peer->su.sin.sin_addr.s_addr = htonl(addr-1); #ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN peer->su.sin.sin_len = sizeof(struct sockaddr_in); #endif /* HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */ diff --git a/bgpd/bgpd.h b/bgpd/bgpd.h index d9a68599c..e8827ca91 100644 --- a/bgpd/bgpd.h +++ b/bgpd/bgpd.h @@ -112,8 +112,8 @@ struct bgp_master #define BGP_OPT_CONFIG_CISCO (1 << 2) #define BGP_OPT_NO_LISTEN (1 << 3) - u_int64_t updgrp_idspace; - u_int64_t subgrp_idspace; + uint64_t updgrp_idspace; + uint64_t subgrp_idspace; /* timer to dampen route map changes */ struct thread *t_rmap_update; /* Handle route map updates */ @@ -518,7 +518,7 @@ struct peer /* BGP peer group. */ struct peer_group *group; - u_int64_t version[AFI_MAX][SAFI_MAX]; + uint64_t version[AFI_MAX][SAFI_MAX]; /* BGP peer_af structures, per configured AF on this peer */ struct peer_af *peer_af_array[BGP_AF_MAX]; |