summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-11-12 18:43:55 +0000
committerDavid S. Miller <davem@davemloft.net>2010-11-17 12:27:45 -0800
commit5811662b15db018c740c57d037523683fd3e6123 (patch)
treef820610a6024799a26699f22dc9a4ef5dee07978 /net/ipv4/ip_gre.c
parentdd68ad2235b4625e0dc928b2b4c614d265f976d3 (diff)
downloadlinux-stable-5811662b15db018c740c57d037523683fd3e6123.tar.gz
linux-stable-5811662b15db018c740c57d037523683fd3e6123.tar.bz2
linux-stable-5811662b15db018c740c57d037523683fd3e6123.zip
net: use the macros defined for the members of flowi
Use the macros defined for the members of flowi to clean the code up. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/ip_gre.c')
-rw-r--r--net/ipv4/ip_gre.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
index aace653710f6..897210adaa77 100644
--- a/net/ipv4/ip_gre.c
+++ b/net/ipv4/ip_gre.c
@@ -772,14 +772,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
{
struct flowi fl = {
.oif = tunnel->parms.link,
- .nl_u = {
- .ip4_u = {
- .daddr = dst,
- .saddr = tiph->saddr,
- .tos = RT_TOS(tos)
- }
- },
- .proto = IPPROTO_GRE,
+ .fl4_dst = dst,
+ .fl4_src = tiph->saddr,
+ .fl4_tos = RT_TOS(tos),
.fl_gre_key = tunnel->parms.o_key
};
if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
@@ -951,13 +946,9 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
if (iph->daddr) {
struct flowi fl = {
.oif = tunnel->parms.link,
- .nl_u = {
- .ip4_u = {
- .daddr = iph->daddr,
- .saddr = iph->saddr,
- .tos = RT_TOS(iph->tos)
- }
- },
+ .fl4_dst = iph->daddr,
+ .fl4_src = iph->saddr,
+ .fl4_tos = RT_TOS(iph->tos),
.proto = IPPROTO_GRE,
.fl_gre_key = tunnel->parms.o_key
};
@@ -1217,13 +1208,9 @@ static int ipgre_open(struct net_device *dev)
if (ipv4_is_multicast(t->parms.iph.daddr)) {
struct flowi fl = {
.oif = t->parms.link,
- .nl_u = {
- .ip4_u = {
- .daddr = t->parms.iph.daddr,
- .saddr = t->parms.iph.saddr,
- .tos = RT_TOS(t->parms.iph.tos)
- }
- },
+ .fl4_dst = t->parms.iph.daddr,
+ .fl4_src = t->parms.iph.saddr,
+ .fl4_tos = RT_TOS(t->parms.iph.tos),
.proto = IPPROTO_GRE,
.fl_gre_key = t->parms.o_key
};