Code Monkey home page Code Monkey logo

Comments (12)

erikarn avatar erikarn commented on July 20, 2024

yup, it's in kvprintf().

However, the problem is that ether_sprintf() calls sprintf(), and that calls the libc sprintf rather than the kernel print functions:

Breakpoint 4, 0x0000000801c04f64 in snprintf () from /lib/libc.so.7
(gdb) bt
#0 0x0000000801c04f64 in snprintf () from /lib/libc.so.7
#1 0x0000000000449ba3 in ether_sprintf (ap=0x81b40f198 "") at /home/adrian/git/github/erikarn/libuinet/lib/libuinet/../../sys/net/if_ethersubr.c:1169
#2 0x000000000040d568 in uinet_pfil_in_hook_v4 (arg=, m=, ifp=0x49e0b9, dir=457240984, inp=0x4a2a24) at uinet_api.c:1245
#3 0x000000000044d3e5 in pfil_run_hooks (ph=, mp=0x7ffffebf5d80, ifp=0x802ced900, dir=1, inp=0x0) at /home/adrian/git/github/erikarn/libuinet/lib/libuinet/../../sys/net/pfil.c:82
#4 0x000000000046af45 in ip_input (m=0x800710200) at /home/adrian/git/github/erikarn/libuinet/lib/libuinet/../../sys/netinet/ip_input.c:513
#5 0x000000000044c4ec in netisr_dispatch_src (proto=, source=, m=0x800710200) at /home/adrian/git/github/erikarn/libuinet/lib/libuinet/../../sys/net/netisr.c:1013
#6 0x000000000044a9fe in ether_input_internal (ifp=, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200, m=0x800710200,

from libuinet.

pkelsey avatar pkelsey commented on July 20, 2024

That is a FreeBSD kernel printf extension, but we are using the FreeBSD kernel printf.

from libuinet.

pkelsey avatar pkelsey commented on July 20, 2024

Ah, sprintf... let me look, probably not including the kernel version at the moment, but there's really not much reason not to.

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

Yeah I'm giving it a shot atm.

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

Interesting. If we include it in libuinet, even the userland code sees the symbol via the kernel definition, not the userland definition?

How'd you make printf() work right?

from libuinet.

pkelsey avatar pkelsey commented on July 20, 2024

That doesn't sound right, let me try to reproduce.

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

Ok, I'll go commit something in my repo that you can pull. But yeah, the userland code is calling the kernel code. Different bug. :-P

from libuinet.

pkelsey avatar pkelsey commented on July 20, 2024

What's the behavior you are getting that leads you to think the userland code is seeing the kernel definition?

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

I'll open a different bug for that. :)

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

I've fixed this in my tree:

erikarn@d541f3a

would you mind just manually pulling that and merging it in?

from libuinet.

erikarn avatar erikarn commented on July 20, 2024

hah, seems you already fixed it! Woo!

from libuinet.

pkelsey avatar pkelsey commented on July 20, 2024

Yeah I just committed the repro version I made here. It pulled the balance of the routines in from subr_prf.c, and it didn't have the linkage issue you reported.

from libuinet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.