From: Sabrina Dubroca <sd@queasysnail.net>
To: Tom Herbert <therbert@google.com>
Cc: davem@davemloft.net, stephen@networkplumber.org, netdev@vger.kernel.org
Subject: Re: [PATCH 4/5] ip link ipip: Add support to configure FOU and GUE
Date: Tue, 21 Oct 2014 18:48:24 +0200 [thread overview]
Message-ID: <20141021164824.GA10224@kria> (raw)
In-Reply-To: <1412351718-22921-5-git-send-email-therbert@google.com>
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@NONE: <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
next prev parent reply other threads:[~2014-10-21 16:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-03 15:55 [PATCH iproute2 0/5] iproute: Add FOU and GUE configuration in ip Tom Herbert
2014-10-03 15:55 ` [PATCH iproute2 1/5] iplink: Fix setting of -1 as ifindex Tom Herbert
2014-10-07 0:42 ` Cong Wang
2014-10-03 15:55 ` [PATCH iproute2 2/5] ip fou: Support to configure foo-over-udp RX Tom Herbert
2014-11-02 19:36 ` Stephen Hemminger
2014-11-02 19:45 ` Stephen Hemminger
2014-11-02 20:53 ` Stephen Hemminger
2014-10-03 15:55 ` [PATCH iproute2 3/5] ip tunnel: Kernel uapi definitions for fou and gue Tom Herbert
2014-10-03 15:55 ` [PATCH 4/5] ip link ipip: Add support to configure FOU and GUE Tom Herbert
2014-10-21 16:48 ` Sabrina Dubroca [this message]
2014-10-03 15:55 ` [PATCH 5/5] ip link gre: " Tom Herbert
2014-11-02 19:46 ` [PATCH iproute2 0/5] iproute: Add FOU and GUE configuration in ip Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20141021164824.GA10224@kria \
--to=sd@queasysnail.net \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=therbert@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.