Skip to content

Commit

Permalink
clarified how to use notify and notify2
Browse files Browse the repository at this point in the history
  • Loading branch information
jinmei committed Dec 24, 1999
1 parent 4a1aa58 commit e2df8a6
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions kame/sys/netinet6/in6_pcb.c
Expand Up @@ -861,7 +861,7 @@ in6_pcbnotify(head, dst, fport_arg, laddr6, lport_arg, cmd, notify)
notify = in6_rtchange;
}

if (notify == NULL && notify2 == NULL)
if (notify == NULL)
return 0;

errno = inet6ctlerrmap[cmd];
Expand All @@ -880,21 +880,23 @@ in6_pcbnotify(head, dst, fport_arg, laddr6, lport_arg, cmd, notify)
&faddr6))
in6_rtchange(in6p, errno);

if (notify2 != NULL)
if (notify2 == NULL)
continue;

notify = notify2;
}

/* at this point, we can assume that NOTIFY is not NULL. */

if (!IN6_ARE_ADDR_EQUAL(&in6p->in6p_faddr, &faddr6) ||
in6p->in6p_socket == 0 ||
(lport && in6p->in6p_lport != lport) ||
(!IN6_IS_ADDR_UNSPECIFIED(laddr6) &&
!IN6_ARE_ADDR_EQUAL(&in6p->in6p_laddr, laddr6)) ||
(fport && in6p->in6p_fport != fport)) {
in6p = in6p->in6p_next;
(fport && in6p->in6p_fport != fport))
continue;
}
if (notify2)
(*notify2)(in6p, errno);

(*notify)(in6p, errno);
nmatch++;
}
return nmatch;
Expand Down

0 comments on commit e2df8a6

Please sign in to comment.