* [PATCH iproute2] ip fou: Pass family attribute as u8
@ 2018-01-07 14:28 Filip Moc
2018-01-07 20:28 ` Stephen Hemminger
2018-01-09 16:01 ` Stephen Hemminger
0 siblings, 2 replies; 4+ messages in thread
From: Filip Moc @ 2018-01-07 14:28 UTC (permalink / raw)
To: netdev
This fixes fou on big-endian systems.
Signed-off-by: Filip Moc <dev@moc6.cz>
---
ip/ipfou.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ip/ipfou.c b/ip/ipfou.c
index febc2c8c..1f392ade 100644
--- a/ip/ipfou.c
+++ b/ip/ipfou.c
@@ -52,7 +52,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
__u8 ipproto, type;
bool gue_set = false;
int ipproto_set = 0;
- unsigned short family = AF_INET;
+ __u8 family = AF_INET;
while (argc > 0) {
if (!matches(*argv, "port")) {
@@ -103,7 +103,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
addattr16(n, 1024, FOU_ATTR_PORT, port);
addattr8(n, 1024, FOU_ATTR_TYPE, type);
- addattr16(n, 1024, FOU_ATTR_AF, family);
+ addattr8(n, 1024, FOU_ATTR_AF, family);
if (ipproto_set)
addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] ip fou: Pass family attribute as u8
2018-01-07 14:28 [PATCH iproute2] ip fou: Pass family attribute as u8 Filip Moc
@ 2018-01-07 20:28 ` Stephen Hemminger
2018-01-07 21:25 ` Filip Moc
2018-01-09 16:01 ` Stephen Hemminger
1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2018-01-07 20:28 UTC (permalink / raw)
To: Filip Moc; +Cc: netdev
On Sun, 7 Jan 2018 15:28:13 +0100
Filip Moc <dev@moc6.cz> wrote:
> This fixes fou on big-endian systems.
>
> Signed-off-by: Filip Moc <dev@moc6.cz>
> ---
> ip/ipfou.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/ip/ipfou.c b/ip/ipfou.c
> index febc2c8c..1f392ade 100644
> --- a/ip/ipfou.c
> +++ b/ip/ipfou.c
> @@ -52,7 +52,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
> __u8 ipproto, type;
> bool gue_set = false;
> int ipproto_set = 0;
> - unsigned short family = AF_INET;
> + __u8 family = AF_INET;
>
> while (argc > 0) {
> if (!matches(*argv, "port")) {
> @@ -103,7 +103,7 @@ static int fou_parse_opt(int argc, char **argv, struct nlmsghdr *n,
>
> addattr16(n, 1024, FOU_ATTR_PORT, port);
> addattr8(n, 1024, FOU_ATTR_TYPE, type);
> - addattr16(n, 1024, FOU_ATTR_AF, family);
> + addattr8(n, 1024, FOU_ATTR_AF, family);
>
> if (ipproto_set)
> addattr8(n, 1024, FOU_ATTR_IPPROTO, ipproto);
How is this binary compatiable with older versions.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] ip fou: Pass family attribute as u8
2018-01-07 20:28 ` Stephen Hemminger
@ 2018-01-07 21:25 ` Filip Moc
0 siblings, 0 replies; 4+ messages in thread
From: Filip Moc @ 2018-01-07 21:25 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: netdev
Hi Stephen,
> How is this binary compatiable with older versions.
I'm not sure what you mean. Kernel expects family attribute to be passed as u8
(and it always did). But current ip passes family attribute as u16. It works
now only on little endian systems because the relevant byte happens to be on
the same position. It is the current version of ip which is incompatible.
Filip
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH iproute2] ip fou: Pass family attribute as u8
2018-01-07 14:28 [PATCH iproute2] ip fou: Pass family attribute as u8 Filip Moc
2018-01-07 20:28 ` Stephen Hemminger
@ 2018-01-09 16:01 ` Stephen Hemminger
1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-01-09 16:01 UTC (permalink / raw)
To: Filip Moc; +Cc: netdev
On Sun, 7 Jan 2018 15:28:13 +0100
Filip Moc <dev@moc6.cz> wrote:
> This fixes fou on big-endian systems.
>
> Signed-off-by: Filip Moc <dev@moc6.cz>
Applied
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-01-09 16:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-07 14:28 [PATCH iproute2] ip fou: Pass family attribute as u8 Filip Moc
2018-01-07 20:28 ` Stephen Hemminger
2018-01-07 21:25 ` Filip Moc
2018-01-09 16:01 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).