summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gre.c
diff options
context:
space:
mode:
authorbz <bz@FreeBSD.org>2006-01-21 10:44:34 +0000
committerbz <bz@FreeBSD.org>2006-01-21 10:44:34 +0000
commit6d9ab80fce79d4befb78b6264b0cfe789cdeac58 (patch)
tree6592dbe525d1fa703ba65343df6cd7f697d18423 /sys/net/if_gre.c
parent0da5dd341ca939cb09f09ca6e0b9d4b978a60690 (diff)
downloadFreeBSD-src-6d9ab80fce79d4befb78b6264b0cfe789cdeac58.zip
FreeBSD-src-6d9ab80fce79d4befb78b6264b0cfe789cdeac58.tar.gz
Fix stack corruptions on amd64.
Vararg functions have a different calling convention than regular functions on amd64. Casting a varag function to a regular one to match the function pointer declaration will hide the varargs from the caller and we will end up with an incorrectly setup stack. Entirely remove the varargs from these functions and change the functions to match the declaration of the function pointers. Remove the now unnecessary casts. Lots of explanations and help from: peter Reviewed by: peter PR: amd64/89261 MFC after: 6 days
Diffstat (limited to 'sys/net/if_gre.c')
-rw-r--r--sys/net/if_gre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index f8165dc..4d48501 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -123,7 +123,7 @@ static const struct protosw in_gre_protosw = {
.pr_domain = &inetdomain,
.pr_protocol = IPPROTO_GRE,
.pr_flags = PR_ATOMIC|PR_ADDR,
- .pr_input = (pr_input_t *)gre_input,
+ .pr_input = gre_input,
.pr_output = (pr_output_t *)rip_output,
.pr_ctlinput = rip_ctlinput,
.pr_ctloutput = rip_ctloutput,
@@ -134,7 +134,7 @@ static const struct protosw in_mobile_protosw = {
.pr_domain = &inetdomain,
.pr_protocol = IPPROTO_MOBILE,
.pr_flags = PR_ATOMIC|PR_ADDR,
- .pr_input = (pr_input_t *)gre_mobile_input,
+ .pr_input = gre_mobile_input,
.pr_output = (pr_output_t *)rip_output,
.pr_ctlinput = rip_ctlinput,
.pr_ctloutput = rip_ctloutput,
OpenPOWER on IntegriCloud