r->mvl_ifp = selection;
return !!r->mvl_ifp;
-
}
static struct vrrp_router *vrrp_router_create(struct vrrp_vrouter *vr,
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,
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
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);
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;
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);
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);
.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;
* 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;