if (streq(lvalue, "ListenFIFO")) {
p->type = SOCKET_FIFO;
- if (!(p->path = strdup(rvalue))) {
+ if (!(p->path = unit_full_printf(UNIT(s), rvalue))) {
free(p);
return -ENOMEM;
}
} else if (streq(lvalue, "ListenSpecial")) {
p->type = SOCKET_SPECIAL;
- if (!(p->path = strdup(rvalue))) {
+ if (!(p->path = unit_full_printf(UNIT(s), rvalue))) {
free(p);
return -ENOMEM;
}
p->type = SOCKET_MQUEUE;
- if (!(p->path = strdup(rvalue))) {
+ if (!(p->path = unit_full_printf(UNIT(s), rvalue))) {
free(p);
return -ENOMEM;
}
path_kill_slashes(p->path);
} else if (streq(lvalue, "ListenNetlink")) {
+ char *k;
+ int r;
+
p->type = SOCKET_SOCKET;
+ k = unit_full_printf(UNIT(s), rvalue);
+ r = socket_address_parse_netlink(&p->address, k);
+ free(k);
- if (socket_address_parse_netlink(&p->address, rvalue) < 0) {
+ if (r < 0) {
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;
}
} else {
+ char *k;
+ int r;
+
p->type = SOCKET_SOCKET;
+ k = unit_full_printf(UNIT(s), rvalue);
+ r = socket_address_parse(&p->address, k);
+ free(k);
- if (socket_address_parse(&p->address, rvalue) < 0) {
+ if (r < 0) {
log_error("[%s:%u] Failed to parse address value, ignoring: %s", filename, line, rvalue);
free(p);
return 0;