freebsd-ports/net/socat/files/patch-socat-servicenames
Pav Lucistnik 83521b52d0 - Incorporate Sainsbury's service name resolution patch:
http://www.dest-unreach.org/socat/contrib/socat-servicenames.html
- Incorporate Lucq's file descriptor patch:
  http://www.dest-unreach.org/socat/contrib/socat-maxfds.html

PR:		ports/113283
Submitted by:	bf <bf2006a@yahoo.com>
Approved by:	Nils Vogels <nivo@is-root.com> (maintainer)
2007-06-06 13:46:45 +00:00

31 lines
991 B
Text

--- xio-ip.c.orig Wed Mar 7 08:08:02 2007
+++ xio-ip.c Fri Apr 27 17:10:02 2007
@@ -144,7 +144,7 @@
with NIS), so we handle this specially */
if (service && isdigit(service[0]&0xff)) {
char *extra;
- port = strtoul(service, &extra, 0);
+ port = htons(strtoul(service, &extra, 0));
if (*extra != '\0') {
Warn2("xiogetaddrinfo(, \"%s\", ...): extra trailing data \"%s\"",
service, extra);
@@ -396,15 +396,16 @@
#if WITH_TCP || WITH_UDP
if (service) {
- port = parseport(service, family);
+ port = parseport(service, protocol);
+
}
if (port >= 0) {
switch (family) {
#if WITH_IP4
- case PF_INET: sau->ip4.sin_port = htons(port); break;
+ case PF_INET: sau->ip4.sin_port = port; break;
#endif /* WITH_IP4 */
#if WITH_IP6
- case PF_INET6: sau->ip6.sin6_port = htons(port); break;
+ case PF_INET6: sau->ip6.sin6_port = port; break;
#endif /* WITH_IP6 */
}
}