[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20101123082404.5b8ad019@nehalam>
Date: Tue, 23 Nov 2010 08:24:04 -0800
From: Stephen Hemminger <shemminger@...ux-foundation.org>
To: Timo Teräs <timo.teras@....fi>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH] iproute2: support xfrm upper protocol gre key
On Tue, 23 Nov 2010 17:02:39 +0200
Timo Teräs <timo.teras@....fi> wrote:
> + case IPPROTO_GRE:
> + if (sel->sport_mask || sel->dport_mask) {
> + struct in_addr key;
> + key.s_addr = htonl((ntohs(sel->sport) << 16) + ntohs(sel->dport));
> + inet_ntop(AF_INET, &key, abuf, sizeof(abuf));
> + fprintf(fp, "key %s ", abuf);
> + }
The GRE key is not really an IPv4 address. Why should the utilities
use IPv4 address manipulation to format/scan it. It makes more sense
to me to just use u32 an do the necessary ntohl.
--
--
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