~ubuntu-branches/ubuntu/trusty/openvpn/trusty-security

« back to all changes in this revision

Viewing changes to socks.c

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-05-05 03:06:19 UTC
  • mfrom: (10.2.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100505030619-cwre0snhgx1mql53
Tags: 2.1.0-2ubuntu1
* Merge from debian unstable.  Remaining changes:
  + debian/openvpn.init.d:
    - Do not use start-stop-daemon and use </dev/null to avoid blocking boot
    - Show per-VPN result messages
    - Add "--script-security 2" by default for backwards compatablitiy
   + debian/control: Add lsb-base >= 3.2-14 to allow status_of_proc() 

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
 
175
175
  if (addr != NULL)
176
176
    {
177
 
      addr->sa.sin_family = AF_INET;
178
 
      addr->sa.sin_addr.s_addr = htonl (INADDR_ANY);
179
 
      addr->sa.sin_port = htons (0);
 
177
      addr->addr.in4.sin_family = AF_INET;
 
178
      addr->addr.in4.sin_addr.s_addr = htonl (INADDR_ANY);
 
179
      addr->addr.in4.sin_port = htons (0);
180
180
    }
181
181
 
182
182
  while (len < 4 + alen + 2)
263
263
  /* ATYP == 1 (IP V4 address) */
264
264
  if (atyp == '\x01' && addr != NULL)
265
265
    {
266
 
      memcpy (&addr->sa.sin_addr, buf + 4, sizeof (addr->sa.sin_addr));
267
 
      memcpy (&addr->sa.sin_port, buf + 8, sizeof (addr->sa.sin_port));
 
266
      memcpy (&addr->addr.in4.sin_addr, buf + 4, sizeof (addr->addr.in4.sin_addr));
 
267
      memcpy (&addr->addr.in4.sin_port, buf + 8, sizeof (addr->addr.in4.sin_port));
268
268
    }
269
269
 
270
270
 
382
382
  if (atyp != 1)                /* ATYP == 1 (IP V4) */
383
383
    goto error;
384
384
 
385
 
  buf_read (buf, &from->dest.sa.sin_addr, sizeof (from->dest.sa.sin_addr));
386
 
  buf_read (buf, &from->dest.sa.sin_port, sizeof (from->dest.sa.sin_port));
 
385
  buf_read (buf, &from->dest.addr.in4.sin_addr, sizeof (from->dest.addr.in4.sin_addr));
 
386
  buf_read (buf, &from->dest.addr.in4.sin_port, sizeof (from->dest.addr.in4.sin_port));
387
387
 
388
388
  return;
389
389
 
415
415
  buf_write_u16 (&head, 0);     /* RSV = 0 */
416
416
  buf_write_u8 (&head, 0);      /* FRAG = 0 */
417
417
  buf_write_u8 (&head, '\x01'); /* ATYP = 1 (IP V4) */
418
 
  buf_write (&head, &to->dest.sa.sin_addr, sizeof (to->dest.sa.sin_addr));
419
 
  buf_write (&head, &to->dest.sa.sin_port, sizeof (to->dest.sa.sin_port));
 
418
  buf_write (&head, &to->dest.addr.in4.sin_addr, sizeof (to->dest.addr.in4.sin_addr));
 
419
  buf_write (&head, &to->dest.addr.in4.sin_port, sizeof (to->dest.addr.in4.sin_port));
420
420
 
421
421
  return 10;
422
422
}