summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/netinet/ip_divert.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/netinet/ip_divert.c b/sys/netinet/ip_divert.c
index 158a9e7..a509151 100644
--- a/sys/netinet/ip_divert.c
+++ b/sys/netinet/ip_divert.c
@@ -268,9 +268,9 @@ divert_packet(struct mbuf *m, int incoming)
nport = htons((u_int16_t)divert_info(mtag));
INP_INFO_RLOCK(&divcbinfo);
LIST_FOREACH(inp, &divcb, inp_list) {
- INP_RLOCK(inp);
/* XXX why does only one socket match? */
if (inp->inp_lport == nport) {
+ INP_RLOCK(inp);
sa = inp->inp_socket;
SOCKBUF_LOCK(&sa->so_rcv);
if (sbappendaddr_locked(&sa->so_rcv,
@@ -283,7 +283,6 @@ divert_packet(struct mbuf *m, int incoming)
INP_RUNLOCK(inp);
break;
}
- INP_RUNLOCK(inp);
}
INP_INFO_RUNLOCK(&divcbinfo);
if (sa == NULL) {
OpenPOWER on IntegriCloud