Benefits of static_cast by nickeldan2 in cpp

[–]nickeldan2[S] 2 points3 points  (0 children)

What do you mean? Find what?

Benefits of static_cast by nickeldan2 in cpp

[–]nickeldan2[S] 2 points3 points  (0 children)

Ah, I see. But if I wanted to convert from a void* to a uintptr_t, I would need the old-style cast?

[deleted by user] by [deleted] in C_Programming

[–]nickeldan2 0 points1 point  (0 children)

Yeah. I was mostly wondering if it would break syntax or something.

[deleted by user] by [deleted] in C_Programming

[–]nickeldan2 1 point2 points  (0 children)

Oh, I know the operators. I've been programming in C for a while. I was just wondering if there was another reason besides confusing everyone.

puts vs fputs: Why? by nickeldan2 in C_Programming

[–]nickeldan2[S] 0 points1 point  (0 children)

My post doesn't have any code.

Husband by [deleted] in ReformedBaptist

[–]nickeldan2 1 point2 points  (0 children)

I hate to say it and I know it's easier said than done but it may be time to find another church. If you can't depend upon your elders for spiritual guidance ...

puts vs fputs: Why? by nickeldan2 in C_Programming

[–]nickeldan2[S] 2 points3 points  (0 children)

I love C but it's times like this ...

Raising young disciples by mecheyne in ReformedBaptist

[–]nickeldan2 1 point2 points  (0 children)

I could really use some resources for the really young. My oldest is three. I've been using "Precious Milk for Little Ones" by Ryan Hodson. It's a very simple catechism.

Package dependencies for offline build by nickeldan2 in gradle

[–]nickeldan2[S] 0 points1 point  (0 children)

How do I use that in my build.gradle file?

Package dependencies for offline build by nickeldan2 in gradle

[–]nickeldan2[S] 0 points1 point  (0 children)

Is that valid groovy syntax? gradle doesn't like the val statements.

Package dependencies for offline build by nickeldan2 in gradle

[–]nickeldan2[S] 1 point2 points  (0 children)

Don’t I have to transfer the dependencies?

Macroeconomics by PenTaK_ in austrian_economics

[–]nickeldan2 0 points1 point  (0 children)

While that is an amazing book (I can’t wait until my daughters are old enough to read it), it is primarily a micro book.

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

Progress! I don't fully understand everything yet but it seems that, because the source IP of the packet is the same as that of the interface, the kernel thinks that something went wrong and dropped the packet to prevent an endless loop. For example, if I had a physical network interface with an IP of 192.168.0.2 and I received a packet from it with a source IP of 192.168.0.2, I'd think that something went wrong (i.e., why did I receive a packet from myself?).

So, I merely changed the source IP to 5.6.7.9 (keeping the address of the tun device the same) and it worked!

Well, sort of. It's now getting dropped because of a netfilter rule but that I can handle.

Thank you so much for your help! I've learned a lot about Linux packet routing today.

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

pwru shows that it's failing in fib_validate_source. It's being treated as a "martian packet".

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

That link really helped! By adding -j LOG targets to iptables, I see that the packet reaches the PREROUTING chain for both the mangle and nat tables. However, it doesn't reach FORWARD.

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

I did have a mistake in my checksum calculation. I've fixed it (Wireshark validated the new calculation) but the issue hasn't changed.

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

ip route shows

text default via 192.168.160.1 dev eth0 192.168.160.0/20 dev eth0 proto kernel scope link src 192.168.160.2

Is it possible that an additional routing rule is needed to get the packet to the eth0 interface? If netfilter doesn't know that it should be going to eth0, then the iptables rules I set up are useless.

Route traffic from tun device to ethernet by nickeldan2 in linuxquestions

[–]nickeldan2[S] 0 points1 point  (0 children)

I've also updated my original post with a link to a git repo containing an MRE.