sunvnet: use icmp_ndo_send helper
[linux-2.6-microblaze.git] / drivers / net / ethernet / sun / sunvnet_common.c
index c23ce83..8dc6c9f 100644 (file)
@@ -1350,27 +1350,12 @@ sunvnet_start_xmit_common(struct sk_buff *skb, struct net_device *dev,
                if (vio_version_after_eq(&port->vio, 1, 3))
                        localmtu -= VLAN_HLEN;
 
-               if (skb->protocol == htons(ETH_P_IP)) {
-                       struct flowi4 fl4;
-                       struct rtable *rt = NULL;
-
-                       memset(&fl4, 0, sizeof(fl4));
-                       fl4.flowi4_oif = dev->ifindex;
-                       fl4.flowi4_tos = RT_TOS(ip_hdr(skb)->tos);
-                       fl4.daddr = ip_hdr(skb)->daddr;
-                       fl4.saddr = ip_hdr(skb)->saddr;
-
-                       rt = ip_route_output_key(dev_net(dev), &fl4);
-                       if (!IS_ERR(rt)) {
-                               skb_dst_set(skb, &rt->dst);
-                               icmp_send(skb, ICMP_DEST_UNREACH,
-                                         ICMP_FRAG_NEEDED,
-                                         htonl(localmtu));
-                       }
-               }
+               if (skb->protocol == htons(ETH_P_IP))
+                       icmp_ndo_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
+                                     htonl(localmtu));
 #if IS_ENABLED(CONFIG_IPV6)
                else if (skb->protocol == htons(ETH_P_IPV6))
-                       icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, localmtu);
+                       icmpv6_ndo_send(skb, ICMPV6_PKT_TOOBIG, 0, localmtu);
 #endif
                goto out_dropped;
        }