Broken cv joint mount?

So im here once again to pick your brains again. I thought i had a new cv joint go out on me so i jacked up the truck this morning and found this…

The short section of axle housing had the end which the cv joint bolts to come off. Im asuming this is where my tranny leak was at. What am i looking at to fix this? Can i temporarily pop it back on with a hammer?

On closer inspection i cant quite even figure out how it stayed on there in the first place

That’s the right stub axle that connects the front differential to the CV shaft. Has nothing to do with the transmission.

You will have to remove the RF axle housing and remove the axle actuator parts to replace the shaft. And anything else that’s broken in there.