summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcloder <cloder@openbsd.org>2005-03-29 04:51:21 +0000
committercloder <cloder@openbsd.org>2005-03-29 04:51:21 +0000
commit33b724219ec3d8da603da6f50c97d9e94f8bc96e (patch)
treea78e6cc471073f815a5c010aad038d153818c30d
parentallow cmd_options to be NULL, so that commands which (diff)
downloadwireguard-openbsd-33b724219ec3d8da603da6f50c97d9e94f8bc96e.tar.xz
wireguard-openbsd-33b724219ec3d8da603da6f50c97d9e94f8bc96e.zip
Always use network byte order when stuffing port numbers into IPSEC ID
packets. This reinstates the correct part of r1.106 which did ntohs incorrectly on received port numbers already in host byte order. OK ho@
-rw-r--r--sbin/isakmpd/ipsec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/isakmpd/ipsec.c b/sbin/isakmpd/ipsec.c
index 8384fa67fc8..220a7aabe41 100644
--- a/sbin/isakmpd/ipsec.c
+++ b/sbin/isakmpd/ipsec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec.c,v 1.107 2005/03/18 17:27:39 cloder Exp $ */
+/* $OpenBSD: ipsec.c,v 1.108 2005/03/29 04:51:21 cloder Exp $ */
/* $EOM: ipsec.c,v 1.143 2000/12/11 23:57:42 niklas Exp $ */
/*
@@ -1812,7 +1812,7 @@ ipsec_get_proto_port(char *section, u_int8_t *tproto, u_int16_t *port)
pstr = conf_get_str(section, "Port");
if (!pstr)
return 0;
- *port = (u_int16_t)atoi(pstr);
+ *port = htons((u_int16_t)atoi(pstr));
if (!*port) {
se = getservbyname(pstr,
pe ? pe->p_name : (pstr ? pstr : NULL));