if (-1 == ioctl (fd, TUNSETIFF, (void *) &ifr))
{
- fprintf (stderr, "Error with ioctl on `%s': %s\n", "/dev/net/tun",
+ fprintf (stderr,
+ "Error with ioctl on `%s': %s\n",
+ "/dev/net/tun",
strerror (errno));
(void) close (fd);
return -1;
sa6.sin6_family = AF_INET6;
if (1 != inet_pton (AF_INET6, address, sa6.sin6_addr.s6_addr))
{
- fprintf (stderr, "Failed to parse address `%s': %s\n", address,
- strerror (errno));
+ fprintf (stderr,
+ "Failed to parse IPv6 address `%s'\n",
+ address);
exit (1);
}
if (-1 == (fd = socket (PF_INET6, SOCK_DGRAM, 0)))
{
- fprintf (stderr, "Error creating socket: %s\n", strerror (errno));
+ fprintf (stderr,
+ "Error creating socket: %s\n",
+ strerror (errno));
exit (1);
}
*/
if (1 != inet_pton (AF_INET, address, &addr->sin_addr.s_addr))
{
- fprintf (stderr, "Failed to parse address `%s': %s\n", address,
- strerror (errno));
+ fprintf (stderr,
+ "Failed to parse IPv4 address `%s'\n",
+ address);
exit (1);
}
if (-1 == (fd = socket (PF_INET, SOCK_DGRAM, 0)))
{
- fprintf (stderr, "Error creating socket: %s\n", strerror (errno));
+ fprintf (stderr,
+ "Error creating socket: %s\n",
+ strerror (errno));
exit (1);
}
*/
if (-1 == ioctl (fd, SIOCSIFADDR, &ifr))
{
- fprintf (stderr, "ioctl failed at %d: %s\n", __LINE__, strerror (errno));
+ fprintf (stderr,
+ "ioctl failed at %d: %s\n",
+ __LINE__,
+ strerror (errno));
(void) close (fd);
exit (1);
}
addr = (struct sockaddr_in *) &(ifr.ifr_netmask);
if (1 != inet_pton (AF_INET, mask, &addr->sin_addr.s_addr))
{
- fprintf (stderr, "Failed to parse address `%s': %s\n", mask,
- strerror (errno));
+ fprintf (stderr,
+ "Failed to parse IPv4 address mask `%s'\n",
+ mask);
(void) close (fd);
exit (1);
}
*/
if (-1 == ioctl (fd, SIOCSIFNETMASK, &ifr))
{
- fprintf (stderr, "ioctl failed at line %d: %s\n", __LINE__,
+ fprintf (stderr,
+ "ioctl failed at line %d: %s\n",
+ __LINE__,
strerror (errno));
(void) close (fd);
exit (1);
return;
}
ts->channel = GNUNET_CADET_channel_create (cadet_handle,
- ts,
- id,
- apptype,
- GNUNET_CADET_OPTION_DEFAULT);
+ ts,
+ id,
+ apptype,
+ GNUNET_CADET_OPTION_DEFAULT);
}
ts->heap_node,
GNUNET_TIME_absolute_get ().abs_value_us);
}
- GNUNET_assert (NULL != ts->channel);
+ if (NULL == ts->channel)
+ {
+ GNUNET_STATISTICS_update (stats,
+ gettext_noop ("# Packets dropped (channel not yet online)"),
+ 1,
+ GNUNET_NO);
+ return;
+ }
/* send via channel */
switch (protocol)
de->dt_tail,
dt);
ts = create_channel_to_destination (dt,
- result_af);
+ result_af);
switch (result_af)
{
case AF_INET: