]> Git Repo - linux.git/blobdiff - net/ipv4/route.c
net: ipv4: fix multipath RTM_GETROUTE behavior when iif is given
[linux.git] / net / ipv4 / route.c
index 5dda1ef81c7e10bbc41e610aacf6bad15ba05b45..5e1e60546fce7db5092c816e51ec38f6975ff0d2 100644 (file)
@@ -2667,10 +2667,6 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
        skb_reset_mac_header(skb);
        skb_reset_network_header(skb);
 
-       /* Bugfix: need to give ip_route_input enough of an IP header to not gag. */
-       ip_hdr(skb)->protocol = IPPROTO_ICMP;
-       skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
-
        src = tb[RTA_SRC] ? nla_get_in_addr(tb[RTA_SRC]) : 0;
        dst = tb[RTA_DST] ? nla_get_in_addr(tb[RTA_DST]) : 0;
        iif = tb[RTA_IIF] ? nla_get_u32(tb[RTA_IIF]) : 0;
@@ -2680,6 +2676,15 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr *nlh)
        else
                uid = (iif ? INVALID_UID : current_uid());
 
+       /* Bugfix: need to give ip_route_input enough of an IP header to
+        * not gag.
+        */
+       ip_hdr(skb)->protocol = IPPROTO_UDP;
+       ip_hdr(skb)->saddr = src;
+       ip_hdr(skb)->daddr = dst;
+
+       skb_reserve(skb, MAX_HEADER + sizeof(struct iphdr));
+
        memset(&fl4, 0, sizeof(fl4));
        fl4.daddr = dst;
        fl4.saddr = src;
This page took 0.0329 seconds and 4 git commands to generate.