/*
* Zero the list and put all but one on the free list
*/
- resfree = 0;
+ resfree = NULL;
memset((char *)resinit, 0, sizeof resinit);
- resfree6 = 0;
+ resfree6 = NULL;
memset((char *)resinit6, 0, sizeof resinit6);
for (i = 1; i < INITRESLIST; i++) {
resinit[i].next = resfree;
* Work our way down from there.
*/
match = restrictlist;
- for (rl = match->next; rl != 0 && rl->addr <= hostaddr;
+ for (rl = match->next; rl != NULL && rl->addr <= hostaddr;
rl = rl->next)
if ((hostaddr & rl->mask) == rl->addr) {
if ((rl->mflags & RESM_NTPONLY) &&
* Work our way down from there.
*/
match6 = restrictlist6;
- for (rl6 = match6->next; rl6 != 0 &&
+ for (rl6 = match6->next; rl6 != NULL &&
(memcmp(&(rl6->addr6), &hostaddr6,
sizeof(hostaddr6)) <= 0); rl6 = rl6->next) {
SET_IPV6_ADDR_MASK(&hostservaddr6, &hostaddr6,
* list. Else go searching for it.
*/
if (addr == 0) {
- rlprev = 0;
+ rlprev = NULL;
rl = restrictlist;
} else {
rlprev = restrictlist;
rl = rlprev->next;
- while (rl != 0) {
+ while (rl != NULL) {
if (rl->addr > addr) {
- rl = 0;
+ rl = NULL;
break;
} else if (rl->addr == addr) {
if (rl->mask == mask) {
if (!(mflags &
RESM_NTPONLY)) {
- rl = 0;
+ rl = NULL;
break;
}
} else if (rl->mask > mask) {
- rl = 0;
+ rl = NULL;
break;
}
}
} else {
rlprev6 = restrictlist6;
rl6 = rlprev6->next;
- while (rl6 != 0) {
+ while (rl6 != NULL) {
addr_cmp = memcmp(&rl6->addr6, &addr6,
sizeof(addr6));
if (addr_cmp > 0) {
- rl6 = 0;
+ rl6 = NULL;
break;
} else if (addr_cmp == 0) {
mask_cmp = memcmp(&rl6->mask6,
if (!(mflags &
RESM_NTPONLY)) {
- rl6 = 0;
+ rl6 = NULL;
break;
}
} else if (mask_cmp > 0) {
- rl6 = 0;
+ rl6 = NULL;
break;
}
}
* Here we add bits to the flags. If this is a
* new restriction add it.
*/
- if (rl == 0) {
- if (numresfree == 0) {
+ if (rl == NULL) {
+ if (resfree == NULL) {
rl = (struct restrictlist *)
emalloc(INCRESLIST *
sizeof(struct
* Remove some bits from the flags. If we didn't
* find this one, just return.
*/
- if (rl != 0) {
+ if (rl != NULL) {
if ((rl->flags ^ (u_short)flags) &
RES_LIMITED) {
res_limited_refcnt--;
* found one. Don't remove the default entry and
* don't remove an interface entry.
*/
- if (rl != 0
+ if (rl != NULL
&& rl->addr != htonl(INADDR_ANY)
&& !(rl->mflags & RESM_INTERFACE && op != RESTRICT_REMOVEIF)) {
if (rlprev != NULL) {
* Here we add bits to the flags. If this is a
* new restriction add it.
*/
- if (rl6 == 0) {
- if (numresfree6 == 0) {
+ if (rl6 == NULL) {
+ if (resfree6 == NULL) {
rl6 = (struct
restrictlist6 *)emalloc(
INCRESLIST * sizeof(struct
* Remove some bits from the flags. If we didn't
* find this one, just return.
*/
- if (rl6 != 0) {
+ if (rl6 != NULL) {
if ((rl6->flags ^ (u_short)flags) &
RES_LIMITED) {
res_limited_refcnt6--;
* found one. Don't remove the default entry and
* don't remove an interface entry.
*/
- if (rl6 != 0 &&
+ if (rl6 != NULL &&
!IN6_IS_ADDR_UNSPECIFIED(&rl6->addr6)
&& !(rl6->mflags & RESM_INTERFACE && op != RESTRICT_REMOVEIF)) {
if (rlprev6 != NULL) {