[BACK]Return to if-options.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / external / bsd / dhcpcd / dist / src

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/external/bsd/dhcpcd/dist/src/if-options.c between version 1.3.4.2 and 1.4

version 1.3.4.2, 2017/04/26 02:52:23 version 1.4, 2017/05/10 11:03:44
Line 93 
Line 93 
 #define O_IPV6                  O_BASE + 33  #define O_IPV6                  O_BASE + 33
 #define O_CONTROLGRP            O_BASE + 34  #define O_CONTROLGRP            O_BASE + 34
 #define O_SLAAC                 O_BASE + 35  #define O_SLAAC                 O_BASE + 35
 // unused                       O_BASE + 36  #define O_GATEWAY               O_BASE + 36
 #define O_NOUP                  O_BASE + 37  #define O_NOUP                  O_BASE + 37
 #define O_IPV6RA_AUTOCONF       O_BASE + 38  #define O_IPV6RA_AUTOCONF       O_BASE + 38
 #define O_IPV6RA_NOAUTOCONF     O_BASE + 39  #define O_IPV6RA_NOAUTOCONF     O_BASE + 39
Line 196  const struct option cf_options[] = {
Line 196  const struct option cf_options[] = {
         {"nodhcp6",         no_argument,       NULL, O_NODHCP6},          {"nodhcp6",         no_argument,       NULL, O_NODHCP6},
         {"controlgroup",    required_argument, NULL, O_CONTROLGRP},          {"controlgroup",    required_argument, NULL, O_CONTROLGRP},
         {"slaac",           required_argument, NULL, O_SLAAC},          {"slaac",           required_argument, NULL, O_SLAAC},
           {"gateway",         no_argument,       NULL, O_GATEWAY},
         {"reject",          required_argument, NULL, O_REJECT},          {"reject",          required_argument, NULL, O_REJECT},
         {"bootp",           no_argument,       NULL, O_BOOTP},          {"bootp",           no_argument,       NULL, O_BOOTP},
         {"nodelay",         no_argument,       NULL, O_NODELAY},          {"nodelay",         no_argument,       NULL, O_NODELAY},
Line 978  parse_option(struct dhcpcd_ctx *ctx, con
Line 979  parse_option(struct dhcpcd_ctx *ctx, con
                         return -1;                          return -1;
                 }                  }
                 break;                  break;
           case 'G':
                   ifo->options &= ~DHCPCD_GATEWAY;
                   break;
         case 'H':          case 'H':
                 ifo->options |= DHCPCD_XID_HWADDR;                  ifo->options |= DHCPCD_XID_HWADDR;
                 break;                  break;
Line 1062  parse_option(struct dhcpcd_ctx *ctx, con
Line 1066  parse_option(struct dhcpcd_ctx *ctx, con
                     strncmp(arg, "ms_classless_static_routes=",                      strncmp(arg, "ms_classless_static_routes=",
                         strlen("ms_classless_static_routes=")) == 0)                          strlen("ms_classless_static_routes=")) == 0)
                 {                  {
                           struct interface *ifp;
                         struct in_addr addr3;                          struct in_addr addr3;
   
                           ifp = if_find(ctx->ifaces, ifname);
                           if (ifp == NULL) {
                                   logerrx("static routes require an interface");
                                   return -1;
                           }
                         fp = np = strwhite(p);                          fp = np = strwhite(p);
                         if (np == NULL) {                          if (np == NULL) {
                                 logerrx("all routes need a gateway");                                  logerrx("all routes need a gateway");
Line 1077  parse_option(struct dhcpcd_ctx *ctx, con
Line 1087  parse_option(struct dhcpcd_ctx *ctx, con
                                 *fp = ' ';                                  *fp = ' ';
                                 return -1;                                  return -1;
                         }                          }
                         if ((rt = rt_new(if_find(ctx->ifaces, ifname))) == NULL) {                          if ((rt = rt_new(ifp)) == NULL) {
                                 *fp = ' ';                                  *fp = ' ';
                                 return -1;                                  return -1;
                         }                          }
Line 1087  parse_option(struct dhcpcd_ctx *ctx, con
Line 1097  parse_option(struct dhcpcd_ctx *ctx, con
                         TAILQ_INSERT_TAIL(&ifo->routes, rt, rt_next);                          TAILQ_INSERT_TAIL(&ifo->routes, rt, rt_next);
                         *fp = ' ';                          *fp = ' ';
                 } else if (strncmp(arg, "routers=", strlen("routers=")) == 0) {                  } else if (strncmp(arg, "routers=", strlen("routers=")) == 0) {
                           struct interface *ifp;
   
                           ifp = if_find(ctx->ifaces, ifname);
                           if (ifp == NULL) {
                                   logerrx("static routes require an interface");
                                   return -1;
                           }
                         if (parse_addr(&addr, NULL, p) == -1)                          if (parse_addr(&addr, NULL, p) == -1)
                                 return -1;                                  return -1;
                         if ((rt = rt_new(if_find(ctx->ifaces, ifname))) == NULL)                          if ((rt = rt_new(ifp)) == NULL)
                                 return -1;                                  return -1;
                         addr2.s_addr = INADDR_ANY;                          addr2.s_addr = INADDR_ANY;
                         sa_in_init(&rt->rt_dest, &addr2);                          sa_in_init(&rt->rt_dest, &addr2);
Line 2078  err_sla:
Line 2095  err_sla:
                 ctx->control_group = grp->gr_gid;                  ctx->control_group = grp->gr_gid;
 #endif  #endif
                 break;                  break;
           case O_GATEWAY:
                   ifo->options |= DHCPCD_GATEWAY;
                   break;
         case O_NOUP:          case O_NOUP:
                 ifo->options &= ~DHCPCD_IF_UP;                  ifo->options &= ~DHCPCD_IF_UP;
                 break;                  break;
Line 2257  read_config(struct dhcpcd_ctx *ctx,
Line 2277  read_config(struct dhcpcd_ctx *ctx,
         /* Seed our default options */          /* Seed our default options */
         if ((ifo = default_config(ctx)) == NULL)          if ((ifo = default_config(ctx)) == NULL)
                 return NULL;                  return NULL;
         ifo->options |= DHCPCD_DAEMONISE;          ifo->options |= DHCPCD_DAEMONISE | DHCPCD_GATEWAY;
 #ifdef PLUGIN_DEV  #ifdef PLUGIN_DEV
         ifo->options |= DHCPCD_DEV;          ifo->options |= DHCPCD_DEV;
 #endif  #endif

Legend:
Removed from v.1.3.4.2  
changed lines
  Added in v.1.4

CVSweb <webmaster@jp.NetBSD.org>