.. | .. |
---|
778 | 778 | TCA_FLOWER_KEY_PORT_SRC_MAX, &mask->tp_range.tp_max.src, |
---|
779 | 779 | TCA_FLOWER_UNSPEC, sizeof(key->tp_range.tp_max.src)); |
---|
780 | 780 | |
---|
| 781 | + if (mask->tp_range.tp_min.dst != mask->tp_range.tp_max.dst) { |
---|
| 782 | + NL_SET_ERR_MSG(extack, |
---|
| 783 | + "Both min and max destination ports must be specified"); |
---|
| 784 | + return -EINVAL; |
---|
| 785 | + } |
---|
| 786 | + if (mask->tp_range.tp_min.src != mask->tp_range.tp_max.src) { |
---|
| 787 | + NL_SET_ERR_MSG(extack, |
---|
| 788 | + "Both min and max source ports must be specified"); |
---|
| 789 | + return -EINVAL; |
---|
| 790 | + } |
---|
781 | 791 | if (mask->tp_range.tp_min.dst && mask->tp_range.tp_max.dst && |
---|
782 | 792 | ntohs(key->tp_range.tp_max.dst) <= |
---|
783 | 793 | ntohs(key->tp_range.tp_min.dst)) { |
---|
.. | .. |
---|
1086 | 1096 | if (option_len > sizeof(struct geneve_opt)) |
---|
1087 | 1097 | data_len = option_len - sizeof(struct geneve_opt); |
---|
1088 | 1098 | |
---|
| 1099 | + if (key->enc_opts.len > FLOW_DIS_TUN_OPTS_MAX - 4) |
---|
| 1100 | + return -ERANGE; |
---|
| 1101 | + |
---|
1089 | 1102 | opt = (struct geneve_opt *)&key->enc_opts.data[key->enc_opts.len]; |
---|
1090 | 1103 | memset(opt, 0xff, option_len); |
---|
1091 | 1104 | opt->length = data_len / 4; |
---|