Skip to content

Commit

Permalink
- added some comments
Browse files Browse the repository at this point in the history
- removed an unnecesary code
  • Loading branch information
suz committed May 4, 2007
1 parent 6484505 commit 53bec60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
9 changes: 7 additions & 2 deletions kame/sys/netinet6/nd6.c
@@ -1,4 +1,4 @@
/* $KAME: nd6.c,v 1.400 2007/05/04 01:43:28 suz Exp $ */ /* $KAME: nd6.c,v 1.401 2007/05/04 04:48:52 suz Exp $ */


/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -2147,6 +2147,12 @@ nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code)


if (ln->ln_hold) { if (ln->ln_hold) {
struct mbuf *m_hold, *m_hold_next; struct mbuf *m_hold, *m_hold_next;

/*
* reset the ln_hold in advance, to explicitly
* prevent a ln_hold lookup in nd6_output()
* (wouldn't happen, though...)
*/
for (m_hold = ln->ln_hold, ln->ln_hold = NULL; for (m_hold = ln->ln_hold, ln->ln_hold = NULL;
m_hold; m_hold = m_hold_next) { m_hold; m_hold = m_hold_next) {
m_hold_next = m_hold->m_nextpkt; m_hold_next = m_hold->m_nextpkt;
Expand All @@ -2161,7 +2167,6 @@ nd6_cache_lladdr(ifp, from, lladdr, lladdrlen, type, code)
(struct sockaddr_in6 *)rt_key(rt), (struct sockaddr_in6 *)rt_key(rt),
rt); rt);
} }
ln->ln_hold = NULL;
} }
} else if (ln->ln_state == ND6_LLINFO_INCOMPLETE) { } else if (ln->ln_state == ND6_LLINFO_INCOMPLETE) {
/* probe right away */ /* probe right away */
Expand Down
6 changes: 5 additions & 1 deletion kame/sys/netinet6/nd6_nbr.c
@@ -1,4 +1,4 @@
/* $KAME: nd6_nbr.c,v 1.172 2007/05/04 01:43:28 suz Exp $ */ /* $KAME: nd6_nbr.c,v 1.173 2007/05/04 04:48:52 suz Exp $ */


/* /*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -927,6 +927,10 @@ nd6_na_input(m, off, icmp6len)
if (ln->ln_hold) { if (ln->ln_hold) {
struct mbuf *m_hold, *m_hold_next; struct mbuf *m_hold, *m_hold_next;


/*
* reset the ln_hold in advance, to explicitly prevent a
* ln_hold lookup in nd6_output() (wouldn't happen, though...)
*/
for (m_hold = ln->ln_hold, ln->ln_hold = NULL; for (m_hold = ln->ln_hold, ln->ln_hold = NULL;
m_hold; m_hold = m_hold_next) { m_hold; m_hold = m_hold_next) {
m_hold_next = m_hold->m_nextpkt; m_hold_next = m_hold->m_nextpkt;
Expand Down

0 comments on commit 53bec60

Please sign in to comment.