On 3/9/26 11:54 AM, David Ahern wrote:
On 3/8/26 5:35 PM, Zhu Yanjun wrote:
@@ -101,20 +100,20 @@ static inline void rxe_reclassify_recv_socket(struct 
socket *sock)
  }
static struct dst_entry *rxe_find_route4(struct rxe_qp *qp,
+                                        struct net *net,
                                         struct net_device *ndev,
                                         struct in_addr *saddr,
                                         struct in_addr *daddr)
  {
        struct rtable *rt;
-       struct flowi4 fl = { { 0 } };
+       struct flowi4 fl = {};
- memset(&fl, 0, sizeof(fl));

changing init of fl here and fl6 in the next function are not relevant
to this patch. It should be a different one after this set.

Thanks. The changes have been done. It is a trivial problem. Let us keep them in this patch series.


        fl.flowi4_oif = ndev->ifindex;
        memcpy(&fl.saddr, saddr, sizeof(*saddr));
        memcpy(&fl.daddr, daddr, sizeof(*daddr));
        fl.flowi4_proto = IPPROTO_UDP;
- rt = ip_route_output_key(&init_net, &fl);
+       rt = ip_route_output_key(net, &fl);
        if (IS_ERR(rt)) {
                rxe_dbg_qp(qp, "no route to %pI4\n", &daddr->s_addr);
                return NULL;
@@ -125,21 +124,21 @@ static struct dst_entry *rxe_find_route4(struct rxe_qp 
*qp,
#if IS_ENABLED(CONFIG_IPV6)
  static struct dst_entry *rxe_find_route6(struct rxe_qp *qp,
+                                        struct net *net,
                                         struct net_device *ndev,
                                         struct in6_addr *saddr,
                                         struct in6_addr *daddr)
  {
        struct dst_entry *ndst;
-       struct flowi6 fl6 = { { 0 } };
+       struct flowi6 fl6 = {};
- memset(&fl6, 0, sizeof(fl6));
        fl6.flowi6_oif = ndev->ifindex;
        memcpy(&fl6.saddr, saddr, sizeof(*saddr));
        memcpy(&fl6.daddr, daddr, sizeof(*daddr));
        fl6.flowi6_proto = IPPROTO_UDP;
- ndst = ipv6_stub->ipv6_dst_lookup_flow(sock_net(recv_sockets.sk6->sk),
-                                              recv_sockets.sk6->sk, &fl6,
+       ndst = ipv6_stub->ipv6_dst_lookup_flow(net,
+                                              rxe_ns_pernet_sk6(dev_net(ndev)), 
&fl6,

why dev_net(ndev) here?

Got it. I will fix it in the latest commits.

Zhu Yanjun



                                               NULL);
        if (IS_ERR(ndst)) {
                rxe_dbg_qp(qp, "no route to %pI6\n", daddr);



Reply via email to