]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/q_multiq.c
tc flower: fix parsing vlan_id and vlan_prio
[mirror_iproute2.git] / tc / q_multiq.c
index fce5e449862b1e3318660111994e7057ef6a577d..8ad9e0b2fa3ca9ee3b8cb68f3785f9bd46685aff 100644 (file)
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place - Suite 330, Boston, MA 02111-1307 USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, see <http://www.gnu.org/licenses>.
  *
  * Author: Alexander Duyck <alexander.h.duyck@intel.com>
  *
  * Original Authors:   PJ Waskiewicz, <peter.p.waskiewicz.jr@intel.com> (RR)
- *                     Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> (from PRIO)
+ *                     Alexey Kuznetsov, <kuznet@ms2.inr.ac.ru> (from PRIO)
  *
  */
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
-#include <syslog.h>
 #include <fcntl.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
@@ -42,11 +40,11 @@ static void explain(void)
 }
 
 static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
-                           struct nlmsghdr *n)
+                           struct nlmsghdr *n, const char *dev)
 {
-       struct tc_multiq_qopt opt;
+       struct tc_multiq_qopt opt = {};
 
-       if (argc > 0) {
+       if (argc) {
                if (strcmp(*argv, "help") == 0) {
                        explain();
                        return -1;
@@ -55,14 +53,13 @@ static int multiq_parse_opt(struct qdisc_util *qu, int argc, char **argv,
                        explain();
                        return -1;
                }
-               argc--; argv++;
        }
 
        addattr_l(n, 1024, TCA_OPTIONS, &opt, sizeof(opt));
        return 0;
 }
 
-int multiq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
+static int multiq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 {
        struct tc_multiq_qopt *qopt;
 
@@ -79,7 +76,7 @@ int multiq_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
 }
 
 struct qdisc_util multiq_qdisc_util = {
-       .id             = "multiq",
+       .id             = "multiq",
        .parse_qopt     = multiq_parse_opt,
        .print_qopt     = multiq_print_opt,
 };