- if (cap->change(ZPRIVS_RAISE))
- zlog_err("routing_socket: Can't raise privileges");
-
- ret = setsockopt(sock, SOL_SOCKET, SO_MARK, &mark, sizeof(mark));
-
- if (cap->change(ZPRIVS_LOWER))
- zlog_err("routing_socket: Can't lower privileges");
-
+ frr_elevate_privs(cap) {
+ ret = setsockopt(sock, SOL_SOCKET, SO_MARK, &mark,
+ sizeof(mark));
+ }