Tiny Core Base > Final Releases
Tiny Core v12.0
Rich:
Hi andyj
--- Quote from: andyj on February 19, 2021, 06:04:38 PM ---
--- Code: ---ERROR: modpost: "__divdi3" [/mnt/sdb1/lamp32-12/build/xtables-addons-3.15/extensions/pknock/xt_pknock.ko] undefined!
--- End code ---
--- End quote ---
The error is because __divdi3 is for doing a 64 bit division on a platform that doesn't support it:
https://gcc.gnu.org/onlinedocs/gccint/Integer-library-routines.html#Integer-library-routines
This seems to have a very good explanation and possible solution:
https://embdev.net/topic/129575
curaga:
The kernel doesn't export symbols that no module uses. So it could be that no original module used 64-bit divisions, in the 32-bit build.
CONFIG_UNUSED_SYMBOLS is not set, but TRIM_UNUSED_SYMBOLS is not set either.
https://github.com/lwfinger/rtl8723bu/issues/119 has the same issue, and it says to use do_div if the divisor is constant.
andyj:
I fixed it I think. It compiles anyway, I haven't actually tested the port knocking module. I would post the patch but I get "Internal Server Error" when trying to post it. Here is part of it.
--- Code: --- static inline bool
has_logged_during_this_minute(const struct peer *peer)
{
- return peer != NULL && peer->login_sec / 60 == ktime_get_seconds() / 60;
+ unsigned long x = ktime_get_seconds();
+ unsigned long y = peer->login_sec;
+ return peer != NULL && do_div(y, 60) == do_div(x, 60);
}
--- End code ---
Thanks to all who helped.
curaga:
That's probably worth submitting upstream, though the time type may be wrong.
Rich:
Hi andyj
I don't understand the point of the division operation here. What is being tested here appears to be:
if a/c == b/c
to which my response would be:
then a == b
So testing peer->login_sec / 60 == ktime_get_seconds() / 60 for equality would yield the same result
as testing peer->login_sec == ktime_get_seconds() for equality.
What am I missing here?
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version