pr_ctlinput is usually called when certains types of ICMP packets are received.
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 27 Oct 2008 02:56:30 +0000 (02:56 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Mon, 27 Oct 2008 02:56:30 +0000 (02:56 +0000)
commite3873585948cb37ee0b19d25ab9dafc4ffe43a1a
tree5b03ef8b8f60b8393e389a05b41602542bced797
parent3afa53bcee9f34df242a2dbe47f61e71ffa4a707
pr_ctlinput is usually called when certains types of ICMP packets are received.
However, the processing of ICMP packets happens in netisr0, which means the
thread context, in which pr_ctlinput is called, is not correct.  To handle this
following two fixes are applied:
- Add pr_ctlport to protosw and ip6protosw, which could be used to locate
  correct msgport to call pr_ctlinput for specific protocol
- All necessary information needed by pr_ctlinput are gather into one netmsg,
  and this netmsg is delivered synchronously (some information is on the stack)

Note for new protocol implementation:
pr_ctlinput and pr_ctlport should be both NULL or both non-NULL.

Obtained-from: dillon@
Tested-by: pavalos@
21 files changed:
sys/kern/uipc_domain.c
sys/kern/uipc_msg.c
sys/kern/uipc_proto.c
sys/net/gre/if_gre.c
sys/net/netisr.c
sys/net/netisr.h
sys/net/netmsg.h
sys/net/rtsock.c
sys/net/stf/if_stf.c
sys/netinet/in_gif.c
sys/netinet/in_proto.c
sys/netinet/ip_demux.c
sys/netinet/ip_icmp.c
sys/netinet/tcp_var.h
sys/netinet/udp_var.h
sys/netinet6/icmp6.c
sys/netinet6/in6_gif.c
sys/netinet6/in6_proto.c
sys/netinet6/ip6protosw.h
sys/sys/protosw.h
sys/sys/socketops.h