Hi, Initially all inpcb, including the IPv6 ones, are hooked into the IPv4 hash. They cannot be used before bind(2) and then they are rehashed and rehooked, so this is not noticed. Nevertheless I think this is a bug and they should go into the IPv6 hash from the beginning.
ok? bluhm Index: netinet/in_pcb.c =================================================================== RCS file: /data/mirror/openbsd/cvs/src/sys/netinet/in_pcb.c,v retrieving revision 1.218 diff -u -p -r1.218 in_pcb.c --- netinet/in_pcb.c 6 Mar 2017 08:59:07 -0000 1.218 +++ netinet/in_pcb.c 6 Mar 2017 23:08:43 -0000 @@ -276,8 +276,16 @@ in_pcballoc(struct socket *so, struct in TAILQ_INSERT_HEAD(&table->inpt_queue, inp, inp_queue); head = INPCBLHASH(table, inp->inp_lport, inp->inp_rtableid); LIST_INSERT_HEAD(head, inp, inp_lhash); - head = INPCBHASH(table, &inp->inp_faddr, inp->inp_fport, - &inp->inp_laddr, inp->inp_lport, rtable_l2(inp->inp_rtableid)); +#ifdef INET6 + if (sotopf(so) == PF_INET6) + head = IN6PCBHASH(table, &inp->inp_faddr6, inp->inp_fport, + &inp->inp_laddr6, inp->inp_lport, + rtable_l2(inp->inp_rtableid)); + else +#endif /* INET6 */ + head = INPCBHASH(table, &inp->inp_faddr, inp->inp_fport, + &inp->inp_laddr, inp->inp_lport, + rtable_l2(inp->inp_rtableid)); LIST_INSERT_HEAD(head, inp, inp_hash); splx(s); so->so_pcb = inp;