diff options
Diffstat (limited to 'src/rdisc/nm-rdisc-private.h')
| -rw-r--r-- | src/rdisc/nm-rdisc-private.h | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/src/rdisc/nm-rdisc-private.h b/src/rdisc/nm-rdisc-private.h index c0ec739a..abc5a399 100644 --- a/src/rdisc/nm-rdisc-private.h +++ b/src/rdisc/nm-rdisc-private.h @@ -25,6 +25,17 @@ /* Functions only used by rdisc implementations */ +struct _NMRDiscDataInternal { + NMRDiscData public; + GArray *gateways; + GArray *addresses; + GArray *routes; + GArray *dns_servers; + GArray *dns_domains; +}; + +typedef struct _NMRDiscDataInternal NMRDiscDataInternal; + void nm_rdisc_ra_received (NMRDisc *rdisc, guint32 now, NMRDiscConfigMap changed); gboolean nm_rdisc_add_gateway (NMRDisc *rdisc, const NMRDiscGateway *new); @@ -44,19 +55,20 @@ gboolean nm_rdisc_add_dns_domain (NMRDisc *rdisc, const NMRDiscDNSDoma const NMLogDomain __domain = (domain); \ \ if (nm_logging_enabled (__level, __domain)) { \ + NMRDisc *const __self = (self); \ char __prefix[64]; \ - const char *__p_prefix = _NMLOG_PREFIX_NAME; \ - const NMRDisc *const __self = (self); \ \ - if (__self) { \ - g_snprintf (__prefix, sizeof (__prefix), "%s[%p,%s%s%s]", \ - _NMLOG_PREFIX_NAME, __self, \ - NM_PRINT_FMT_QUOTE_STRING (__self->ifname)); \ - __p_prefix = __prefix; \ - } \ _nm_log (__level, __domain, 0, \ "%s: " _NM_UTILS_MACRO_FIRST (__VA_ARGS__), \ - __p_prefix _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ + (__self \ + ? ({ \ + const char *__ifname = nm_rdisc_get_ifname (__self); \ + nm_sprintf_buf (__prefix, "%s[%p,%s%s%s]", \ + _NMLOG_PREFIX_NAME, __self, \ + NM_PRINT_FMT_QUOTE_STRING (__ifname)); \ + }) \ + : _NMLOG_PREFIX_NAME) \ + _NM_UTILS_MACRO_REST (__VA_ARGS__)); \ } \ } G_STMT_END |