diff options
author | mav <mav@FreeBSD.org> | 2008-07-28 06:57:28 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2008-07-28 06:57:28 +0000 |
commit | ac42a1aad0451fd2e73c72a603f00009e3f1838a (patch) | |
tree | 32e8ab6233f82289e18ef6d1c5f54fddac398b45 /sys/netinet/raw_ip.c | |
parent | 88e89bb2e1055b6b23e5ed7d929ac8138bf91cfe (diff) | |
download | FreeBSD-src-ac42a1aad0451fd2e73c72a603f00009e3f1838a.zip FreeBSD-src-ac42a1aad0451fd2e73c72a603f00009e3f1838a.tar.gz |
Some style and assertion fixes to the previous commits hinted by rwatson.
There is no functional changes.
Diffstat (limited to 'sys/netinet/raw_ip.c')
-rw-r--r-- | sys/netinet/raw_ip.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c index ebb8408..26718ef 100644 --- a/sys/netinet/raw_ip.c +++ b/sys/netinet/raw_ip.c @@ -126,12 +126,13 @@ rip_inshash(struct inpcb *inp) INP_INFO_WLOCK_ASSERT(pcbinfo); INP_WLOCK_ASSERT(inp); - if (inp->inp_ip_p && inp->inp_laddr.s_addr && inp->inp_faddr.s_addr) { + if (inp->inp_ip_p != 0 && + inp->inp_laddr.s_addr != INADDR_ANY && + inp->inp_faddr.s_addr != INADDR_ANY) { hash = INP_PCBHASH_RAW(inp->inp_ip_p, inp->inp_laddr.s_addr, inp->inp_faddr.s_addr, pcbinfo->ipi_hashmask); - } else { + } else hash = 0; - } pcbhash = &pcbinfo->ipi_hashbase[hash]; LIST_INSERT_HEAD(pcbhash, inp, inp_hash); } @@ -139,7 +140,10 @@ rip_inshash(struct inpcb *inp) static void rip_delhash(struct inpcb *inp) { + + INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); INP_WLOCK_ASSERT(inp); + LIST_REMOVE(inp, inp_hash); } @@ -708,6 +712,8 @@ rip_detach(struct socket *so) static void rip_dodisconnect(struct socket *so, struct inpcb *inp) { + + INP_INFO_WLOCK_ASSERT(inp->inp_pcbinfo); INP_WLOCK_ASSERT(inp); rip_delhash(inp); |