Blob Blame History Raw
From cd5fd1c1b943da08c683ee9bc22eed32624d2130 Mon Sep 17 00:00:00 2001
From: Phil Sutter <psutter@redhat.com>
Date: Fri, 17 Mar 2017 13:21:10 +0100
Subject: [PATCH] utils: add get_be{16, 32, 64}, use them where possible

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1422629
Upstream Status: iproute2.git commit 9f7401fa49671
Conflicts: Just reapplying an already backported commit to get formerly
           left out chunks in flower sources.

commit 9f7401fa4967178a071c53498f6bdc460c7cc4ea
Author: Sabrina Dubroca <sd@queasysnail.net>
Date:   Fri Jun 3 16:45:46 2016 +0200

    utils: add get_be{16, 32, 64}, use them where possible

    Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
    Acked-by: Phil Sutter <phil@nwl.cc>
---
 tc/f_flower.c         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tc/f_flower.c b/tc/f_flower.c
index f0d146f..11e6242 100644
--- a/tc/f_flower.c
+++ b/tc/f_flower.c
@@ -150,11 +150,11 @@ static int flower_parse_port(char *str, __u8 ip_port,
 		return -1;
 	}
 
-	ret = get_u16(&port, str, 10);
+	ret = get_be16(&port, str, 10);
 	if (ret)
 		return -1;
 
-	addattr16(n, MAX_MSG, type, htons(port));
+	addattr16(n, MAX_MSG, type, port);
 
 	return 0;
 }
-- 
1.8.3.1