if (iface->dhcpv4_start.s_addr & htonl(0xffff0000) ||
iface->dhcpv4_end.s_addr & htonl(0xffff0000) ||
ntohl(iface->dhcpv4_start.s_addr) > ntohl(iface->dhcpv4_end.s_addr)) {
- syslog(LOG_ERR, "Invalid DHCP range for %s", iface->name);
+ syslog(LOG_WARNING, "Invalid DHCP range for %s", iface->name);
return -1;
}
if (!iface->addr4_len) {
- syslog(LOG_ERR, "No network(s) available on %s", iface->name);
+ syslog(LOG_WARNING, "No network(s) available on %s", iface->name);
return -1;
}
/* Don't allocate IP range for subnets bigger than 28 */
if (iface->addr4[0].prefix > 28) {
- syslog(LOG_ERR, "Auto allocation of DHCP range fails on %s", iface->name);
+ syslog(LOG_WARNING, "Auto allocation of DHCP range fails on %s", iface->name);
return -1;
}
a = list_first_entry(&iface->dhcpv4_fr_ips, struct odhcpd_ref_ip, head);
if (netlink_setup_addr(&a->addr, iface->ifindex, false, true)) {
- syslog(LOG_ERR, "Failed to add ip address on %s", iface->name);
+ syslog(LOG_WARNING, "Failed to add ip address on %s", iface->name);
return;
}
syslog(LOG_ERR, "Failed to send %s to %s - %s: %m", dhcpv4_msg_to_string(msg),
odhcpd_print_mac(a->hwaddr, sizeof(a->hwaddr)), inet_ntoa(dest.sin_addr));
else
- syslog(LOG_NOTICE, "Sent %s to %s - %s", dhcpv4_msg_to_string(msg),
+ syslog(LOG_DEBUG, "Sent %s to %s - %s", dhcpv4_msg_to_string(msg),
odhcpd_print_mac(a->hwaddr, sizeof(a->hwaddr)), inet_ntoa(dest.sin_addr));
}
req->op != DHCPV4_BOOTREQUEST || req->hlen != 6)
return;
- syslog(LOG_NOTICE, "Got DHCPv4 request on %s", iface->name);
+ syslog(LOG_DEBUG, "Got DHCPv4 request on %s", iface->name);
if (!iface->dhcpv4_start_ip.s_addr && !iface->dhcpv4_end_ip.s_addr) {
- syslog(LOG_ERR, "No DHCP range available on %s", iface->name);
+ syslog(LOG_WARNING, "No DHCP range available on %s", iface->name);
return;
}
req->ciaddr.s_addr = INADDR_ANY;
}
- syslog(LOG_NOTICE, "Received %s from %s on %s", dhcpv4_msg_to_string(reqmsg),
+ syslog(LOG_INFO, "Received %s from %s on %s", dhcpv4_msg_to_string(reqmsg),
odhcpd_print_mac(req->chaddr, req->hlen), iface->name);
#ifdef WITH_UBUS
"ff:ff:ff:ff:ff:ff": odhcpd_print_mac(req->chaddr, req->hlen),
inet_ntoa(dest.sin_addr));
else
- syslog(LOG_NOTICE, "Sent %s to %s - %s",
+ syslog(LOG_DEBUG, "Sent %s to %s - %s",
dhcpv4_msg_to_string(msg),
dest.sin_addr.s_addr == INADDR_BROADCAST ?
"ff:ff:ff:ff:ff:ff": odhcpd_print_mac(req->chaddr, req->hlen),
a, a->addr);
if (assigned)
- syslog(LOG_INFO, "Assigning static IP: %s", ip4toa(a->addr));
+ syslog(LOG_DEBUG, "Assigning static IP: %s", ip4toa(a->addr));
return assigned;
}
a, raddr);
if (assigned) {
- syslog(LOG_INFO, "Assigning the IP the client asked for: %s",
+ syslog(LOG_DEBUG, "Assigning the IP the client asked for: %s",
ip4toa(a->addr));
return true;
a, n_try);
if (assigned) {
- syslog(LOG_INFO, "Assigning mapped IP: %s (try %u of %u)",
+ syslog(LOG_DEBUG, "Assigning mapped IP: %s (try %u of %u)",
ip4toa(a->addr), i + 1, count);
return true;
}
}
- syslog(LOG_WARNING, "Can't assign any IP address -> address space is full");
+ syslog(LOG_NOTICE, "Can't assign any IP address -> address space is full");
+
return false;
}
/* Create new binding */
a = alloc_assignment(0);
if (!a) {
- syslog(LOG_ERR, "Failed to alloc assignment on interface %s",
- iface->ifname);
+ syslog(LOG_WARNING, "Failed to alloc assignment on interface %s",
+ iface->ifname);
return NULL;
}
memcpy(a->hwaddr, mac, sizeof(a->hwaddr));
border = alloc_assignment(0);
if (!border) {
- syslog(LOG_ERR, "Failed to alloc border on %s", iface->name);
+ syslog(LOG_WARNING, "Failed to alloc border on %s", iface->name);
return -1;
}
dhcpv6_ia_enum_addrs(iface, a, now, dhcpv6_log_ia_addr, &ctxt);
}
- syslog(LOG_NOTICE, "DHCPV6 %s %s from %s on %s: %s %s", type, (is_pd) ? "IA_PD" : "IA_NA",
- duidbuf, iface->name, status, leasebuf);
+ syslog(LOG_INFO, "DHCPV6 %s %s from %s on %s: %s %s", type, (is_pd) ? "IA_PD" : "IA_NA",
+ duidbuf, iface->name, status, leasebuf);
}
static bool dhcpv6_ia_on_link(const struct dhcpv6_ia_hdr *ia, struct dhcp_assignment *a,
if (len < sizeof(*hdr))
return;
- syslog(LOG_NOTICE, "Got a DHCPv6-request on %s", iface->name);
+ syslog(LOG_DEBUG, "Got a DHCPv6-request on %s", iface->name);
/* Construct reply message */
struct __attribute__((packed)) {
iov[IOV_CERID].iov_len + iov[IOV_DHCPV6_RAW].iov_len -
(4 + opts_end - opts));
- syslog(LOG_NOTICE, "Sending a DHCPv6-%s on %s", iov[IOV_NESTED].iov_len ? "relay-reply" : "reply", iface->name);
+ syslog(LOG_DEBUG, "Sending a DHCPv6-%s on %s", iov[IOV_NESTED].iov_len ? "relay-reply" : "reply", iface->name);
odhcpd_send(iface->dhcpv6_event.uloop.fd, addr, iov, ARRAY_SIZE(iov), iface);
}
/* Relay DHCPv6 reply from server to client */
struct dhcpv6_relay_header *h = (void*)data;
- syslog(LOG_NOTICE, "Got a DHCPv6-relay-reply");
+ syslog(LOG_DEBUG, "Got a DHCPv6-relay-reply");
if (len < sizeof(*h) || h->msg_type != DHCPV6_MSG_RELAY_REPL)
return;
struct iovec iov = {payload_data, payload_len};
- syslog(LOG_NOTICE, "Sending a DHCPv6-reply on %s", iface->name);
+ syslog(LOG_DEBUG, "Sending a DHCPv6-reply on %s", iface->name);
odhcpd_send(iface->dhcpv6_event.uloop.fd, &target, &iov, 1, iface);
}
h->msg_type == DHCPV6_MSG_ADVERTISE)
return; /* Invalid message types for client */
- syslog(LOG_NOTICE, "Got a DHCPv6-request on %s", iface->name);
+ syslog(LOG_DEBUG, "Got a DHCPv6-request on %s", iface->name);
if (h->msg_type == DHCPV6_MSG_RELAY_FORW) { /* handle relay-forward */
if (h->hop_count >= DHCPV6_HOP_COUNT_LIMIT)
ip = NULL;
}
- syslog(LOG_NOTICE, "Sending a DHCPv6-relay-forward on %s", c->name);
+ syslog(LOG_DEBUG, "Sending a DHCPv6-relay-forward on %s", c->name);
odhcpd_send(c->dhcpv6_event.uloop.fd, &s, iov, 2, c);
}
char ipbuf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, addr, ipbuf, sizeof(ipbuf));
- syslog(LOG_NOTICE, "Pinging for %s on %s", ipbuf, iface->name);
+ syslog(LOG_DEBUG, "Pinging for %s on %s", ipbuf, iface->name);
netlink_setup_route(addr, 128, iface->ifindex, NULL, 128, true);
odhcpd_send(iface->ndp_ping_fd, &dest, &iov, 1, iface);
char ipbuf[INET6_ADDRSTRLEN];
inet_ntop(AF_INET6, addr, ipbuf, sizeof(ipbuf));
- syslog(LOG_NOTICE, "%s about %s%s on %s",
+ syslog(LOG_DEBUG, "%s about %s%s on %s",
(add) ? "Learning" : "Forgetting",
iface->learn_routes ? "proxy routing for " : "",
ipbuf, iface->name);
} else
adv.h.nd_ra_router_lifetime = 0;
- syslog(LOG_INFO, "Using a RA lifetime of %d seconds on %s", ntohs(adv.h.nd_ra_router_lifetime), iface->name);
+ syslog(LOG_DEBUG, "Using a RA lifetime of %d seconds on %s", ntohs(adv.h.nd_ra_router_lifetime), iface->name);
/* DNS options */
if (iface->ra_dns) {