if (!(f = fopen(fn, "w"))) {
daemon_log(LOG_ERR, "fopen() failed: %s", strerror(errno));
goto fail;
}
if (!(f = fopen(fn, "w"))) {
daemon_log(LOG_ERR, "fopen() failed: %s", strerror(errno));
goto fail;
}
fprintf(f, "%s\n", inet_ntop(AF_INET, &addr, buf, sizeof (buf)));
fclose(f);
fprintf(f, "%s\n", inet_ntop(AF_INET, &addr, buf, sizeof (buf)));
fclose(f);
sa.sll_halen = ETHER_ADDRLEN;
memset(sa.sll_addr, 0xFF, ETHER_ADDRLEN);
sa.sll_halen = ETHER_ADDRLEN;
memset(sa.sll_addr, 0xFF, ETHER_ADDRLEN);
- if (sendto(fd, packet, packet_len, 0, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
+ if (sendto(fd, packet->ether_payload, packet_len, 0, (struct sockaddr*) &sa, sizeof(sa)) < 0) {
- (ntohl(addr) & IPV4LL_NETMASK) == IPV4LL_NETWORK &&
- ntohl(addr) != IPV4LL_NETWORK &&
- ntohl(addr) != IPV4LL_BROADCAST;
+ ((ntohl(addr) & IPV4LL_NETMASK) == IPV4LL_NETWORK) &&
+ ((ntohl(addr) & 0x0000FF00) != 0x0000) &&
+ ((ntohl(addr) & 0x0000FF00) != 0xFF00);
callout_event_table[info.event],
name,
inet_ntop(AF_INET, &info.address, buf, sizeof(buf)), NULL) < 0) {
callout_event_table[info.event],
name,
inet_ntop(AF_INET, &info.address, buf, sizeof(buf)), NULL) < 0) {
load_address(address_fn, &addr);
if (addr && !is_ll_address(addr)) {
load_address(address_fn, &addr);
if (addr && !is_ll_address(addr)) {
- daemon_log(LOG_WARNING, "Requested address %s is not from IPv4LL range 169.254/16, ignoring.", inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
+ daemon_log(LOG_WARNING, "Requested address %s is not from IPv4LL range 169.254/16 or a reserved address, ignoring.", inet_ntop(AF_INET, &addr, buf, sizeof(buf)));
" -w --wait Wait until an address has been acquired before\n"
" daemonizing\n"
" --force-bind Assign an IPv4LL address even if a routable address\n"
" -w --wait Wait until an address has been acquired before\n"
" daemonizing\n"
" --force-bind Assign an IPv4LL address even if a routable address\n"
{ "check", no_argument, NULL, 'c' },
{ "version", no_argument, NULL, 'V' },
{ "start", required_argument, NULL, 'S' },
{ "check", no_argument, NULL, 'c' },
{ "version", no_argument, NULL, 'V' },
{ "start", required_argument, NULL, 'S' },
{ "wait", no_argument, NULL, 'w' },
{ "force-bind", no_argument, NULL, OPTION_FORCE_BIND },
{ "no-drop-root", no_argument, NULL, OPTION_NO_DROP_ROOT },
{ "wait", no_argument, NULL, 'w' },
{ "force-bind", no_argument, NULL, OPTION_FORCE_BIND },
{ "no-drop-root", no_argument, NULL, OPTION_NO_DROP_ROOT },
- opterr = 0;
- while ((c = getopt_long(argc, argv, "hDskrcVS:w", long_options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "hDskrcVS:t:w", long_options, NULL)) >= 0) {