}
}
-static bool
-cmask_equals(const char *a, const char *b)
-{
- if (a && b) {
- return !strcmp(a, b);
- }
-
- return a == NULL && b == NULL;
-}
-
/* Changes the number or the affinity of pmd threads. The changes are actually
* applied in dpif_netdev_run(). */
static int
{
struct dp_netdev *dp = get_dp_netdev(dpif);
- if (!cmask_equals(dp->requested_pmd_cmask, cmask)) {
+ if (!nullable_string_is_equal(dp->requested_pmd_cmask, cmask)) {
free(dp->requested_pmd_cmask);
dp->requested_pmd_cmask = nullable_xstrdup(cmask);
}
dp_netdev_pmd_unref(non_pmd);
- if (!cmask_equals(dp->pmd_cmask, dp->requested_pmd_cmask)
+ if (!nullable_string_is_equal(dp->pmd_cmask, dp->requested_pmd_cmask)
|| ports_require_restart(dp)) {
reconfigure_pmd_threads(dp);
}
return s ? xstrdup(s) : NULL;
}
+bool
+nullable_string_is_equal(const char *a, const char *b)
+{
+ return a ? b && !strcmp(a, b) : !b;
+}
+
char *
xvasprintf(const char *format, va_list args)
{
char *xmemdup0(const char *, size_t) MALLOC_LIKE;
char *xstrdup(const char *) MALLOC_LIKE;
char *nullable_xstrdup(const char *) MALLOC_LIKE;
+bool nullable_string_is_equal(const char *a, const char *b);
char *xasprintf(const char *format, ...) OVS_PRINTF_FORMAT(1, 2) MALLOC_LIKE;
char *xvasprintf(const char *format, va_list) OVS_PRINTF_FORMAT(1, 0) MALLOC_LIKE;
void *x2nrealloc(void *p, size_t *n, size_t s);
static void dpif_ipfix_cache_expire_now(struct dpif_ipfix_exporter *, bool);
-static bool
-nullable_string_is_equal(const char *a, const char *b)
-{
- return a ? b && !strcmp(a, b) : !b;
-}
-
static bool
ofproto_ipfix_bridge_exporter_options_equal(
const struct ofproto_ipfix_bridge_exporter_options *a,
static struct vlog_rate_limit rl = VLOG_RATE_LIMIT_INIT(1, 5);
-static bool
-nullable_string_is_equal(const char *a, const char *b)
-{
- return a ? b && !strcmp(a, b) : !b;
-}
-
static bool
ofproto_sflow_options_equal(const struct ofproto_sflow_options *a,
const struct ofproto_sflow_options *b)