netcat-openbsd/get-sev-by-name.patch
Tomáš Chvátal ffb1f958b4 Accepting request 648974 from home:scarabeus_iv:branches:network:utilities
- Update to 1.195 release matching with debian
- Added new patches:
  * broadcast-support.patch
  * build-without-TLS-support.patch
  * destination-port-list.patch
  * use-flags-to-specify-listen-address.patch
- Refreshed patches:
  * connect-timeout.patch
  * dccp-support.patch
  * get-sev-by-name.patch
  * misc-failures-and-features.patch
  * port-to-linux-with-libsd.patch
  * quit-timer.patch
  * send-crlf.patch
  * serialized-handling-multiple-clients.patch
  * set-TCP-MD5SIG-correctly-for-client-connections.patch
  * udp-scan-timeout.patch
  * verbose-numeric-port.patch
- Drop patch compile-without-TLS-support.patch, renamed

OBS-URL: https://build.opensuse.org/request/show/648974
OBS-URL: https://build.opensuse.org/package/show/network:utilities/netcat-openbsd?expand=0&rev=18
2018-11-14 13:18:05 +00:00

29 lines
610 B
Diff

From: Aron Xu <aron@debian.org>
Date: Mon, 13 Feb 2012 14:45:08 +0800
Subject: get sev by name
---
netcat.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
--- a/netcat.c
+++ b/netcat.c
@@ -1653,11 +1653,16 @@ strtoport(char *portstr, int udp)
void
build_ports(char *p)
{
+ struct servent *sv;
char *n;
int hi, lo, cp;
int x = 0;
- if ((n = strchr(p, '-')) != NULL) {
+ sv = getservbyname(p, uflag ? "udp" : "tcp");
+ if (sv) {
+ if (asprintf(&portlist[0], "%d", ntohs(sv->s_port)) < 0)
+ err(1, "asprintf");
+ } else if ((n = strchr(p, '-')) != NULL) {
*n = '\0';
n++;