~ubuntu-branches/ubuntu/breezy/vpnc/breezy

« back to all changes in this revision

Viewing changes to sysdep-bsd.c

  • Committer: Bazaar Package Importer
  • Author(s): Søren Hansen
  • Date: 2005-09-20 22:52:41 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050920225241-sdtmrhk0xw7k5mcv
Tags: 0.3.3-0ubuntu2
Fixed reference to vpnc-script

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
                if (strncmp(dev, "tun", 3))
46
46
                        error(1, 0,
47
47
                                "error: arbitrary naming tunnel interface only supported on linux\n");
48
 
                sprintf(tunname, "/dev/%s", dev);
 
48
                snprintf(tunname, sizeof(tunname), "/dev/%s", dev);
49
49
                return open(tunname, O_RDWR);
50
50
        }
51
51
 
52
52
        for (i = 0; i < 255; i++) {
53
 
                sprintf(tunname, "/dev/tun%d", i);
 
53
                snprintf(tunname, sizeof(tunname), "/dev/tun%d", i);
54
54
                /* Open device */
55
55
                if ((fd = open(tunname, O_RDWR)) > 0) {
56
 
                        sprintf(dev, "tun%d", i);
 
56
                        snprintf(dev, IFNAMSIZ, "tun%d", i);
57
57
                        return fd;
58
58
                }
59
59
        }
131
131
/***********************************************************************/
132
132
/* other support functions */
133
133
 
134
 
const char *sysdep_config_script(void)
135
 
{
136
 
        return "ifconfig $TUNDEV inet $INTERNAL_IP4_ADDRESS $INTERNAL_IP4_ADDRESS netmask 255.255.255.255 mtu 1412 up";
137
 
}
138
 
 
139
134
void error(int status, int errornum, const char *fmt, ...)
140
135
{
141
136
        char *buf2;