From: Quentin Young Date: Tue, 26 Feb 2019 18:49:11 +0000 (+0000) Subject: vrrpd: style cleanup X-Git-Tag: base_7.2~330^2~58 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=354b49d6d9433c3e5b57fb76e8ce8b72c9388d26;p=matthieu%2Ffrr.git vrrpd: style cleanup Signed-off-by: Quentin Young --- diff --git a/vrrpd/vrrp.c b/vrrpd/vrrp.c index 06c3bbfd10..20cec70063 100644 --- a/vrrpd/vrrp.c +++ b/vrrpd/vrrp.c @@ -478,7 +478,6 @@ static bool vrrp_attach_interface(struct vrrp_router *r) r->mvl_ifp = selection; return !!r->mvl_ifp; - } static struct vrrp_router *vrrp_router_create(struct vrrp_vrouter *vr, @@ -594,8 +593,8 @@ static void vrrp_send_advertisement(struct vrrp_router *r) if (DEBUG_MODE_CHECK(&vrrp_dbg_pkt, DEBUG_MODE_ALL)) zlog_hexdump(pkt, (size_t)pktsz); - const char *group = - r->family == AF_INET ? VRRP_MCASTV4_GROUP_STR : VRRP_MCASTV6_GROUP_STR; + const char *group = r->family == AF_INET ? VRRP_MCASTV4_GROUP_STR + : VRRP_MCASTV6_GROUP_STR; str2sockunion(group, &dest); ssize_t sent = sendto(r->sock_tx, pkt, (size_t)pktsz, 0, &dest.sa, @@ -711,7 +710,8 @@ static int vrrp_recv_advertisement(struct vrrp_router *r, struct ipaddr *src, r->vr->advertisement_interval * 10, &r->t_adver_timer); } else if (pkt->hdr.priority > r->priority - || ((pkt->hdr.priority == r->priority) && addrcmp > 0)) { + || ((pkt->hdr.priority == r->priority) + && addrcmp > 0)) { zlog_info( VRRP_LOGPFX VRRP_LOGPFX_VRID "Received advertisement from %s w/ priority %" PRIu8 @@ -1520,8 +1520,8 @@ static void vrrp_autoconfig_autoaddrupdate(struct vrrp_vrouter *vr) vr->vrid, vr->v4->mvl_ifp->name); for (ALL_LIST_ELEMENTS_RO(vr->v4->mvl_ifp->connected, ln, c)) if (c->address->family == AF_INET) { - inet_ntop(AF_INET, &c->address->u.prefix4, ipbuf, - sizeof(ipbuf)); + inet_ntop(AF_INET, &c->address->u.prefix4, + ipbuf, sizeof(ipbuf)); DEBUGD(&vrrp_dbg_auto, VRRP_LOGPFX VRRP_LOGPFX_VRID "Adding %s", vr->vrid, ipbuf); diff --git a/vrrpd/vrrp_arp.c b/vrrpd/vrrp_arp.c index 006f31a95b..dd3c635beb 100644 --- a/vrrpd/vrrp_arp.c +++ b/vrrpd/vrrp_arp.c @@ -50,7 +50,8 @@ static int garp_fd = -1; /* Send the gratuitous ARP message */ -static ssize_t vrrp_send_garp(struct interface *ifp, uint8_t *buf, ssize_t pack_len) +static ssize_t vrrp_send_garp(struct interface *ifp, uint8_t *buf, + ssize_t pack_len) { struct sockaddr_ll sll; ssize_t len; @@ -59,7 +60,7 @@ static ssize_t vrrp_send_garp(struct interface *ifp, uint8_t *buf, ssize_t pack_ memset(&sll, 0, sizeof(sll)); sll.sll_family = AF_PACKET; sll.sll_protocol = ETH_P_ARP; - sll.sll_ifindex = (int) ifp->ifindex; + sll.sll_ifindex = (int)ifp->ifindex; sll.sll_halen = ifp->hw_addr_len; memset(sll.sll_addr, 0xFF, ETH_ALEN); @@ -80,14 +81,14 @@ static ssize_t vrrp_build_garp(uint8_t *buf, struct interface *ifp, return -1; /* Build Ethernet header */ - struct ether_header *eth = (struct ether_header *) buf; + struct ether_header *eth = (struct ether_header *)buf; memset(eth->ether_dhost, 0xFF, ETH_ALEN); memcpy(eth->ether_shost, ifp->hw_addr, ETH_ALEN); eth->ether_type = htons(ETHERTYPE_ARP); /* Build ARP payload */ - struct arphdr *arph = (struct arphdr *) (buf + ETHER_HDR_LEN); + struct arphdr *arph = (struct arphdr *)(buf + ETHER_HDR_LEN); arph->ar_hrd = htons(HWTYPE_ETHER); arph->ar_pro = htons(ETHERTYPE_IP); diff --git a/vrrpd/vrrp_main.c b/vrrpd/vrrp_main.c index 0117497590..0ac77350eb 100644 --- a/vrrpd/vrrp_main.c +++ b/vrrpd/vrrp_main.c @@ -57,7 +57,7 @@ struct zebra_privs_t vrrp_privs = { .cap_num_p = array_size(_caps_p), .cap_num_i = 0}; -struct option longopts[] = { { 0 } }; +struct option longopts[] = {{0}}; /* Master of threads. */ struct thread_master *master; diff --git a/vrrpd/vrrp_ndisc.c b/vrrpd/vrrp_ndisc.c index 6813506d1f..0f59b23007 100644 --- a/vrrpd/vrrp_ndisc.c +++ b/vrrpd/vrrp_ndisc.c @@ -67,7 +67,7 @@ static int ndisc_fd = -1; * 0 otherwise */ static int vrrp_ndisc_una_build(struct interface *ifp, struct ipaddr *ip, - uint8_t *buf, size_t bufsiz) + uint8_t *buf, size_t bufsiz) { if (bufsiz < VRRP_NDISC_SIZE) return -1;