nl_socket_modify_cb(rtnl_event.sock, NL_CB_VALID, NL_CB_CUSTOM,
cb_rtnl_valid, NULL);
- // Receive IPv4 address, IPv6 address, IPv6 routes and neighbor events
+ /* Receive IPv4 address, IPv6 address, IPv6 routes and neighbor events */
if (nl_socket_add_memberships(rtnl_event.sock, RTNLGRP_IPV4_IFADDR,
RTNLGRP_IPV6_IFADDR, RTNLGRP_IPV6_ROUTE,
RTNLGRP_NEIGH, RTNLGRP_LINK, 0))
free(event_info->addrs_old.addrs);
}
-// Handler for neighbor cache entries from the kernel. This is our source
-// to learn and unlearn hosts on interfaces.
+/* Handler for neighbor cache entries from the kernel. This is our source
+ * to learn and unlearn hosts on interfaces. */
static int cb_rtnl_valid(struct nl_msg *msg, _unused void *arg)
{
struct nlmsghdr *hdr = nlmsg_hdr(msg);
event_info.rt.dst_len = rtm->rtm_dst_len;
if (nla[RTA_DST])
nla_memcpy(&event_info.rt.dst, nla[RTA_DST],
- sizeof(&event_info.rt.dst));
+ sizeof(event_info.rt.dst));
if (nla[RTA_OIF])
event_info.iface = odhcpd_get_interface_by_index(nla_get_u32(nla[RTA_OIF]));
if (nla[RTA_GATEWAY])
nla_memcpy(&event_info.rt.gateway, nla[RTA_GATEWAY],
- sizeof(&event_info.rt.gateway));
+ sizeof(event_info.rt.gateway));
call_netevent_handler_list(add ? NETEV_ROUTE6_ADD : NETEV_ROUTE6_DEL,
&event_info);
}
-// compare IPv6 prefixes
+/* compare IPv6 prefixes */
static int prefix6_cmp(const void *va, const void *vb)
{
const struct odhcpd_ipaddr *a = va, *b = vb;
}
-// Detect an IPV6-address currently assigned to the given interface
+/* Detect an IPV6-address currently assigned to the given interface */
ssize_t netlink_get_interface_addrs(int ifindex, bool v6, struct odhcpd_ipaddr **addrs)
{
struct nl_msg *msg;