~ubuntu-branches/ubuntu/trusty/netpipe/trusty

« back to all changes in this revision

Viewing changes to src/tcp.c

  • Committer: Bazaar Package Importer
  • Author(s): Camm Maguire
  • Date: 2010-01-06 19:07:32 UTC
  • mfrom: (4.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100106190732-fg9urgk31weolrcs
Tags: 3.7.1-1
* New upstream release
* Bug fix: "debian/watch fails to report upstream's version", thanks
  to Raphael Geissert (Closes: #450010).

Show diffs side-by-side

added added

removed removed

Lines of Context:
111
111
 struct hostent *addr;
112
112
 struct protoent *proto;
113
113
 int send_size, recv_size, sizeofint = sizeof(int);
 
114
 int socket_family = AF_INET;
114
115
 
115
116
 
116
117
 host = p->host;                           /* copy ptr to hostname */ 
117
118
 
 
119
 if (p->use_sdp){
 
120
         printf("Using AF_INET_SDP (27) socket family\n");
 
121
         socket_family = 27;
 
122
 }
 
123
 
118
124
 lsin1 = &(p->prot.sin1);
119
125
 lsin2 = &(p->prot.sin2);
120
126
 
121
127
 bzero((char *) lsin1, sizeof(*lsin1));
122
128
 bzero((char *) lsin2, sizeof(*lsin2));
123
129
 
124
 
 if ( (sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0){
 
130
 if ( (sockfd = socket(socket_family, SOCK_STREAM, 0)) < 0){ 
125
131
   printf("NetPIPE: can't open stream socket! errno=%d\n", errno);
126
132
   exit(-4);
127
133
 }