diff
- int smc_ib_find_route(struct net *net, __be32 saddr, __be32 daddr,
-                       u8 nexthop_mac[], u8 *uses_gateway)
+ int smc_ib_find_route(struct net *net, __be32 saddr, __be32 daddr,
+                       u8 nexthop_mac[], size_t nexthop_mac_size, u8 *uses_gateway)
...
- memcpy(nexthop_mac, neigh->ha, ETH_ALEN);
+ if (nexthop_mac_size >= ETH_ALEN) {
+     memcpy(nexthop_mac, neigh->ha, ETH_ALEN);
+ } else {
+     // Handle error: buffer too small
+     return -ENOSPC;
+ }
