Minor UDPv4 cleanup: capitalize comment, move statistics update after mbuf
free to be consistent with other error handling, and release socket buffer lock before freeing mbufs and statistics updates rather than after. Approved by: re (kensmith)
This commit is contained in:
parent
65ea29a690
commit
bd84d20457
@ -496,10 +496,10 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
|
||||
INP_LOCK_ASSERT(inp);
|
||||
|
||||
#ifdef IPSEC
|
||||
/* check AH/ESP integrity. */
|
||||
/* Check AH/ESP integrity. */
|
||||
if (ipsec4_in_reject(n, inp)) {
|
||||
ipsec4stat.in_polvio++;
|
||||
m_freem(n);
|
||||
ipsec4stat.in_polvio++;
|
||||
return;
|
||||
}
|
||||
#endif /* IPSEC */
|
||||
@ -538,11 +538,11 @@ udp_append(struct inpcb *inp, struct ip *ip, struct mbuf *n, int off,
|
||||
so = inp->inp_socket;
|
||||
SOCKBUF_LOCK(&so->so_rcv);
|
||||
if (sbappendaddr_locked(&so->so_rcv, append_sa, n, opts) == 0) {
|
||||
SOCKBUF_UNLOCK(&so->so_rcv);
|
||||
m_freem(n);
|
||||
if (opts)
|
||||
m_freem(opts);
|
||||
udpstat.udps_fullsock++;
|
||||
SOCKBUF_UNLOCK(&so->so_rcv);
|
||||
} else
|
||||
sorwakeup_locked(so);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user