-/* $OpenBSD: dhclient.c,v 1.376 2016/07/20 19:40:04 deraadt Exp $ */
+/* $OpenBSD: dhclient.c,v 1.377 2016/07/21 09:58:55 krw Exp $ */
/*
* Copyright 2004 Henning Brauer <henning@openbsd.org>
if (client->active->expiry <= cur_time)
client->active = NULL;
else if (addressinuse(client->active->address, ifname) &&
- strncmp(ifname, ifi->name, IF_NAMESIZE))
+ strncmp(ifname, ifi->name, IF_NAMESIZE) != 0)
client->active = NULL;
}
/* Run through the list of leases and see if one can be used. */
TAILQ_FOREACH(lp, &client->leases, next) {
if (addressinuse(lp->address, ifname) &&
- strncmp(ifname, ifi->name, IF_NAMESIZE))
+ strncmp(ifname, ifi->name, IF_NAMESIZE) != 0)
continue;
if (client->active || lp->is_static)
break;
if (memcmp(&address, &sin->sin_addr, sizeof(address)) == 0) {
strlcpy(ifname, ifa->ifa_name, IF_NAMESIZE);
used = 1;
- if (strncmp(ifname, ifi->name, IF_NAMESIZE))
+ if (strncmp(ifname, ifi->name, IF_NAMESIZE) != 0)
break;
}
}
if (options[i].len == 0)
continue;
if (!unknown_ok && strncmp("option-",
- dhcp_options[i].name, 7)) {
+ dhcp_options[i].name, 7) != 0) {
warning("dhcpoffer: unknown option %d", i);
lease->is_invalid = 1;
}
lease->address.s_addr = client->packet.yiaddr.s_addr;
memset(ifname, 0, sizeof(ifname));
if (addressinuse(lease->address, ifname) &&
- strncmp(ifname, ifi->name, IF_NAMESIZE)) {
+ strncmp(ifname, ifi->name, IF_NAMESIZE) != 0) {
warning("%s already configured on %s",
inet_ntoa(lease->address), ifname);
lease->is_invalid = 1;
time(&cur_time);
TAILQ_FOREACH(lp, &client->leases, next) {
if (addressinuse(lp->address, ifname) &&
- strncmp(ifname, ifi->name, IF_NAMESIZE))
+ strncmp(ifname, ifi->name, IF_NAMESIZE) != 0)
continue;
if (lp->is_static) {
set_lease_times(lp);
struct ifg_req *ifg;
int s, len;
- if (!strcmp(arg, "egress")) {
+ if (strcmp(arg, "egress") == 0) {
s = socket(AF_INET, SOCK_DGRAM, 0);
if (s == -1)
error("socket error");
if (active->server_name != new->server_name) {
if (!active->server_name || !new->server_name)
return (1);
- if (strcmp(active->server_name, new->server_name))
+ if (strcmp(active->server_name, new->server_name) != 0)
return (1);
}
if (active->filename != new->filename) {
if (!active->filename || !new->filename)
return (1);
- if (strcmp(active->filename, new->filename))
+ if (strcmp(active->filename, new->filename) != 0)
return (1);
}
-/* $OpenBSD: kroute.c,v 1.79 2016/02/06 19:30:52 krw Exp $ */
+/* $OpenBSD: kroute.c,v 1.80 2016/07/21 09:58:55 krw Exp $ */
/*
* Copyright 2012 Kenneth R Westerback <krw@openbsd.org>
(ifa->ifa_flags & IFF_POINTOPOINT) ||
(!(ifa->ifa_flags & IFF_UP)) ||
(ifa->ifa_addr->sa_family != AF_INET) ||
- (strcmp(ifi->name, ifa->ifa_name)))
+ (strcmp(ifi->name, ifa->ifa_name) != 0))
continue;
memcpy(&addr, &((struct sockaddr_in *)ifa->ifa_addr)->sin_addr,
if (!label)
return (ROUTE_LABEL_NONE);
- if (strncmp("DHCLIENT ", label->sr_label, 9))
+ if (strncmp("DHCLIENT ", label->sr_label, 9) != 0)
return (ROUTE_LABEL_NOT_DHCLIENT);
pid = (pid_t)strtonum(label->sr_label + 9, 1, INT_MAX, NULL);