Ticket #147: avahi-0.6.16-autoipd-action-script.patch
| File avahi-0.6.16-autoipd-action-script.patch, 2.5 kB (added by dcbw, 2 years ago) |
|---|
-
avahi-0.6.16/avahi-autoipd/main.c
old new 117 117 #endif 118 118 static int no_drop_root = 0; 119 119 static int wrote_pid_file = 0; 120 static char *action_script = NULL; 120 121 121 122 static enum { 122 123 DAEMON_RUN, … … 575 576 } 576 577 577 578 if (daemon_exec("/", &k, 578 AVAHI_IPCONF_SCRIPT, AVAHI_IPCONF_SCRIPT,579 action_script, action_script, 579 580 callout_event_table[info.event], 580 581 name, 581 582 inet_ntop(AF_INET, &info.address, buf, sizeof(buf)), NULL) < 0) { … … 1154 1155 " -V --version Show version\n" 1155 1156 " -S --start=ADDRESS Start with this address from the IPv4LL range\n" 1156 1157 " 169.254.0.0/16\n" 1158 " -t --script=script Action script to run (defaults to\n" 1159 " /etc/avahi/avahi-autoipd.action)\n" 1157 1160 " -w --wait Wait until an address has been acquired before\n" 1158 1161 " daemonizing\n" 1159 1162 " --force-bind Assign an IPv4LL address even if a routable address\n" … … 1189 1192 { "check", no_argument, NULL, 'c' }, 1190 1193 { "version", no_argument, NULL, 'V' }, 1191 1194 { "start", required_argument, NULL, 'S' }, 1195 { "script", required_argument, NULL, 't' }, 1192 1196 { "wait", no_argument, NULL, 'w' }, 1193 1197 { "force-bind", no_argument, NULL, OPTION_FORCE_BIND }, 1194 1198 { "no-drop-root", no_argument, NULL, OPTION_NO_DROP_ROOT }, … … 1201 1205 }; 1202 1206 1203 1207 opterr = 0; 1204 while ((c = getopt_long(argc, argv, "hDskrcVS: w", long_options, NULL)) >= 0) {1208 while ((c = getopt_long(argc, argv, "hDskrcVS:t:w", long_options, NULL)) >= 0) { 1205 1209 1206 1210 switch(c) { 1207 1211 case 's': … … 1232 1236 return -1; 1233 1237 } 1234 1238 break; 1239 case 't': 1240 action_script = avahi_strdup(optarg); 1241 break; 1235 1242 case 'w': 1236 1243 wait_for_address = 1; 1237 1244 break; … … 1281 1288 fprintf(stderr, "Too many arguments\n"); 1282 1289 return -1; 1283 1290 } 1291 1292 if (!action_script) 1293 action_script = avahi_strdup(AVAHI_IPCONF_SCRIPT); 1284 1294 1285 1295 return 0; 1286 1296 }
