Skip to content

Commit

Permalink
Merge pull request #19 from marcosfrm/fix-port
Browse files Browse the repository at this point in the history
Fix listening port when the service is known by getservbyname()
  • Loading branch information
Andy2244 authored Nov 19, 2020
2 parents 3b2a6a4 + b5f435e commit e0cf50d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wsdd2.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ static int open_ep(struct endpoint **epp, struct service *sv,
};
struct servent *se = getservbyname(sv->port_name,
servicename[sv->type]);
ep->port = se ? se->s_port : 0;
ep->port = se ? ntohs(se->s_port) : 0;
if (!ep->port)
ep->port = sv->port_num;
if (!ep->port) {
Expand Down

0 comments on commit e0cf50d

Please sign in to comment.