Add attributes that allow matching on source and destination ports with a mask. Matching on the source port with a mask is needed in deployments where users encode path information into certain bits of the UDP source port. Temporarily set the type of the attributes to 'NLA_REJECT' while support is being added.
Unified · Split
| @@ -70,6 +70,8 @@ enum { · 69 unmodified lines | ||
| 70 | 70 | FRA_DSCP, /* dscp */ |
| 71 | 71 | FRA_FLOWLABEL, /* flowlabel */ |
| 72 | 72 | FRA_FLOWLABEL_MASK, /* flowlabel mask */ |
| 73 | + FRA_SPORT_MASK, /* sport mask */ | |
| 74 | + FRA_DPORT_MASK, /* dport mask */ | |
| 73 | 75 | __FRA_MAX |
| 74 | 76 | }; |
| 75 | 77 | |
| @@ -784,6 +784,8 @@ static const struct nla_policy fib_rule_policy[FRA_MAX + 1] = { · 783 unmodified lines | ||
| 784 | 784 | [FRA_DSCP] = NLA_POLICY_MAX(NLA_U8, INET_DSCP_MASK >> 2), |
| 785 | 785 | [FRA_FLOWLABEL] = { .type = NLA_BE32 }, |
| 786 | 786 | [FRA_FLOWLABEL_MASK] = { .type = NLA_BE32 }, |
| 787 | + [FRA_SPORT_MASK] = { .type = NLA_REJECT }, | |
| 788 | + [FRA_DPORT_MASK] = { .type = NLA_REJECT }, | |
| 787 | 789 | }; |
| 788 | 790 | |
| 789 | 791 | int fib_newrule(struct net *net, struct sk_buff *skb, struct nlmsghdr *nlh, |