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>
This commit is contained in:

committed by
David S. Miller

parent
dd68ad2235
commit
5811662b15
@@ -386,10 +386,9 @@ static void icmp_reply(struct icmp_bxm *icmp_param, struct sk_buff *skb)
|
||||
daddr = icmp_param->replyopts.faddr;
|
||||
}
|
||||
{
|
||||
struct flowi fl = { .nl_u = { .ip4_u =
|
||||
{ .daddr = daddr,
|
||||
.saddr = rt->rt_spec_dst,
|
||||
.tos = RT_TOS(ip_hdr(skb)->tos) } },
|
||||
struct flowi fl = { .fl4_dst= daddr,
|
||||
.fl4_src = rt->rt_spec_dst,
|
||||
.fl4_tos = RT_TOS(ip_hdr(skb)->tos),
|
||||
.proto = IPPROTO_ICMP };
|
||||
security_skb_classify_flow(skb, &fl);
|
||||
if (ip_route_output_key(net, &rt, &fl))
|
||||
@@ -542,22 +541,13 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
|
||||
|
||||
{
|
||||
struct flowi fl = {
|
||||
.nl_u = {
|
||||
.ip4_u = {
|
||||
.daddr = icmp_param.replyopts.srr ?
|
||||
icmp_param.replyopts.faddr :
|
||||
iph->saddr,
|
||||
.saddr = saddr,
|
||||
.tos = RT_TOS(tos)
|
||||
}
|
||||
},
|
||||
.fl4_dst = icmp_param.replyopts.srr ?
|
||||
icmp_param.replyopts.faddr : iph->saddr,
|
||||
.fl4_src = saddr,
|
||||
.fl4_tos = RT_TOS(tos),
|
||||
.proto = IPPROTO_ICMP,
|
||||
.uli_u = {
|
||||
.icmpt = {
|
||||
.type = type,
|
||||
.code = code
|
||||
}
|
||||
}
|
||||
.fl_icmp_type = type,
|
||||
.fl_icmp_code = code,
|
||||
};
|
||||
int err;
|
||||
struct rtable *rt2;
|
||||
|
Reference in New Issue
Block a user