case ACTION_RTLABEL:  set->action.id = rtlabel_name2id(set->action.rtlabel); set->type = ACTION_RTLABEL_ID;  case ACTION_RTLABEL_ID: rtlabel_unref(asp->rtlabelid); asp->rtlabelid = set->action.id; rtlabel_ref(asp->rtlabelid); break;
rde_apply_set(struct rde_aspath *asp, struct filter_set_head *sh,    sa_family_t af, struct rde_peer *peer, enum directions dir){	struct filter_set	*set;	struct aspath		*new;	struct attr		*a;	u_int16_t		 as;	u_int8_t		 prepend;	if (asp == NULL)		return;	SIMPLEQ_FOREACH(set, sh, entry) {		/*		 * default outgoing overrides are only allowed to		 * set prepend-self and set nexthop no-modify		 */		if (dir == DIR_DEFAULT_OUT &&		    set->type != ACTION_SET_PREPEND_SELF &&		    set->type != ACTION_SET_NEXTHOP_NOMODIFY)			continue;		switch (set->type) {		case ACTION_SET_LOCALPREF:			asp->lpref = set->action.metric;			break;		case ACTION_SET_RELATIVE_LOCALPREF:			if (set->action.relative > 0) {				if (set->action.relative + asp->lpref <				    asp->lpref)					asp->lpref = UINT_MAX;				else					asp->lpref += set->action.relative;			} else {				if ((u_int32_t)-set->action.relative >				    asp->lpref)					asp->lpref = 0;				else					asp->lpref += set->action.relative;			}			break;		case ACTION_SET_MED:			asp->flags |= F_ATTR_MED | F_ATTR_MED_ANNOUNCE;			asp->med = set->action.metric;			break;		case ACTION_SET_RELATIVE_MED:			asp->flags |= F_ATTR_MED | F_ATTR_MED_ANNOUNCE;			if (set->action.relative > 0) {				if (set->action.relative + asp->med <				    asp->med)					asp->med = UINT_MAX;				else					asp->med += set->action.relative;			} else {				if ((u_int32_t)-set->action.relative >				    asp->med)					asp->med = 0;				else					asp->med += set->action.relative;			}			break;		case ACTION_SET_WEIGHT:			asp->weight = set->action.metric;			break;		case ACTION_SET_RELATIVE_WEIGHT:			if (set->action.relative > 0) {				if (set->action.relative + asp->weight <				    asp->weight)					asp->weight = UINT_MAX;				else					asp->weight += set->action.relative;			} else {				if ((u_int32_t)-set->action.relative >				    asp->weight)					asp->weight = 0;				else					asp->weight += set->action.relative;			}			break;		case ACTION_SET_PREPEND_SELF:			/* don't apply if this is a incoming default override */			if (dir == DIR_DEFAULT_IN)				break;			as = rde_local_as();			prepend = set->action.prepend;			new = aspath_prepend(asp->aspath, as, prepend);			aspath_put(asp->aspath);			asp->aspath = new;			break;		case ACTION_SET_PREPEND_PEER:			as = peer->conf.remote_as;			prepend = set->action.prepend;			new = aspath_prepend(asp->aspath, as, prepend);			aspath_put(asp->aspath);			asp->aspath = new;			break;		case ACTION_SET_NEXTHOP:		case ACTION_SET_NEXTHOP_REJECT:		case ACTION_SET_NEXTHOP_BLACKHOLE:		case ACTION_SET_NEXTHOP_NOMODIFY:			if (set->type == ACTION_SET_NEXTHOP_NOMODIFY &&			    dir == DIR_DEFAULT_IN)				break;			nexthop_modify(asp, &set->action.nexthop, set->type,			    af);			break;		case ACTION_SET_COMMUNITY:			if ((a = attr_optget(asp, ATTR_COMMUNITIES)) == NULL) {				attr_optadd(asp, ATTR_OPTIONAL|ATTR_TRANSITIVE,				    ATTR_COMMUNITIES, NULL, 0);				if ((a = attr_optget(asp,				    ATTR_COMMUNITIES)) == NULL)					fatalx("internal community bug");			}			community_set(a, set->action.community.as,			    set->action.community.type);			break;		case ACTION_PFTABLE:			strlcpy(asp->pftable, set->action.pftable,			    sizeof(asp->pftable));			break;		}	}}