[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141021164824.GA10224@kria>
Date: Tue, 21 Oct 2014 18:48:24 +0200
From: Sabrina Dubroca <sd@...asysnail.net>
To: Tom Herbert <therbert@...gle.com>
Cc: davem@...emloft.net, stephen@...workplumber.org,
netdev@...r.kernel.org
Subject: Re: [PATCH 4/5] ip link ipip: Add support to configure FOU and GUE
Hello Tom,
2014-10-03, 08:55:17 -0700, Tom Herbert wrote:
> [...]
>
> @@ -345,6 +396,44 @@ static void iptunnel_print_opt(struct link_util *lu, FILE *f, struct rtattr *tb[
> relayprefixlen);
> }
> }
> +
> + if (tb[IFLA_IPTUN_ENCAP_TYPE] &&
> + *(__u16 *)RTA_DATA(tb[IFLA_IPTUN_ENCAP_TYPE]) != TUNNEL_ENCAP_NONE) {
> + __u16 type = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_TYPE]);
> + __u16 flags = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_FLAGS]);
> + __u16 sport = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_SPORT]);
> + __u16 dport = rta_getattr_u16(tb[IFLA_IPTUN_ENCAP_DPORT]);
> +
> + fputs("encap ", f);
> + switch (type) {
> + case TUNNEL_ENCAP_FOU:
> + fputs("fou ", f);
> + break;
> + case TUNNEL_ENCAP_GUE:
> + fputs("gue ", f);
> + break;
> + default:
> + fputs("unknown ", f);
> + break;
> + }
> +
> + if (sport == 0)
> + fputs("encap-sport auto ", f);
> + else
> + fprintf(f, "encap-sport %u", sport);
^^^
missing space?
> +
> + fprintf(f, "encap-dport %u ", dport);
You're missing a few ntohs for source/dest ports here:
./ip link add name tun1 type ipip remote 192.168.1.1 local 192.168.1.2 ttl 225 encap gue encap-sport auto encap-dport 9999 encap-csum
./ip -d link show dev tun1
7: tun1@...E: <POINTOPOINT,NOARP> mtu 1468 qdisc noop state DOWN mode DEFAULT group default
link/ipip 192.168.1.2 peer 192.168.1.1 promiscuity 0
ipip remote 192.168.1.1 local 192.168.1.2 ttl 225 pmtudisc encap gue encap-sport auto encap-dport 3879 encap-csum noencap-csum6
^^^^
Same comments for the next patch.
--
Sabrina
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists