summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2018-08-13 19:52:57 +0200
committerQuentin Young <qlyoung@cumulusnetworks.com>2018-08-14 22:02:05 +0200
commit633fc9b133b73aee6c828b20339ce0762664e3f0 (patch)
tree066e1eddfd84dbc9fef25fb9a9701969e30851a2
parentzebra: fix warnings from frr_elevate_privs() (diff)
downloadfrr-633fc9b133b73aee6c828b20339ce0762664e3f0.tar.xz
frr-633fc9b133b73aee6c828b20339ce0762664e3f0.zip
*: frr_elevate_privs whitespace fixes
(... and one superfluous variable removed) Signed-off-by: David Lamparter <equinox@diac24.net>
-rw-r--r--bgpd/bgp_network.c14
-rw-r--r--isisd/isis_bpf.c6
-rw-r--r--isisd/isis_dlpi.c6
-rw-r--r--isisd/isis_pfpacket.c6
-rw-r--r--pimd/pim_mroute.c4
-rw-r--r--ripd/ripd.c14
-rw-r--r--ripngd/ripngd.c4
-rw-r--r--zebra/if_netlink.c3
-rw-r--r--zebra/ipforward_sysctl.c6
9 files changed, 33 insertions, 30 deletions
diff --git a/bgpd/bgp_network.c b/bgpd/bgp_network.c
index 2bdd43c14..0664fdfd1 100644
--- a/bgpd/bgp_network.c
+++ b/bgpd/bgp_network.c
@@ -567,9 +567,11 @@ int bgp_connect(struct peer *peer)
#ifdef IPTOS_PREC_INTERNETCONTROL
frr_elevate_privs(&bgpd_privs) {
if (sockunion_family(&peer->su) == AF_INET)
- setsockopt_ipv4_tos(peer->fd, IPTOS_PREC_INTERNETCONTROL);
+ setsockopt_ipv4_tos(peer->fd,
+ IPTOS_PREC_INTERNETCONTROL);
else if (sockunion_family(&peer->su) == AF_INET6)
- setsockopt_ipv6_tclass(peer->fd, IPTOS_PREC_INTERNETCONTROL);
+ setsockopt_ipv6_tclass(peer->fd,
+ IPTOS_PREC_INTERNETCONTROL);
}
#endif
@@ -644,7 +646,8 @@ static int bgp_listener(int sock, struct sockaddr *sa, socklen_t salen,
if (sa->sa_family == AF_INET)
setsockopt_ipv4_tos(sock, IPTOS_PREC_INTERNETCONTROL);
else if (sa->sa_family == AF_INET6)
- setsockopt_ipv6_tclass(sock, IPTOS_PREC_INTERNETCONTROL);
+ setsockopt_ipv6_tclass(sock,
+ IPTOS_PREC_INTERNETCONTROL);
#endif
sockopt_v6only(sa->sa_family, sock);
@@ -718,8 +721,9 @@ int bgp_socket(struct bgp *bgp, unsigned short port, const char *address)
sock = vrf_socket(ainfo->ai_family,
ainfo->ai_socktype,
ainfo->ai_protocol, bgp->vrf_id,
- (bgp->inst_type == BGP_INSTANCE_TYPE_VRF ?
- bgp->name : NULL));
+ (bgp->inst_type
+ == BGP_INSTANCE_TYPE_VRF
+ ? bgp->name : NULL));
}
if (sock < 0) {
flog_err_sys(LIB_ERR_SOCKET, "socket: %s",
diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c
index cd7a090f7..d05dba33e 100644
--- a/isisd/isis_bpf.c
+++ b/isisd/isis_bpf.c
@@ -192,7 +192,8 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = open_bpf_dev(circuit);
if (retval != ISIS_OK) {
- zlog_warn("%s: could not initialize the socket", __func__);
+ zlog_warn("%s: could not initialize the socket",
+ __func__);
break;
}
@@ -204,8 +205,7 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = ISIS_WARNING;
break;
}
-
-}
+ }
return retval;
}
diff --git a/isisd/isis_dlpi.c b/isisd/isis_dlpi.c
index a06d68cbd..54a19ad23 100644
--- a/isisd/isis_dlpi.c
+++ b/isisd/isis_dlpi.c
@@ -473,7 +473,8 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = open_dlpi_dev(circuit);
if (retval != ISIS_OK) {
- zlog_warn("%s: could not initialize the socket", __func__);
+ zlog_warn("%s: could not initialize the socket",
+ __func__);
break;
}
@@ -485,8 +486,7 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = ISIS_WARNING;
break;
}
-
-}
+ }
return retval;
}
diff --git a/isisd/isis_pfpacket.c b/isisd/isis_pfpacket.c
index e0d8e4d8f..2f6526bc5 100644
--- a/isisd/isis_pfpacket.c
+++ b/isisd/isis_pfpacket.c
@@ -190,7 +190,8 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = open_packet_socket(circuit);
if (retval != ISIS_OK) {
- zlog_warn("%s: could not initialize the socket", __func__);
+ zlog_warn("%s: could not initialize the socket",
+ __func__);
break;
}
@@ -206,8 +207,7 @@ int isis_sock_init(struct isis_circuit *circuit)
retval = ISIS_WARNING;
break;
}
-
-}
+ }
return retval;
}
diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c
index d3f13b38e..c69e2939e 100644
--- a/pimd/pim_mroute.c
+++ b/pimd/pim_mroute.c
@@ -717,8 +717,8 @@ int pim_mroute_socket_enable(struct pim_instance *pim)
#ifdef SO_BINDTODEVICE
if (pim->vrf->vrf_id != VRF_DEFAULT
- && setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE, pim->vrf->name,
- strlen(pim->vrf->name))) {
+ && setsockopt(fd, SOL_SOCKET, SO_BINDTODEVICE,
+ pim->vrf->name, strlen(pim->vrf->name))) {
zlog_warn("Could not setsockopt SO_BINDTODEVICE: %s",
safe_strerror(errno));
close(fd);
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 8ee165967..02ead6fde 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -1359,20 +1359,16 @@ static int rip_create_socket(void)
frr_elevate_privs(&ripd_privs) {
setsockopt_so_recvbuf(sock, RIP_UDP_RCV_BUF);
- if ((ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr))) < 0)
-
- {
- int save_errno = errno;
-
+ if ((ret = bind(sock, (struct sockaddr *)&addr, sizeof(addr)))
+ < 0) {
zlog_err("%s: Can't bind socket %d to %s port %d: %s",
- __func__,
- sock, inet_ntoa(addr.sin_addr),
- (int)ntohs(addr.sin_port), safe_strerror(save_errno));
+ __func__, sock, inet_ntoa(addr.sin_addr),
+ (int)ntohs(addr.sin_port),
+ safe_strerror(errno));
close(sock);
return ret;
}
-
}
return sock;
diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c
index 925b3f137..bab5e35df 100644
--- a/ripngd/ripngd.c
+++ b/ripngd/ripngd.c
@@ -126,10 +126,10 @@ static int ripng_make_socket(void)
ripaddr.sin6_port = htons(RIPNG_PORT_DEFAULT);
frr_elevate_privs(&ripngd_privs) {
-
ret = bind(sock, (struct sockaddr *)&ripaddr, sizeof(ripaddr));
if (ret < 0) {
- zlog_err("Can't bind ripng socket: %s.", safe_strerror(errno));
+ zlog_err("Can't bind ripng socket: %s.",
+ safe_strerror(errno));
goto error;
}
}
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c
index c0da066aa..a15d91424 100644
--- a/zebra/if_netlink.c
+++ b/zebra/if_netlink.c
@@ -386,7 +386,8 @@ static int get_iflink_speed(struct interface *interface)
return 0;
}
/* Get the current link state for the interface */
- rc = vrf_ioctl(interface->vrf_id, sd, SIOCETHTOOL, (char *)&ifdata);
+ rc = vrf_ioctl(interface->vrf_id, sd, SIOCETHTOOL,
+ (char *)&ifdata);
}
if (rc < 0) {
if (IS_ZEBRA_DEBUG_KERNEL)
diff --git a/zebra/ipforward_sysctl.c b/zebra/ipforward_sysctl.c
index 9fa636641..74a178e59 100644
--- a/zebra/ipforward_sysctl.c
+++ b/zebra/ipforward_sysctl.c
@@ -109,7 +109,8 @@ int ipforward_ipv6_on(void)
len = sizeof ip6forwarding;
frr_elevate_privs(&zserv_privs) {
- if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) {
+ if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len)
+ < 0) {
zlog_warn("can't get ip6forwarding value");
return -1;
}
@@ -124,7 +125,8 @@ int ipforward_ipv6_off(void)
len = sizeof ip6forwarding;
frr_elevate_privs(&zserv_privs) {
- if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len) < 0) {
+ if (sysctl(mib_ipv6, MIB_SIZ, NULL, NULL, &ip6forwarding, len)
+ < 0) {
zlog_warn("can't get ip6forwarding value");
return -1;
}