From 43baf47948c66586517548b4d0bc146ba64662fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Mon, 10 Nov 2025 13:12:46 +0100 Subject: [PATCH] src: remove whitespaces at EOL MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit These whitespaces do nothing and can be removed. Signed-off-by: Álvaro Fernández Rojas --- src/config.c | 10 +++++----- src/dhcpv6.c | 2 +- src/odhcpd.c | 2 +- src/router.c | 14 +++++++------- src/router.h | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/config.c b/src/config.c index 109376a..39a6db5 100644 --- a/src/config.c +++ b/src/config.c @@ -1431,7 +1431,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_REACHABLETIME])) { uint32_t ra_reachabletime = blobmsg_get_u32(c); - /* RFC4861 §6.2.1 : AdvReachableTime : + /* RFC4861 §6.2.1 : AdvReachableTime : * MUST be no greater than 3,600,000 msec */ iface->ra_reachabletime = ra_reachabletime <= AdvReachableTime ? ra_reachabletime : AdvReachableTime; @@ -1504,7 +1504,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr uint32_t ra_maxinterval = blobmsg_get_u32(c); if (ra_maxinterval < 4) ra_maxinterval = 4; - else if (ra_maxinterval > MaxRtrAdvInterval) + else if (ra_maxinterval > MaxRtrAdvInterval) ra_maxinterval = MaxRtrAdvInterval; iface->ra_maxinterval = ra_maxinterval; } @@ -1518,12 +1518,12 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr uint32_t ra_mininterval = blobmsg_get_u32(c); if (ra_mininterval < MinRtrAdvInterval) ra_mininterval = MinRtrAdvInterval; // clamp min - else if (ra_mininterval > (0.75 * iface->ra_maxinterval)) + else if (ra_mininterval > (0.75 * iface->ra_maxinterval)) ra_mininterval = 0.75 * iface->ra_maxinterval; // clamp max iface->ra_mininterval = ra_mininterval; } - /* + /* * RFC4861: AdvDefaultLifetime: MUST be either zero or between MaxRtrAdvInterval and 9000 seconds. * RFC8319: AdvDefaultLifetime: MUST be either zero or between MaxRtrAdvInterval and 65535 seconds. * Default: 3 * MaxRtrAdvInterval @@ -1532,7 +1532,7 @@ int config_parse_interface(void *data, size_t len, const char *name, bool overwr if ((c = tb[IFACE_ATTR_RA_LIFETIME])){ uint32_t ra_lifetime = blobmsg_get_u32(c); if (ra_lifetime != 0){ - if (ra_lifetime < iface->ra_maxinterval) + if (ra_lifetime < iface->ra_maxinterval) ra_lifetime = iface->ra_maxinterval; // clamp min else if (ra_lifetime > AdvDefaultLifetime) ra_lifetime = AdvDefaultLifetime; // clamp max diff --git a/src/dhcpv6.c b/src/dhcpv6.c index cb9832e..2cbcbbc 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -775,7 +775,7 @@ static void handle_client_request(void *addr, void *data, size_t len, iov[IOV_DHCPV6_RAW].iov_len + iov[IOV_NTP].iov_len + iov[IOV_NTP_ADDR].iov_len + iov[IOV_SNTP].iov_len + iov[IOV_SNTP_ADDR].iov_len + - iov[IOV_POSIX_TZ].iov_len + iov[IOV_POSIX_TZ_STR].iov_len + + iov[IOV_POSIX_TZ].iov_len + iov[IOV_POSIX_TZ_STR].iov_len + iov[IOV_TZDB_TZ].iov_len + iov[IOV_TZDB_TZ_STR].iov_len + iov[IOV_DNR].iov_len + iov[IOV_BOOTFILE_URL].iov_len - (4 + opts_end - opts)); diff --git a/src/odhcpd.c b/src/odhcpd.c index a427dfe..df57a49 100644 --- a/src/odhcpd.c +++ b/src/odhcpd.c @@ -194,7 +194,7 @@ int main(int argc, char **argv) int odhcpd_get_interface_config(const char *ifname, const char *what) { char buf[64]; - + snprintf(buf, sizeof(buf), "/proc/sys/net/ipv6/conf/%s/%s", ifname, what); int fd = open(buf, O_RDONLY); diff --git a/src/router.c b/src/router.c index 1903eb4..a2e95a5 100644 --- a/src/router.c +++ b/src/router.c @@ -563,7 +563,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr size_t dns_sz = 0, search_sz = 0, pref64_sz = 0, dnrs_sz = 0; size_t pfxs_cnt = 0, routes_cnt = 0; size_t total_addr_cnt = 0, valid_addr_cnt = 0; - /* + /* * lowest_found_lifetime stores the lowest lifetime of all prefixes; * necessary to find longest adv interval necessary * for shortest lived prefix @@ -591,11 +591,11 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr adv.h.nd_ra_flags_reserved |= ND_RA_PREF_LOW; else if (iface->route_preference > 0) adv.h.nd_ra_flags_reserved |= ND_RA_PREF_HIGH; - + if (iface->dhcpv6 != MODE_DISABLED && iface->dhcpv6_pd && iface->dhcpv6_pd_preferred) { /* RFC9762 § 5 * If the network desires to delegate prefixes to devices that support - * DHCPv6 prefix delegation but do not support the P flag, it SHOULD + * DHCPv6 prefix delegation but do not support the P flag, it SHOULD * also set the M or O bits in the RA to 1 */ adv.h.nd_ra_flags_reserved |= ND_RA_FLAG_MANAGED; @@ -722,7 +722,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr } if (preferred_lt > valid_lt) { - /* + /* * RFC4861 § 6.2.1 * This value [AdvPreferredLifetime] MUST NOT be larger than * AdvValidLifetime. @@ -746,7 +746,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr p->nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION; p->nd_opt_pi_len = 4; p->nd_opt_pi_prefix_len = (addr->prefix < 64) ? 64 : addr->prefix; - /* RFC9762 DHCPv6-PD Preferred Flag § 6: + /* RFC9762 DHCPv6-PD Preferred Flag § 6: * Routers SHOULD set the P flag to zero by default... */ p->nd_opt_pi_flags_reserved = 0; @@ -758,7 +758,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr /* RFC9762 DHCPv6-PD Preferred Flag * We can run both SLAAC and DHCPv6-PD. * §6: - * "Routers MUST allow the P flag to be configured separately from the A flag. + * "Routers MUST allow the P flag to be configured separately from the A flag. * ...en/disabling the P flag MUST NOT trigger automatic changes in the A flag * value set by the router." */ @@ -767,7 +767,7 @@ static int send_router_advert(struct interface *iface, const struct in6_addr *fr // RFC6275, §7.2 p->nd_opt_pi_flags_reserved |= ND_OPT_PI_FLAG_RADDR; if (i >= valid_addr_cnt || !preferred_lt) { - /* + /* * RFC9096 § 3.5 * * - Any prefixes that were previously advertised by the CE router diff --git a/src/router.h b/src/router.h index 46c6387..9b028d1 100644 --- a/src/router.h +++ b/src/router.h @@ -66,11 +66,11 @@ struct icmpv6_opt { define is used to cap values to a sane ceiling, i.e. ND_VALID_LIMIT. */ #define RouterLifetime 5400 -/* RFC4861 §6.2.1 : AdvReachableTime : +/* RFC4861 §6.2.1 : AdvReachableTime : * MUST be no greater than 3,600,000 msec */ #define AdvReachableTime 3600000 -/* RFC4861 §6.2.1 : AdvCurHopLimit +/* RFC4861 §6.2.1 : AdvCurHopLimit The value should be set to the current diameter of the Internet. The value zero means unspecified (by this router). @@ -85,7 +85,7 @@ struct icmpv6_opt { #define RETRANS_TIMER_MAX 60000 /* RFC2460 §5 IPv6 requires that every link in the internet have an MTU of 1280 - octets or greater. + octets or greater. */ #define RA_MTU_MIN 1280 #define RA_MTU_MAX 65535 -- 2.30.2