struct rtattr *vtb[BRIDGE_VLANDB_GOPTS_MAX + 1], *vattr;
__u16 vid, vrange = 0;
- if ((a->rta_type & NLA_TYPE_MASK) != BRIDGE_VLANDB_GLOBAL_OPTIONS)
+ if (rta_type(a) != BRIDGE_VLANDB_GLOBAL_OPTIONS)
return;
parse_rtattr_flags(vtb, BRIDGE_VLANDB_GOPTS_MAX, RTA_DATA(a),
__u16 vrange = 0;
__u8 state = 0;
- if ((a->rta_type & NLA_TYPE_MASK) != BRIDGE_VLANDB_ENTRY)
+ if (rta_type(a) != BRIDGE_VLANDB_ENTRY)
return;
parse_rtattr_flags(vtb, BRIDGE_VLANDB_ENTRY_MAX, RTA_DATA(a),
rem = len;
for (a = BRVLAN_RTA(bvm); RTA_OK(a, rem); a = RTA_NEXT(a, rem)) {
- unsigned short rta_type = a->rta_type & NLA_TYPE_MASK;
+ unsigned short attr_type = rta_type(a);
/* skip unknown attributes */
- if (rta_type > BRIDGE_VLANDB_MAX ||
- (global_only && rta_type != BRIDGE_VLANDB_GLOBAL_OPTIONS))
+ if (attr_type > BRIDGE_VLANDB_MAX ||
+ (global_only && attr_type != BRIDGE_VLANDB_GLOBAL_OPTIONS))
continue;
- switch (rta_type) {
+ switch (attr_type) {
case BRIDGE_VLANDB_ENTRY:
print_vlan_opts(a, bvm->ifindex);
break;
rem = len;
for (t = TUNNEL_RTA(tmsg); RTA_OK(t, rem); t = RTA_NEXT(t, rem)) {
- unsigned short rta_type = t->rta_type & NLA_TYPE_MASK;
-
- if (rta_type != VXLAN_VNIFILTER_ENTRY)
+ if (rta_type(t) != VXLAN_VNIFILTER_ENTRY)
continue;
if (!opened) {
{
return (const char *)RTA_DATA(rta);
}
+static inline int rta_type(const struct rtattr *rta)
+{
+ return rta->rta_type & NLA_TYPE_MASK;
+}
int rtnl_listen_all_nsid(struct rtnl_handle *);
int rtnl_listen(struct rtnl_handle *, rtnl_listen_filter_t handler,