aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_gre.c
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-11-12 13:43:55 -0500
committerDavid S. Miller <davem@davemloft.net>2010-11-17 15:27:45 -0500
commit5811662b15db018c740c57d037523683fd3e6123 (patch)
treef820610a6024799a26699f22dc9a4ef5dee07978 /net/ipv4/ip_gre.c
parentdd68ad2235b4625e0dc928b2b4c614d265f976d3 (diff)
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
772 { 772 {
773 struct flowi fl = { 773 struct flowi fl = {
774 .oif = tunnel->parms.link, 774 .oif = tunnel->parms.link,
775 .nl_u = { 775 .fl4_dst = dst,
776 .ip4_u = { 776 .fl4_src = tiph->saddr,
777 .daddr = dst, 777 .fl4_tos = RT_TOS(tos),
778 .saddr = tiph->saddr,
779 .tos = RT_TOS(tos)
780 }
781 },
782 .proto = IPPROTO_GRE,
783 .fl_gre_key = tunnel->parms.o_key 778 .fl_gre_key = tunnel->parms.o_key
784 }; 779 };
785 if (ip_route_output_key(dev_net(dev), &rt, &fl)) { 780 if (ip_route_output_key(dev_net(dev), &rt, &fl)) {
@@ -951,13 +946,9 @@ static int ipgre_tunnel_bind_dev(struct net_device *dev)
951 if (iph->daddr) { 946 if (iph->daddr) {
952 struct flowi fl = { 947 struct flowi fl = {
953 .oif = tunnel->parms.link, 948 .oif = tunnel->parms.link,
954 .nl_u = { 949 .fl4_dst = iph->daddr,
955 .ip4_u = { 950 .fl4_src = iph->saddr,
956 .daddr = iph->daddr, 951 .fl4_tos = RT_TOS(iph->tos),
957 .saddr = iph->saddr,
958 .tos = RT_TOS(iph->tos)
959 }
960 },
961 .proto = IPPROTO_GRE, 952 .proto = IPPROTO_GRE,
962 .fl_gre_key = tunnel->parms.o_key 953 .fl_gre_key = tunnel->parms.o_key
963 }; 954 };
@@ -1217,13 +1208,9 @@ static int ipgre_open(struct net_device *dev)
1217 if (ipv4_is_multicast(t->parms.iph.daddr)) { 1208 if (ipv4_is_multicast(t->parms.iph.daddr)) {
1218 struct flowi fl = { 1209 struct flowi fl = {
1219 .oif = t->parms.link, 1210 .oif = t->parms.link,
1220 .nl_u = { 1211 .fl4_dst = t->parms.iph.daddr,
1221 .ip4_u = { 1212 .fl4_src = t->parms.iph.saddr,
1222 .daddr = t->parms.iph.daddr, 1213 .fl4_tos = RT_TOS(t->parms.iph.tos),
1223 .saddr = t->parms.iph.saddr,
1224 .tos = RT_TOS(t->parms.iph.tos)
1225 }
1226 },
1227 .proto = IPPROTO_GRE, 1214 .proto = IPPROTO_GRE,
1228 .fl_gre_key = t->parms.o_key 1215 .fl_gre_key = t->parms.o_key
1229 }; 1216 };