diff --git a/libbbfdm-api/dmapi.h b/libbbfdm-api/dmapi.h index 0478230f..58ba1ccd 100644 --- a/libbbfdm-api/dmapi.h +++ b/libbbfdm-api/dmapi.h @@ -59,6 +59,7 @@ do { \ #define DM_STRLEN(SRC) ((SRC != NULL) ? strlen(SRC) : 0) #define DM_STRSTR(STR, MATCH) ((STR != NULL && MATCH != NULL) ? strstr(STR, MATCH) : NULL) #define DM_STRCHR(STR, CHR) ((STR != NULL) ? strchr(STR, CHR) : NULL) +#define DM_STRRCHR(STR, CHR) ((STR != NULL) ? strrchr(STR, CHR) : NULL) #define DM_STRTOL(SRC) ((SRC != NULL) ? strtol(SRC, NULL, 10) : 0) #define DM_STRTOUL(SRC) ((SRC != NULL) ? strtoul(SRC, NULL, 10) : 0) #define DM_STRCMP(S1, S2) ((S1 != NULL && S2 != NULL) ? strcmp(S1, S2) : -1) diff --git a/libbbfdm/dmtree/tr181/ethernet.c b/libbbfdm/dmtree/tr181/ethernet.c index 0b66c8e9..c3cd08ef 100644 --- a/libbbfdm/dmtree/tr181/ethernet.c +++ b/libbbfdm/dmtree/tr181/ethernet.c @@ -161,12 +161,12 @@ static void dmmap_synchronizeEthernetLink(struct dmctx *dmctx, DMNODE *parent_no DM_STRNCPY(dev_name, device, sizeof(dev_name)); - char *has_vid = DM_STRCHR(dev_name, '.'); + char *has_vid = DM_STRRCHR(dev_name, '.'); if (has_vid) *has_vid = '\0'; if (is_mac_vlan_interface(dev_name)) { - char *p = DM_STRCHR(dev_name, '_'); + char *p = DM_STRRCHR(dev_name, '_'); if (p) *p = '\0'; }