/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2015-08-10 21:23:46 UTC
  • mfrom: (237.4.57 release)
  • Revision ID: teddy@recompile.se-20150810212346-wvobzmqnnit9q8px
Merge from release branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 * "browse_callback", and parts of "main".
10
10
 * 
11
11
 * Everything else is
12
 
 * Copyright © 2008-2016 Teddy Hogeborn
13
 
 * Copyright © 2008-2016 Björn Påhlsson
 
12
 * Copyright © 2008-2015 Teddy Hogeborn
 
13
 * Copyright © 2008-2015 Björn Påhlsson
14
14
 * 
15
15
 * This program is free software: you can redistribute it and/or
16
16
 * modify it under the terms of the GNU General Public License as
47
47
                                   strtof(), abort() */
48
48
#include <stdbool.h>            /* bool, false, true */
49
49
#include <string.h>             /* strcmp(), strlen(), strerror(),
50
 
                                   asprintf(), strncpy() */
 
50
                                   asprintf(), strcpy() */
51
51
#include <sys/ioctl.h>          /* ioctl */
52
52
#include <sys/types.h>          /* socket(), inet_pton(), sockaddr,
53
53
                                   sockaddr_in6, PF_INET6,
1223
1223
                    sizeof(struct sockaddr_in));
1224
1224
    }
1225
1225
    if(ret < 0){
1226
 
      if(((errno == ENETUNREACH) or (errno == EHOSTUNREACH))
 
1226
      if(errno == ENETUNREACH
1227
1227
         and if_index != AVAHI_IF_UNSPEC
1228
1228
         and connect_to == NULL
1229
1229
         and not route_added and
1637
1637
    errno = ret_errno;
1638
1638
    return false;
1639
1639
  }
1640
 
  strncpy(ifr->ifr_name, ifname, IF_NAMESIZE);
1641
 
  ifr->ifr_name[IF_NAMESIZE-1] = '\0'; /* NUL terminate */
 
1640
  strcpy(ifr->ifr_name, ifname);
1642
1641
  ret = ioctl(s, SIOCGIFFLAGS, ifr);
1643
1642
  if(ret == -1){
1644
1643
    if(debug){